导图社区 CFA二级:时间序列Time Seriies
时间序列 趋势模型、自回归模型*AR 时间序列预测的步骤 协方差平稳等内容
编辑于2019-12-30 14:43:49Time Series
Trend Models
linear trend
随时间增长固定的金额
log-linear trend
have exponential growth(指数式增长)
以固定增长率稳定增长
随时间增长固定的比率
In contrast, the linear trend model (Equation 1) predicts that ytgrows by a constant amount from one period to the next.
predicted trend value of yt
增长率
continuous compounding连续复利
线性趋势回归会有回归误差与观测值相关的问题,log会修正一些,但并没有解决。
Testing for Correlated Errors
DW-test
H0:没有序列相关问题,
使用趋势模型的前提是协方差平稳,协方差不平稳,则模型是无效的。
Autoregressive (AR) Time-Series Models
0<b1<1的时候,X的均值趋向于常数,误差项满足相关条件的时候属于协方差稳定序列b1=1的时候,X属于随机游走序列 b1=0的时候,相当于对随机游走序列进行一阶差分后的协方差稳定序列b1>1的时候,属于协方差不稳定序列,稳定增长的销售业绩属于此类序列
We must assume that the time series we are modeling is covariance stationary
以前看过一个介绍时间序列平稳性的帖子(跟楼主的问题不符),回忆如下:假设你看到两个酒鬼(即两个随机游走序列)四处流浪,醉鬼相互不认识(即他们是独立的),所以他们的路径之间没有任何有意义的关系。但假设这两个随机游走序列是醉鬼与他的狗,这时尽管每个单独的路径仍然是一个不可预知的随机游走过程,然而醉酒和狗两者之间的距离是可预见性。例如,如果狗远离于他的主人,狗会倾向于朝他的方向移动,所以这两个随机游走序列有接近的趋势)。醉鬼和他的狗组成了一对协整序列。如果两个非平稳的时间序列某些线性组合是平稳的,则可以说这两个序列具有协整关系。然后,我们就可以探索序列之间的长期均衡关系了。 作者:史晓斌链接:https://www.zhihu.com/question/21982358/answer/21491673来源:知乎著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。 人大多时候心情舒畅,平静,与人合平共处,此时这个人的状态就像经济学中的均衡,时间序列的平稳性,这表现在股票价格上就是股票处于盘整状态。人有时会失去理智,情绪失控,其行为就是异常行为,此种状态下的人就是经济学中的不均衡,时间序列的非平稳性,这表现在股票价格上就是股票处于疯狂上涨与下跌中。如果情绪极度失控,价格时间序列就会呈现,高波动性与脱离时间序列平衡性的现象。 作者:黄勇链接:https://www.zhihu.com/question/21982358/answer/36915898来源:知乎著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
Covariance-Stationary Series
the expected value of the time series must be constant and finite in all periods
t = 1, 2, …, T; s = 0, ±1, ±2, …, ±Twhere λ signifies a constant
the covariance of the time series with itself for a fixed number of periods in the past or future must be constant and finite in all periods
the variance of the time series must be constant and finite in all periods
怎么看是不是协方差平稳?直接看图,如果图显示出相同的均值和方差
所有滞后值的自相关系数=0
For a specific autoregressive model to be a good fit to the data, the autocorrelations of the error term should be 0 at all lags.
A random walk
前值+不可预测的随机项
revious period plus an unpredictable random error
不协方差平稳
If the time series is a random walk, it is not covariance stationary
带漂移的随机游走
A random walk with drift is a random walk with a nonzero intercept term.
有单位根
All random walks have unit roots.
如果一个时间序列有单位根,则不可能协方差平稳
单位根的处理
first-differencing the time series;(一阶拆分),对一阶拆分后的序列做自回归估计。
Moving-Average Time-Series Models
移动平均
滞后于实际,起到平滑数据的作用(如平滑季节性波动)
因为滞后的原因,不能起到预测的效果
MA(1) model
MA(q):A qth order moving-average model
ts first q autocorrelations are nonzero while autocorrelations beyond the first q are zero.
ARMA models
autoregressive moving average models
the parameters in ARMA models can be very unstable;
determining the AR and MA order of the model can be difficult;
ARMA models may not forecast well
ARCH
Autoregressive conditional heteroskedasticity model自回归条件异方差模型
If the coefficient on the squared residual is statistically significant, the time-series model has ARCH(1) errors
if a time-series model has ARCH(1) errors
多元时间序列问题
所有时间线都没有单元根,回归可用
If neither of the time series has a unit root, then we can safely use linear regression.
仅有其中一个时间序列有单元根,回归可不可用
If one of the two time series has a unit root, then we should not use linear regression
所有序列都有单元根,且时间序列协整,回归可用
If both time series have a unit root and the time series are cointegrated, we may safely use linear regression
所有序列都有单元根,且时间序列不协整,回归不可用
however, if they are not cointegrated, we should not use linear regression
(Engle–Granger) Dickey–Fuller test协整检验
The (Engle–Granger) Dickey–Fuller test can be used to determine if time series are cointegrated
时间序列的一些问题
协方差平稳会形成均值回归mean reverting
比较不同回归模型的准确性
The root mean squared error (RMSE)均方根误差:误差平方并均值的平方根
越小越好
时间序列模型的参数会不稳定,在使用时间序列模型用于估计时,要检测时间序列是否稳定。
时间序列预测的步骤
理解你遇到的投资问题,选择一个初始的时间序列模型
regression model
用一个变量预测另一个变量
time-series model
用同一个变量的前期数据预测该变量
如果使用时间序列模型,先画图看看是否是协方差平稳
不含
线性趋势a linear trend
指数趋势an exponential trend
季节性seasonality
样本区间内数据出现显著的偏离,均值或者协方差的的变化a significant shift
步骤
画图检查线性趋势或指数趋势是否最合理的
估计趋势参数
计算剩余residuals
Durbin–Watson statistic检测序列相关问题
若不存在
模型可用
若存在
使用自回归模型autoregressive model
autoregressive model
协方差平稳的处理violations of stationarity
a linear trend,
first-difference the time series(一阶差分).
exponential trend
take the natural log of the time series and then first-difference it 对数化时间序列,然后一阶拆分
shifts significantly during the sample period
estimate different time-series models before and after the shift
significant seasonality
include seasonal lags
自回归模型的构建
Estimate an AR(1) model
Test to see whether the residuals from this model have significant serial correlation。不存在序列相关问题,则AR(1)可用。
如果存在序列相关问题,使用AR(2)进行进一步估计,重复前述步骤。一直到不存在序列问题为止。
检查季节性问题
方法一:画图观察
方法二:Examine the data to see whether the seasonal autocorrelations of the residuals from an AR model are significant (for example, the fourth autocorrelation for quarterly data)
To correct for seasonality, add seasonal lags to your AR model. For example, if you are using quarterly data, you might add the fourth lag of a time series as an additional variable in an AR(1) or an AR(2) model.
检测异方差问题 conditional heteroskedasticity
ARCH(1)
Regress the squared residual from your time-series model on a lagged value of the squared residual.
Test whether the coefficient on the squared lagged residual differs significantly from 0
If the coefficient on the squared lagged residual does not differ significantly from 0, the residuals do not display ARCH and you can rely on the standard errors from your time-series estimates.
use generalized least squares or other methods to correct for ARCH
out-of-sample forecasting performance
浮动主题