21
1 Chapter 12 – Time Series Econometrics 引言 讨论时间序列不仅仅是因为时间序列在应用中非常广泛,而且是因为时间序列对计量经济学 家提出了不少挑战: 1、基于时间序列数据的实证工作通常假定隐含的时间序列是 stationary。那么,stationarity 是什么意思,为什么要担心这个问题? 2、前面我们已经学习了自相关,而且讨论了自相关的几种原因。有时候,自相关的产生是 由于时间序列是非平稳引起的。 3、在一个时序对另一个时序的回归中,有时候即使两个变量的关系没有什么意义,也会得 到很高的决定系数,这就是所谓的 spurious, or nonsense, regression (伪回归)。本节将介绍 伪回归是如何由于时间序列非平稳而引起的。 4、一些金融时间序列,如证券价格,显示随机游走现象。这就意味着对一个股票(IBM明天价格的最好预测就等于今天的价格加上一个纯粹的随机冲击(即误差项)。如果真是这 样,预测资产的价格就成为一个没有意义的练习而已。 5、设计时间序列数据的回归模型通常用来做预测。将讨论如果潜在的时间序列是非平稳的, 这种预测是否有效。 6、格兰杰和 Sims 因果检验假定时间序列是平稳的,因此在进行这些因果检验之前必须先进 行平稳性检验。 因此我们有必要先了解时间序列模型的基本概念。 以美国常用的经济时间序列为例:GDP, PDI, PCE, profitsdividends。从它们的时序图可以 看出,一个特征是每个序列 seem to be trending upward, albeit with fluctuations我们是否能够 speculate on the shape of theses curves over the future quarter period from the past time series? Perhaps we can if we know the statistical, or stochastic, mechanism, or the data generating process (DGP), that generated these curves? 为了了解这样的随机机制,我们首先来熟悉一下时间序列所特有的一些术语(vocabulary)。 1. Stochastic Processes; 2. Stationary Processes 3. Purely random processes 4. Nonstationary processes 5. Integrated variables 6. Random walk models 7. Cointegration 8. Deterministic and stochastic trends 9. Unit root tests

spurious, or nonsense, regressionsharecourse.upln.cn/...//usercontent/guoji/guCh12.pdf · 2018. 8. 4. · Chapter 12 – Time Series Econometrics 引言 ... or nonsense, regression

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: spurious, or nonsense, regressionsharecourse.upln.cn/...//usercontent/guoji/guCh12.pdf · 2018. 8. 4. · Chapter 12 – Time Series Econometrics 引言 ... or nonsense, regression

1

Chapter 12 – Time Series Econometrics

引言

讨论时间序列不仅仅是因为时间序列在应用中非常广泛,而且是因为时间序列对计量经济学

家提出了不少挑战: 1、基于时间序列数据的实证工作通常假定隐含的时间序列是 stationary。那么,stationarity是什么意思,为什么要担心这个问题? 2、前面我们已经学习了自相关,而且讨论了自相关的几种原因。有时候,自相关的产生是由于时间序列是非平稳引起的。 3、在一个时序对另一个时序的回归中,有时候即使两个变量的关系没有什么意义,也会得到很高的决定系数,这就是所谓的 spurious, or nonsense, regression(伪回归)。本节将介绍伪回归是如何由于时间序列非平稳而引起的。 4、一些金融时间序列,如证券价格,显示随机游走现象。这就意味着对一个股票(IBM)明天价格的最好预测就等于今天的价格加上一个纯粹的随机冲击(即误差项)。如果真是这

样,预测资产的价格就成为一个没有意义的练习而已。 5、设计时间序列数据的回归模型通常用来做预测。将讨论如果潜在的时间序列是非平稳的,这种预测是否有效。 6、格兰杰和 Sims因果检验假定时间序列是平稳的,因此在进行这些因果检验之前必须先进行平稳性检验。 因此我们有必要先了解时间序列模型的基本概念。 以美国常用的经济时间序列为例:GDP, PDI, PCE, profits,dividends。从它们的时序图可以看出,一个特征是每个序列 seem to be trending upward, albeit with fluctuations。 我们是否能够 speculate on the shape of theses curves over the future quarter period from the past time series? Perhaps we can if we know the statistical, or stochastic, mechanism, or the data generating process (DGP), that generated these curves? 为了了解这样的随机机制,我们首先来熟悉一下时间序列所特有的一些术语(vocabulary)。 1. Stochastic Processes; 2. Stationary Processes 3. Purely random processes 4. Nonstationary processes 5. Integrated variables 6. Random walk models 7. Cointegration 8. Deterministic and stochastic trends 9. Unit root tests

Page 2: spurious, or nonsense, regressionsharecourse.upln.cn/...//usercontent/guoji/guCh12.pdf · 2018. 8. 4. · Chapter 12 – Time Series Econometrics 引言 ... or nonsense, regression

2

1. Stochastic Processes

令 y为一个随机变量,连续的随机变量比如心电图,而离散的随机变量比如 GDP等,大部

分的经济变量在时间上是离散的,用 ty 表示。比如 1 2 88, , ,y y y 。Keep in mind that each of

these Y’s is a random variable. 我们把 GDP 看作一个随机过程可以这样理解:比如第一个观察值是 2872$,从理论上说,GDP 的第一个观察值可以取任何数值,这取决于当时主要的经济和政治气候,因此,数值2872 is a particular realization of all such possibilities。我们也可以把这个 2872数值看作是第一个观察值所有可能取值的一个均值。 因此,我们可以这样说,GDP 是一个随机过程,我们在某一个时期所观察到的实际值是这个随机过程的一个特别实现(GDP is a stochastic process and the actual values we observed for the period 1970I-1991IV are a particular realization of that process),也称作样本。 The distinction between the stochastic process and its realization is similar to the distinction between population and sample in cross-sectional data. Just as we use sample data to draw inferences about a population, in time series we use the realization to draw inferences about the underlying stochastic process. 所以这样的区分比较准确: 截面数据 总体 样本 时序数据 随机过程 特别实现

1) Stationary Stochastic Processes

一种受到广泛注意和研究的随机过程类型就是平稳随机过程:A stochastic process is said to be stationary if its mean and variance are constant over time and the value of the covariance between the two time periods depends only on the distance or gap or lag between the two time periods and not the actual time at which the covariance is computed. In the time series literature, such a stochastic process is known as a weakly stationary, or covariance stationary, or second-order stationary, or wide sense, stochastic process. 即这种平稳随机过程又称为弱平稳、协方差平稳、或二阶平稳随机过程。 严格平稳随机过程的概念:A time series is strictly stationary if all the moments of its probability distribution and not just the first two (i.e., mean and variance) are invariant over time. 弱平稳过程即严格平稳过程的情况:If the stationary process is normal, the weakly stationary stochastic process is also strictly stationary, for the normal stochastic process is fully specified by its two moments, the mean and the variance. 弱平稳随机过程可以表示为:

Page 3: spurious, or nonsense, regressionsharecourse.upln.cn/...//usercontent/guoji/guCh12.pdf · 2018. 8. 4. · Chapter 12 – Time Series Econometrics 引言 ... or nonsense, regression

3

( )( ) ( )

( )( )

2 2vart

t t

k t t k

E y

y E y

E y y

µ

µ σ

γ µ µ+

=

= − =

= − −

对于一个弱平稳随机过程的时间序列变量,其滞后一定时期的序列的均值、方差和自协方差

(不同跨度)仍然保持不变,即这些值不随着序列起始点的变化而变化。所以,弱平稳的时

间序列趋于 return to its mean (called mean reversion) and fluctuations around this mean (measured by its variance) will have a constant amplitude. 不符合上述(弱平稳)定义的时间序列称为 nonstationary time series,换句话说:A nonstationary time series will have a time-varying mean or a time-varying variance or both. 为什么平稳时间序列如此重要?这是因为,如果一个时间序列是不平稳的,我们只能研究所

考虑时期的变量行为,该时间序列的每一段数据只是一个特定的 episode,结果,不太可能把一个时期的结果推广到另一个时期。特别,对于预测的目的而言,这样的非平稳时序没有

什么用处。 我们有许多检验平稳性的统计检验。当然也可以描绘某个变量的趋势图:If we depend on common sense, it would seem that the depicted time series are nonstationary, at least in the mean values. 注意概念:基于均值不平稳?基于方差不平稳?还是基于⋯⋯ 再给出一个特殊类型的随机过程,即 purely random, or white noise, process (zero mean,

constant variance 2σ , serially uncorrelated)。

If it is also independent, such a process is called strictly white noise.

我们在 CNLRM 中曾假定误差项是一个白噪声过程,即 ( )20,t IIDNε σ∼ ,即: tε is

independently and identically distributed as a normal distribution with zero mean and constant variance.

2) Nonstationary Stochastic Processes

虽然我们的兴趣在平稳时间序列,但是我们经常会遇到非平稳时间序列,典型的例子就是随

机游走模型(Random Walk Model, RWM),比如资产价格如股票价格和汇率就服从随机游走,也就是说,它们是非平稳的。 Meese and Rogoff (1983, 1986) 我们区分两种类型的随机游走:1)random walk without drift (i.e., no constant or intercept term);2)random walk with drift (i.e., a constant term is present)。

Page 4: spurious, or nonsense, regressionsharecourse.upln.cn/...//usercontent/guoji/guCh12.pdf · 2018. 8. 4. · Chapter 12 – Time Series Econometrics 引言 ... or nonsense, regression

4

random walk without drift

模型为

1t t ty y ε−= +

这是一个 AR(1)模型,其中, tε 是一个白噪声误差项。

上述模型可以写为

0t ty y ε= +∑

( ) ( ) 20 , vart tE y y y tσ= =

可见,y 的均值不变(通常令 0y 为 0),但是方差随时间而无穷增大,违反了平稳条件,所

以 RWM without drift是一个非平稳随机过程。 RWM的一个有趣特征就是 persistence of random shocks (i.e., random errors)。由上边的公式也

知道, ty 等于 0y 加上随机冲击之和,因此,某一期的一个特定冲击始终包含在模型中,并

不随时间而消退,这也就是为什么称随机游走具有无穷记忆(infinite memory)的原因(Random walk remembers the shock forever; that is, it has infinite memory)。 对随机游走模型进行整理得到

1t t t ty y y ε−− = ∆ =

The first differences of a random walk time series are stationary.

random walk with drift

模型为

1t t ty yδ ε−= + +

这也是一个 AR(1)模型,其中,δ 称为 drift parameter。 整理为

1t t t ty y y δ ε−− = ∆ = +

同样可得

( )( )

0

2vart

t

E y y t

y t

δ

σ

= +

=

Page 5: spurious, or nonsense, regressionsharecourse.upln.cn/...//usercontent/guoji/guCh12.pdf · 2018. 8. 4. · Chapter 12 – Time Series Econometrics 引言 ... or nonsense, regression

5

可见,其均值和方差都随着时间的变化而变化,这违背了弱平稳的条件。因此:RWM, with or without drift, is a nonstationary stochastic process。 随机游走模型是单位根过程(unit root process)的一个例子。

3) Unit Root Stochastic Processes

1 1 1t t ty yρ ε ρ−= + − ≤ ≤

上述模型类似于自相关一章中所述的马尔可夫一阶自回归模型。

如果 1ρ = ,就是 RWM without drift,这时我们遇到的就是单位根问题,这是非平稳的一种

情况, ty 的方差是随时间而变化的。

The name unit root is due to the fact that 1ρ = . Thus the terms nonstationarity, random walk,

and unit root can be treated as synonymous.

如果 1ρ < ,这时根据协方差平稳的定义可知 ty 是平稳的。我们可证得 ( ) 0tE y = ,

( ) ( )2var 1/ 1ty ρ= − 。

因此,发现一个时间序列是否拥有单位根就是重要的,后面会介绍单位根检验,实际上也就

是平稳性检验。当然,一个时间序列可以包括不止一个单位根。

4) TS and DS Stochastic Processes

Trend Stationary (TS) and Difference Stationary (DS) Stochastic Processes 一个经济时间序列可以是趋势平稳的,或者是差分平稳的。趋势平稳的时间序列具有一个

deterministic trend,而差分平稳的时间序列具有一个 variable, or stochastic, trend。 把时间项或趋势线 t包括进回归模型以便 detrend the data的通常处理方法仅仅对趋势平稳时间序列是合理的。而 DF和 ADF检验可以用来检验一个时间序列是 TS还是 DS的。 所以,对平稳和非平稳随机过程的区别还要看趋势项(trend: the slow long-run evolution of the time series under consideration)是否是 deterministic或 stochastic的。 如果时间序列中的趋势可以完全被预测,并且不变化,这就称作 deterministic trend;如果趋势项不可预测,则称为 stochastic trend。 考虑下面一个模型

1 2 3 1t t ty t yβ β β ε−= + + +

Page 6: spurious, or nonsense, regressionsharecourse.upln.cn/...//usercontent/guoji/guCh12.pdf · 2018. 8. 4. · Chapter 12 – Time Series Econometrics 引言 ... or nonsense, regression

6

其中, tε 是白噪声。

我们可以得到以下几种可能: 1、Random Walk without drift (Pure Random Walk)

1 2 30, 0, 1β β β= = =

1t t ty y ε−= +

这就是 RWM without drift,是非平稳的。

而 t ty ε∆ = 则是平稳的。因此,

A RWM without drift is a difference stationary process (DSP).

即 ty 中的非平稳性可以通过差分而去除。

这也是一个 stochastic trend。 2、Random Walk with drift

1 2 30, 0, 1β β β≠ = =

1 1t t ty yβ ε−= + +

这是 RWM with drift,是非平稳的。其中, ty 将展示一个正的( 1β >0)或负的( 1β <0)trend,

这样的趋势称为 stochastic trend。

而 1t ty β ε∆ = + 也是一个差分平稳随机过程(DSP)。

3、Deterministic Trend

1 2 30, 0, 0β β β≠ ≠ =

1 2t ty tβ β ε= + +

尽管 ( ) ( ) 21 2 , vart tE y t yβ β σ= + = ,该过程还是称作 a trend stationary process (TSP)。

如果 1 2,β β 已知,均值可以很好地被预测,预测,从 ty 中减去 ty 的均值,结果就是平稳的,

所以称作 trend stationary。 This procedure of removing the (deterministic) trend is called detrending. 4、Random Walk with drift and deterministic trend

1 2 30, 0, 1β β β≠ ≠ =

1 2 1t t ty t yβ β ε−= + + +

Page 7: spurious, or nonsense, regressionsharecourse.upln.cn/...//usercontent/guoji/guCh12.pdf · 2018. 8. 4. · Chapter 12 – Time Series Econometrics 引言 ... or nonsense, regression

7

这里 ty 是不平稳的。

1 2t ty tβ β ε∆ = + +

5、Deterministic trend with stationary AR(1) component

1 2 30, 0, 1β β β≠ ≠ <

1 2 3 1t t ty t yβ β β ε−= + + +

这里 ty 是围绕着 deterministic trend的平稳过程。

比较随机性趋势和确定性趋势的叙述: As you can see from the Figure, in the case of the deterministic trend, the deviations from the trend line (which represents nonstationary mean) are purely random and they die out quickly; they do not contribute to the long-run development of the time series; in the case of the stochastic trend,

on the other hand, the random components tε affects the long-run course of the series yt.

5) Integrated Stochastic Processes

随机游走模型仅仅是一个更广泛随机过程,共积过程(Integrated Processes),的特例。 比如我们知道 RWM without drift是非平稳的,但是它的一阶差分是平稳的,因此,我们称

RWM without drift是 integrated of order 1,用 ( )1I 表示。

如果一个时间序列需要差分 twice以变成平稳的,那么称这个时间序列为 integrated of order

2。注意: ( )21 1 22t t t t t t ty y y y y y y− − −∆∆ = ∆ = ∆ − = − + , 2t t ty y y −∆∆ ≠ − 。

更广义地,如果一个时间序列必须差分 d次才能变成平稳的,则这个时间序列称为 integrated

of order d,可以表示为 ( )ty I d∼ 。

显然,如果一个时间序列一开始就是平稳的,则称 integrated of order 0,表示成 ( )0ty I∼ 。

Thus, we will use the terms “stationary time series” and “time series integrated of order zero” to mean the same thing.

大部分的经济时间序列是一阶共积的,即 ( )1I ,它们通过一阶差分可以变成平稳的序列。

Page 8: spurious, or nonsense, regressionsharecourse.upln.cn/...//usercontent/guoji/guCh12.pdf · 2018. 8. 4. · Chapter 12 – Time Series Econometrics 引言 ... or nonsense, regression

8

Properties of Integrated Series

1. ( ) ( ) ( )0 , 1 1t t t t tx I y I z x y I→ = +∼ ∼ ∼

2. ( ) ( )t t tx I d z a bx I d→ = +∼ ∼

特别

( ) ( )0 0t t tx I z a bx I→ = +∼ ∼

3. ( ) ( ) ( )1 2 2 1 2,t t t t tx I d y I d z ax by I d d d→ = + <∼ ∼ ∼

4. ( ) ( ) ( ),t t t t tx I d y I d z ax by I d ∗→ = +∼ ∼ ∼

d ∗通常等于 d,有时候d d∗ < (见 cointegration的情况)

为什么共积是重要的?我们都知道一个简单回归模型的斜率的 OLS估计量公式,如果 y是0阶共积的,x是一阶共积的,那么 x就是非平稳的,它的方差会无限增大,该参数估计量就会趋于 0。

2. Spurious Regression

为什么平稳的时间序列是如此重要?我们从非平稳序列的伪回归现象也可以看出:假设 y和 x都是 random walk model without drift,而且它们的误差项没有自相关,互相也不相关。由此可见:Both these time series are nonstationary; that is, they are I(1) or exhibit stochastic trends. 由于 x和 y是不相关的一阶共积过程,y对 x的回归应该显示其决定系数趋于 0,二者应该

没有什么关系。但是我们的回归结果显示,x的系数统计上显著, 2 0.1044, 0.0121R d= = ,

虽然决定系数不是很大,也是显著异于 0的。根本不相关的两个变量的回归结果却显示二者似乎是显著相关的,即使在大样本下有时候也是这样。这就是伪回归或无意义的回归

(spurious or nonsense regression)。其实极低的德宾沃特森 d值显示强的一阶自相关,与实

际不符,也说明发生了错误:An 2R d> is a good rule of thumb to suspect that the estimated

regression is spurious。 如果用一阶差分后的 y再对一阶差分后的 x进行回归,这时我们会发现决定系数确实等于 0,而且德宾沃特森 d值近似为 2。 所以:We should be extremely wary of conducting regression analysis based on time series that exhibit stochastic trends. And we should therefore be extremely cautious in reading too much in

Page 9: spurious, or nonsense, regressionsharecourse.upln.cn/...//usercontent/guoji/guCh12.pdf · 2018. 8. 4. · Chapter 12 – Time Series Econometrics 引言 ... or nonsense, regression

9

the regression results based on I(1) variables. To some extent, this is true of time series subject to deterministic trends.

3. Tests of Stationarity

这里讲解如何发现时间序列是否平稳,再次提醒,我们首要关心的是 weak, or covariance, stationarity。 本节主要讲解比较常用的三种检验平稳性的方法:1) graphical analysis, 2) correlogram test, 3) unit root test.

Graphical analysis

也就是绘制时间序列的时序图,这是正式检验的起点。

ACF and correlogram test,

一个简单的平稳性检验就是 Autocorrelation Function (ACF),定义如下:

0

kk

γργ

= = covariance at lag k / variance

并且: 00, 1k ρ= = 。

由于分子分母的测量单位相同,所以 kρ 是 unitless, or pure, number,像任何相关系数一样,

处于-1和+1之间。

如果用 kρ 对 k绘图,则称为 population correlogram(总体相关图)。

由于实际中我们只有随机过程的实现值(样本),我们只能利用 sample covariance at lag k和sample variance来计算 the sample autocorrelation function (SACF)。

0

kk

γργ

=

这样得到的图称为 sample correlogram。 如何据图判断是否平稳: 一个白噪声序列的 ACF围绕在 0轴周围,这也是平稳时间序列的大概 ACF图形。 一个随机游走序列的 ACF值很高,即使滞后很长,这也是非平稳时间序列的 ACF图形,即:

Page 10: spurious, or nonsense, regressionsharecourse.upln.cn/...//usercontent/guoji/guCh12.pdf · 2018. 8. 4. · Chapter 12 – Time Series Econometrics 引言 ... or nonsense, regression

10

自相关系数的起始值就很高,而且随着滞后的增长趋于 0的衰退很慢。当然这种非平稳可能是基于均值的,也可能是基于方差的,或者两者。 关于 ACF的滞后长度: 1、A rule of thumb is to compute ACF up to one-third to one-quarter the length of the time series. 2、另一个确定滞后长度的方法就是从较大的滞后开始,然后根据 AIC/SIC标准来降低滞后长度。 3、还可以使用下面的显著性检验:Statistical Significance of Autocorrelation Coefficients 也就是,如何确定某个滞后期的自相关系数是否统计上显著? 一种方法利用置信区间方法:Bartlett has shown that if a time series is purely random, that is, it

exhibits white noise, the sample autocorrelation coefficients kρ are approximately

( )0,1/k N nρ ∼ . That is

( )Pr 1.96 1/ 1.96 1/ 0.95k kkn nρ ρ ρ− ≤ ≤ + =

If the preceding interval includes the value of zero, we do not reject the hypothesis that the true

kρ is zero, but if this interval does not include 0, we reject the hypothesis that the true kρ is

zero.

不同于检验单个自相关系数是否显著,我们还可以进行 joint hypothesis that all the kρ up to

certain lags are simultaneously equal to zero. This can be done by using the Q statistic developed by Box and Pierce.

2

1

m

kk

Q n ρ=

= ∑ (n=sample size, m=lag length)

The Q statistic is often used as a test of whether a time series is white noise. In large samples, it is approximately distributed as the chi-square distribution with m df. If the computed Q exceeds the critical Q value, one can reject the null hypothesis that all the true

kρ are zero; at least some of them must be nonzero.

A variant of the Box-Pierce Q statistic is the Ljung-Box (LB) statistic,

( )2

2

1

2m

km

kQ n n

n kρ χ

=

= + −

∑ ∼

Although in large samples both Q and LB statistics follow the chi-square distribution with m df, the LB statistic has been found to have better (more powerful) small-sample properties than the Q statistic.

Page 11: spurious, or nonsense, regressionsharecourse.upln.cn/...//usercontent/guoji/guCh12.pdf · 2018. 8. 4. · Chapter 12 – Time Series Econometrics 引言 ... or nonsense, regression

11

unit root test.

在过去若干年最流行的平稳性(或非平稳性)检验就是单位根检验。 首先看单位根随机过程

1 1 1t t ty yρ ε ρ−= + − ≤ ≤

其中 tε 是白噪声。

假如 1ρ = ,即有单位根的情况下,上式就是 a random walk model without drift,是一个非平

稳的随机过程。所以为什么不直接把 yt对 yt-1进行回归然后看 ρ 的估计值是否统计上等于1呢?如果是,则 yt是非平稳的,这就是隐含在平稳性的单位根检验后面的 idea。 而实际上估计的不是上式,而是上式两边减去 yt-1并整理所得到的

( )1 11t t t ty y yρ ε− −− = − +

或 ( )1 1t t ty yδ ε δ ρ−∆ = + = −

这里零假设为 0δ = 。如果确实 0δ = ,即 1ρ = ,那么有一个单位根,即所分析的时间序

列是非平稳的;如果 0δ < ,则该时间序列是平稳的。

注意这里不能使用通常的 t 检验,因为在零假设 0δ = 下, 1ty − 估计参数的 t 统计量即使在

大样本下也不服从 t分布。

替代的,Dickey和 Fuller指出,在零假设 0δ = 下, 1ty − 估计参数的 t统计量服从 the τ (tau)

statistic。可以从附录中查找 tau statistic的临界值。In literature, the tau statistic or test is known as the Dickey-Fuller (DF) test. 如果零假设被拒绝,即时间序列是平稳的,就可以用通常的 t检验了。 To allow for the various possibilities, the DF test is estimated in three different forms:

RWM without drift 1t t ty yδ ε−∆ = +

Random Walk with drift 1 1t t ty yβ δ ε−∆ = + +

RWM with drift around a stochastic trend: 1 2 1t t ty t yβ β δ ε−∆ = + + +

注意对于上面三种模型,tau检验的临界值是不同的。 大体程序:

首先利用 OLS估计上面的某一个模型;把估计的 1ty − 的参数除以标准误得到 tau统计量;查

临界值;如果 tau统计量的绝对值超过临界值,拒绝零假设 0δ = ,则时间序列是平稳的,

Page 12: spurious, or nonsense, regressionsharecourse.upln.cn/...//usercontent/guoji/guCh12.pdf · 2018. 8. 4. · Chapter 12 – Time Series Econometrics 引言 ... or nonsense, regression

12

反之亦然。

The Augmented Dickey-Fuller (DF) test

在上式的 DF 检验中假设 tε 是不相关的,如果 tε 相关的话,Dickey 和 Fuller 又扩展了一个

Augmented Dickey-Fuller (ADF) test,就是在上述三种模型中再加入被解释变量的滞后值。比如

1 2 11

m

t t i t i ti

y t y yβ β δ α ε− −=

∆ = + + + ∆ +∑

The Phillips-Perron (PP) Unit Root Tests

DF 检验的重要假定是误差项 tε 是独立同分布的,而 ADF 检验通过增加被解释变量的滞后

值来调整 DF检验以考虑 tε 的可能自相关情况,而 Phillips和 Perron则不加入被解释变量的

滞后值,而是通过非参数统计方法来考虑 tε 的可能自相关。而且 PP 检验和 ADF 检验的渐

近分布是相同的。

4. Transforming Nonstationary Time Series

如果判断时间序列是非平稳的,则要把非平稳的时间序列转换成平稳的时间序列,如何进行

转换,则要看时间序列是属于差分平稳过程(DSP)还是趋势平稳过程(TSP)。 如果是差分平稳过程,则进行一阶差分转换可以。 如果是围绕着趋势线的 TSP,最简便的办法是把这个非平稳的时序对时期 t进行回归,得到的残差项就是平稳化的该时间序列,该残差序列也称为 detrended time series。当然回归中也可能包括 t的平方项,这时得到的平稳时间序列,即残差序列,称为quadratically detrended time series。 如果是 DSP,我们处理成了 TSP,称为 underdifferencing;如果是 TSP,处理成了 DSP,称为 overdifferencing。这两种设定误差的结果都是严重的。 注意:大部分宏观经济时间序列是 DSP而不是 TSP。

Page 13: spurious, or nonsense, regressionsharecourse.upln.cn/...//usercontent/guoji/guCh12.pdf · 2018. 8. 4. · Chapter 12 – Time Series Econometrics 引言 ... or nonsense, regression

13

5. Cointegration

我们已经知道,一个非平稳的时间序列对另一个或几个非平稳的时间序列进行回归可能产生

伪回归现象。 但是我们还会发现另一种现象,比如 PCE对 PDI回归,即

1 2t t tPCE PDIβ β ε= + +

其残差为 1 2t t tPCE PDIε β β= − − 。

PCE和 PDI这两个时序分别进行单位根检验,显示都是 I(1)过程,但是我们现在对残差 tε 进

行单位根检验,则发现该残差是平稳的了,即残差序列为 I(0)过程。因此,线性组合去除了两个序列中的 stochastic trend。因此,上述 PCE对 PDI的回归是有意义的,并不是伪回归。在这种情况下,我们说这两个变量是 cointegrated,而且传统的 t检验和 F检验等回归方法对这里涉及非平稳时间序列的情形是适用的。 因此:One way to guard against the spurious regression is to find out if the time series are cointegrated. A test for cointegration can be thought of as a pre-test to avoid spurious regression situations. 用协整理论的语言,上述回归称为 cointegration regression,其系数称为 cointegration parameters。对含 k个解释变量的模型同样适用。 定义: Cointegration means that despite being individually nonstationary, a linear combination of two or more time series can be stationary. The EG, AEG, and CRDW tests can be used to find out if two or more time series are cointegrated.

Testing for Cointegration

协整检验的方法很多,这里只考虑两种比较简单的方法:1)the DF or ADF unit root test on the residuals estimated from the cointegrating regression; 2) the cointegrating regression Durbin-Watson (CRDW) test。 注意:单位根检验和协整检验是有区别的:单位根检验通常是对单变量时间序列模型进行的;

而协整检验处理的则是一组变量之间的关系,其中每一个变量都有一个单位根。

(Augmented) Engle-Granger (AEG) tests

对于第一种检验方法,就是对协整回归得到的残差使用 DF 或 ADF 进行单位根检验。但是

Page 14: spurious, or nonsense, regressionsharecourse.upln.cn/...//usercontent/guoji/guCh12.pdf · 2018. 8. 4. · Chapter 12 – Time Series Econometrics 引言 ... or nonsense, regression

14

注意,由于残差是基于估计的协整参数的,原理 DF 或 ADF 的临界值不太适合这儿,所以Engle 和 Granger 重新计算了这些临界值,因此,这种情况下的 DF 或 ADF 检验又称为Engle-Granger (EG) and augmented Engle-Granger (AEG) tests。

CRDW tests

第二种快速的协整检验方法是 CRDW,其临界值首先由 Sargan和 Bhargava提供。这里使用由协整回归得到的 DW 值,但是现在的零假设是 0d = 而不是 2d = 。这时因为根据

( )2 1d ρ≈ − ,如果含有单位根,则估计的 ρ 等于 1,这就意味着 d等于 0。

Error Correction Mechanism (ECM)

上面已经知道 PCE和 PDI是协整的话,两个变量之间存在一种长期的、或均衡的关系,当然,从短期来讲,它们之间的关系可能是不均衡的。我们可以把上面所述的

1 2t t tPCE PDIε β β= − − 作为一种均衡误差,并利用它把 PCE的短期行为与其长期值联系

起来。 The error correction mechanism (ECM) first used by Sargan and later popularized by Engle and Granger correct for disequilibrium. The Granger representation theorem states that if two variables y and x are cointegrated, then the relationship between the two can be expressed as ECM. Therefore, ECM is a means of reconciling the short-run behavior of an economic variable with its long-run behavior. 可用下面的例子来说明:

1 2 3 1t t t tPCE PDI uα α α ε −∆ = + ∆ + +

这里 tu 是随机误差项,而 1 1 1 2 1t t tPCE PDIε β β− − −= − − 是协整回归之残差的滞后一期序列。

解释:首先假定 tPDI∆ 为 0。如果 1tε − 为正,则 1tPCE − 高于其均衡值( 1 2 1tPDIβ β −+ )。

因为 3α 通常假定为负,所以 3 1tα ε − 为负,因此, tPCE∆ 将是负值以恢复均衡。也就是说,

如果 tPCE (退后一期说明)高于其均衡值,在下一期它将下降以修正均衡误差,hence the

name ECM。如果 1tε − 为负,即 1tPCE − 低于其均衡值, tPCE∆ 将是正的,导致 tPCE 得到增

加。因此 3α 决定了均衡得到回复的速度。实际中, 1 1 21 1t t tPCE PDIε β β− − −= − − 。

Page 15: spurious, or nonsense, regressionsharecourse.upln.cn/...//usercontent/guoji/guCh12.pdf · 2018. 8. 4. · Chapter 12 – Time Series Econometrics 引言 ... or nonsense, regression

15

诺贝尔奖获得者格兰杰对协整理论的贡献: 协整理论主要用来探测变量间是否真的存在均衡相依关系,对于用非平稳变量建立经济计量模型,以及检验这些变量之间的长期均衡关系非常重要。首先,如果多个非平稳变量具有协整性,则这些变量可以合成一个平稳的时间序列。这个平稳的时间序列可用来描述原变量间的均衡关系。只要均衡关系存在,原变量间的平稳的线性组合就存在。其次,当且仅仅当若干个非平稳变量具有协整性时,由这些变量建立的回归模型才有意义。所以,协整性检验也是区别真实回归和伪回归的有效方法。最后,具有协整关系的非平稳变量可以用来建立误差修正模型。由于误差修正模型把长期关系和短期动态特征结合在一个模型中,因此既可以解决传统计量经济模型忽视伪回归的问题,又可以克服建立差分模型忽视水平变量信息的弱点。 格兰杰在协整概念的基础上,进一步提出了著名的格兰杰协整定理,目的在于解决协整与误差修正模型之间的关系问题。该定理的重要意义就在于其证明了协整概念与误差修正模型的

必然联系。若非平稳变量之间存在协整关系,则必然可以建立误差修正模型;若用非平稳变量可以建立误差修正模型,则该变量之间必然存在协整关系。在随后的工作中,格兰杰拓展了协整分析,包括处理季节趋势序列的季节协整和处理偏离超过临界值后即向均衡调整的序列的门限协整。

6. Forecasting

预测是计量经济分析的一个重要内容,尤其对特定的人群。我们如何预测经济变量,如 GDP、通货膨胀、汇率、股票价格、失业率以及无数的其它经济变量呢? 本章主要介绍预测的两个流行的方法:1)ARIMA, or Box-Jenkins methodology;2)VAR。另外,还讨论金融资产价格预测的特殊问题,这些资产价格由 volatility clustering现象所刻划,即一段时期大幅度摆动,接着一段时期相对比较平静,这种变化性聚类可由 ARCH 或GARCH模型来捕捉。 把这一章的预测方法与前面内容联系起来的纽带就是:下面讨论的各种预测方法都假定时间

序列是平稳的,或者通过适当的变换可以使得时间序列变成平稳的序列。

Approaches to economic forecasting

基于时间序列数据的预测方法大概有 5种,如下: 1. Exponential smoothing methods 该方法又有好多种:single exponential smoothing, Holt’s linear method, Holt-Winters’ method 不过这些方法现在用的不多,已经被更好的方法所取代 2. Single-equation regression models 这也是本书主要讨论的模型。我们估计一个合适的回归模型,然后用来进行预测。我们知道,

如果预测的未来时期越远,预测误差将会快速增加。

Page 16: spurious, or nonsense, regressionsharecourse.upln.cn/...//usercontent/guoji/guCh12.pdf · 2018. 8. 4. · Chapter 12 – Time Series Econometrics 引言 ... or nonsense, regression

16

3. Simultaneous-equation regression models 利用联立方程组来进行预测在 60年代和 70年代的美国曾盛极一时,而且成为那个时代预测的主流方法,但是由于联立方程组方法并没有体现很好的预测表现,特别是没有很好预测出

73年和 79年石油价格冲击所带来的经济变化,再加之 Lucas critique,这种方法开始衰退。 卢卡斯批评的主要内容就是,一个计量模型所估计的参数依赖于模型所估计时期的政策并且

将随着政策的变化而改变,也就是说,估计的参数在出现政策改变时就不再是不变的了。

With such a policy change, an econometric model estimated from past data will have little forecasting value in the new regime. 4. Autoregressive integrated moving average models (ARIMA) 这是新的预测工具。 Popularly known as the Box-Jenkins (BJ) methodology, but technically known as the ARIMA methodology, the emphasis of these methods is not on constructing single-equation or simultaneous-equation models but on analyzing the probabilistic, or stochastic, properties of economic time series on their own under the philosophy let the data speak for themselves. 与回归模型不同,BJ类型的时间序列模型考虑的是 yt被滞后的 y值和随机误差项所解释。基于这样原因,ARIMA模型有时候也称为非理论模型,因为它们不是从经济理论推导出来的。而经济理论却通常是联立方程组等回归模型的基础。 当然这里只介绍单变量 ARIMA模型,即只涉及一个时间序列。完全可以推广到 multivariate ARIMA models。 5. Vector autoregression (VAR) 向量自回归(VAR)类似于联立方程组模型,但是,VAR 中,每个内生变量只被它自身的滞后和其它内生变量的滞后所解释,通常,在 VAR中不存在外生变量。

7. AR, MA, ARIMA

以 GDP为例,用 ty 表示,其水平变量是非平稳的,其一阶差分形式是平稳的。

1) AR process

( ) ( )1 1t t ty yδ α δ ε−− = − +

其中,δ 是 y 的均值, tε 是白噪声。因此,我们说 ty 服从一阶自回归,即 AR(1),随机过

程。注意:The y values are expressed as deviations from their mean value。 一般地,

Page 17: spurious, or nonsense, regressionsharecourse.upln.cn/...//usercontent/guoji/guCh12.pdf · 2018. 8. 4. · Chapter 12 – Time Series Econometrics 引言 ... or nonsense, regression

17

( ) ( ) ( ) ( )1 1 2 2t t t p t p ty y y yδ α δ α δ α δ ε− − −− = − + − + + − +

称 ty 服从 p阶自回归,即 AR(p),随机过程。

从某种意义上说,该模型也是在联立方程组中所说的退化形式方程。

2) MA process

0 1 1t t ty µ β ε β ε −= + +

其中,µ是常数项,ε 是白噪声。因此,我们说 ty 服从一阶移动平均,即 MA(1),随机过

程。 一般地,

0 1 1 2 2t t t t q t qy µ β ε β ε β ε β ε− − −= + + + + +

称 ty 服从 q阶移动平均,即MA(q),随机过程。

简单地说,移动平均过程仅仅是白噪声误差项的线性组合。

3) ARMA process

1 1 0 1 1t t t ty yθ α β ε β ε− −= + + +

称 y服从一个 ARMA(1,1)过程。

4) ARIMA process

上面所讨论的模型都是基于时间序列是平稳的假定。但是大部分经济时间序列是不平稳的,

或者说,它们是共积的。 我们也知道,如果时间序列是 I(d)的,差分 d次以后就能够得到 I(0)的序列。如果我们差分d次得到平稳的时间序列后再使用 ARMA模型,得到的就是 ARIMA(p, d, q)模型。 再次讲述平稳性假定的重要性:BJ 方法的目的就是识别和估计一个生成该样本数据的统计模型。如果该估计模型被用来进行预测,我们必须假定该模型的特征不随时间的改变而改变,

特别在未来预测期。因此,要求平稳性数据的一个简单理由就是任何由该数据推导而得的模

型才能被自身平稳解释,这是提供有效预测的基础。

Page 18: spurious, or nonsense, regressionsharecourse.upln.cn/...//usercontent/guoji/guCh12.pdf · 2018. 8. 4. · Chapter 12 – Time Series Econometrics 引言 ... or nonsense, regression

18

The Box-Jenkins (BJ) methodology

我们如何知道一个时间序列到底属于上述 4个过程的哪一个呢?也就是,我们要确定 p、d、q的值。通常有 4步流程: 1)Identification 2)Estimation 3)Diagnostic Checking 4)Forecasting 对于第一个识别问题,通常用 correlogram或 partial correlogram来完成。即 ACF和 PACF。 前面已经叙述过 ACF的定义,而 PACF类似于偏回归参数:

The partial autocorrelation kkρ measures correlation between observations that are k time

periods apart after controlling for correlations at intermediate lags (i.e., lag less than k). 当然,我们计算的是样本 PACF。 总之看图的时候,如果 ACF 或 PACF 的值很大,就是统计上显著异于 0,反之,就是不显著异于 0。 注意:The ACF and PACF of AR(p) and MA(q) processes have opposite patterns; in the AR(p) case the AC declines geometricaaly or exponentially but the PACF cuts offf after a certain number of lages, whereas the opposite happens to an MA(q) process. 总之根据样本 ACF和 PACF来确定 pdq的值需要大量的经验。大概模式如下: Theoretical patterns of ACF and PACF: Model Typical pattern of ACF Typical pattern of PACF AR(p) decays exponentially or with damped significant spikes through lags p Sine wave pattern or both MA(q) significant spikes through lags q declines exponentially ARMA(p,q) exponential decay exponential decay 对于第二个估计问题,有时候用简单的 OLS 可以完成,有时候则必须依赖于 nonlinear (in parameter) estimation method。 对于第三个诊断校验问题,就是说,也许有另一个 ARMA模型也能够很好拟合该数据,我们必须判断我们所使用的 ARMA模型是否理想。一个方法就是判断残差是否是白噪声(也用 ACF或 PACF来判断,必须 ACF或 PACF没有一个值统计上显著),如果不是,必须重新开始,因此 BJ方法是一个 iterative process。 对于第四个预测问题。ARIMA模型的流行之处就在于它的成功预测,在很多时候,由它所得到的预测比传统计量模型预测的结果更可靠,特别在短期预测的时候。 关于 BJ 方法还有许多其它的主题,比如 seasonality,可以通过 4 次差分来去除季度数据的季节影响。

Page 19: spurious, or nonsense, regressionsharecourse.upln.cn/...//usercontent/guoji/guCh12.pdf · 2018. 8. 4. · Chapter 12 – Time Series Econometrics 引言 ... or nonsense, regression

19

8. VAR

前面所述的联立方程组模型中既有内生变量,又有外生变量(外生变量和滞后的内生变量)。

但是 Sims批评说,如果真的存在变量间的联立性,则应该同等对待它们,不应该先验地区分内生变量和外生变量,正是根据这个精神,Sims提出了 VAR模型。比如前面格兰杰因果检验中提到的 GDP-M模型。 VAR模型中的随机误差项使用 VAR的语言又称为 impulses or innovations or shocks。

1) Estimation of VAR

我们可以利用 SURE(seemingly unrelated regression)或 2SLS等系统技术来同时估计 VAR的每一个方程;然而,如果每一个回归方程包含相同数目的滞后内生变量,对每个方程分开

用 OLS进行估计会得到同样有效的估计结果。 联立方程组不能使用 OLS 进行估计,是因为解释变量中含有当期的其它内生变量,滞后的内生变量作为解释变量看作是外生的;而在 VAR的解释变量中不含有当期的内生变量,而滞后的内生变量作为解释变量也看作是外生的,所以,VAR的每一个方程可以使用 OLS进行估计。 如此看来,VAR比联立方程组要简单了。 既然是 OLS 回归,因此对回归结果的解释就和以前一样了。也许不是每一个滞后的解释变量都显著,但是高的 F统计量会使得我们不能够拒绝 the hypothesis that collectively all the lagged terms are statistically significant。 至于 VAR 中滞后的期数可以根据 AIC 和 SIC 信息标准来判断,分别估计几个 VAR,选择AIC和 SIC值较小的那个滞后期数的 VAR模型。

2) Forecasting with VAR

通常方法。

3) VAR and Causality

前面学过了格兰杰和 Sims的因果检验。而 ECM中 Granger representation theorem的一个含义就是如果两个变量,xt和 yt,是协整的,且每一个是 I(1)的,那么 either xt must Granger-cause yt or yt must Granger-cause xt。对于两个变量而言,这就意味着:

Page 20: spurious, or nonsense, regressionsharecourse.upln.cn/...//usercontent/guoji/guCh12.pdf · 2018. 8. 4. · Chapter 12 – Time Series Econometrics 引言 ... or nonsense, regression

20

首先必须检验这两个变量是否各自是 I(1)的,然后看它们是否是协整的,如果不是这样,那么因果检验的整个问题就没有什么意义了。

4) Problems with VAR

VAR的优点:1)方法简单,不需要决定哪些是内生变量,哪些是外生变量,都是内生变量(有时候,纯粹的外生变量也被包含进来以考虑 trend and seasonal factors);2)估计简单,即通常的 OLS方法可以用来分开估计每一个方程;3)预测结果在许多情况下都好于更复杂的联立方程组模型。 VAR的问题: 1)与联立方程组不同,VAR模型是非理论模型,基本上不使用先验信息。我们知道在联立方程组模型中,加入或去除一些特定的变量在识别模型上起着很重要的作用。 2)由于 VAR重在预测,所以不太适合于 policy analysis。 3)VAR模型实际使用中最大挑战是确定合适的滞后长度。如果 VAR模型有 m个方程和 m

个变量的 p 个滞后值,则我们要估计 ( )2m pm+ 个参数,如果样本容量不大,估计这么多

的参数将消耗太多的自由度。 4)严格讲,在 m个方程的 VAR模型中,所有的 m个变量都必须是平稳的。如果不是这样,则不得不对一些变量进行适当的转换,但是 Harvey指出,根据转换后数据得到的 VAR模型的结果也许不太理想,他进一步指出,VAR 使用者通常在 level 形式上使用 VAR 模型,即使其中一些序列是非平稳的,这时必须重点看单位根对估计量分布的效应。所以,是否把不

平稳的变量转换成平稳的变量仍然是 VAR使用中的一个问题。 5)由于 VAR模型中所估计的个别参数不容易解释,研究者通常估计脉冲反应函数(impulse response function, IRF)。脉冲反应函数追踪的是 VAR系统中被解释变量对某一个误差项的冲击(比如 increase by a value of one standard deviation)的连续未来几期的反应过程。脉冲反应函数的使用是 VAR分析的 centerpiece。

9. ARCH, GARCH

如前所述,金融时间序列常常表现出 volatility clustering的现象。在许多领域,volatility都是很重要的,高的变动性可能意味着高的损失或收益,因此带来高的不确定性。如何模型具

有如此变动性的金融时间序列呢? 我们知道,大部分这样的金融时间序列在 level form上是随机游走的,即是非平稳的,但是在一阶差分形式上,它们通常是平稳的。因此,代之以模型这些金融时间序列的水平形式,

为什么不模型它们的一阶差分形式呢?但是,一阶差分形式通常展示很大的摆动性,即变动

性,这就意味着它们的方差随时间而改变(因此也不符合弱平稳的定义),如何模型这种变

动的方差(异方差)呢?这就是 ARCH模型所要做的。 原始模型:

Page 21: spurious, or nonsense, regressionsharecourse.upln.cn/...//usercontent/guoji/guCh12.pdf · 2018. 8. 4. · Chapter 12 – Time Series Econometrics 引言 ... or nonsense, regression

21

1 2 2t t aK tK ty x xβ β β ε= + + + +

其中, ( )0, vart tNε ε ∼ ,这里 tε 的正态性假定对我们来说并不陌生,比较新颖的是赋予

方差一个自回归结构:

( ) 2 2 2 20 1 1 2 2var t t t t p t pε σ α α ε α ε α ε− − −= = + + + +

可见,出现了自相关。 如果没有自相关,则

0 1 2: 0pH α α α= = = =

这时也就没有 ARCH效应。

既然2tσ 不能被观察,Engle提出用原始回归模型 OLS回归的残差来代替,则

2 2 2 20 1 1 2 2t t t p t pe e e eα α α α− − −= + + + +

可以使用 F检验来检验这个零假设,即计算 2nR ,其中 2R 就是上一行辅助回归的决定系数。

我们有

2 2asy pnR χ∼

在异方差修正这节,我们是用 OLS对转换后的数据进行回归,把 OLS应用于转换后的模型的方法就是 GLS。这里,如果 ARCH效应确实存在的话,也就是说明了异方差存在,必须使用 GLS方法。 在自相关章节我们也曾说,德宾沃特森 DW 检验得出的自相关可能是纯粹的自相关,也可

能是模型设定误差所引起,这里又增加了一种可能的原因,即由于 ARCH 效应导致的设定误差所引起的自相关。 ARCH 模型的一个著名的变形就是广义自相关条件异方差模型(GARCH)。最简单的GARCH(1,1)模型为

2 2 20 1 1 2 1t t tσ α α ε α σ− −= + +

(陈诗一)