Large-sample properties of OLSOLS 的大樣本性質

Week 10 estimated models with lagged dependent variables and used t and F tests on them, with the promise that this works in large samples. That promise needs justifying: such models break the assumption behind unbiasedness, and their errors are rarely normal. This week replaces unbiasedness with consistency, and exact normality with approximate normality from the central limit theorem, and shows what each requires.

第 10 週估計了包含滯後被解釋變數的模型,並在大樣本下對它們進行 t 和 F 檢定。這需要理據:這類模型違反了無偏性背後的假設,其誤差也很少是正態的。本週以一致性取代無偏性,以中央極限定理帶來的近似正態取代準確正態,並說明各自需要甚麼條件。

Builds on 先修內容
Week 7, Week 10
Reading time 閱讀時間
About 40 minutes
Data 數據
nyse
Code 程式碼
R, Python

Why large samples?為甚麼需要大樣本?

Week 7 proved OLS unbiased under A1–A3, where A3 is E⁡(u∣X)=0\operatorname{E}(\mathbf{u} \mid \mathbf{X}) = \mathbf{0}. With time series, X\mathbf{X} holds the regressors of every period, so A3 requires each error utu_t to be uncorrelated with the regressors of all periods, past and future:

第 7 週證明了 OLS 在 A1–A3 下無偏,其中 A3 是 E⁡(u∣X)=0\operatorname{E}(\mathbf{u} \mid \mathbf{X}) = \mathbf{0}。對時間序列而言,X\mathbf{X} 包含所有時期的解釋變數,所以 A3 要求每個誤差 utu_t 與所有時期(過去和將來)的解釋變數都不相關:

Corr⁡(ut,xs)=0for all t,s=1,…,n.\operatorname{Corr}(u_t, x_s) = 0 \quad \text{for all } t, s = 1, \dots, n.

An AR(1) model, yt=β0+β1yt−1+uty_t = \beta_0 + \beta_1 y_{t-1} + u_t, cannot satisfy this. Its regressor in period t+1t + 1 is yty_t, and yty_t contains utu_t. So utu_t is correlated with a future regressor: Cov⁡(ut,yt)=Var⁡(ut)≠0\operatorname{Cov}(u_t, y_t) = \operatorname{Var}(u_t) \neq 0.

AR(1) 模型 yt=β0+β1yt−1+uty_t = \beta_0 + \beta_1 y_{t-1} + u_t 無法滿足這一點。它在第 t+1t + 1 期的解釋變數是 yty_t,而 yty_t 包含 utu_t。所以 utu_t 與未來的解釋變數相關:Cov⁡(ut,yt)=Var⁡(ut)≠0\operatorname{Cov}(u_t, y_t) = \operatorname{Var}(u_t) \neq 0。

Without A3 the Week 7 proof fails, and in fact OLS is biased in any model with a lagged dependent variable. For an AR(1) the bias is roughly −(1+3β1)/n-(1 + 3\beta_1)/n: with β1=0.5\beta_1 = 0.5 and 25 observations, the average estimate is about 0.40. Normality fails too: most economic and financial series have skewed or fat-tailed errors. So two questions remain. Does OLS get close to the truth when the sample is large? And are its t and F tests still approximately valid?

沒有 A3,第 7 週的證明便不成立;事實上,任何包含滯後被解釋變數的模型,OLS 都是有偏的。對 AR(1) 而言,偏誤大約是 −(1+3β1)/n-(1 + 3\beta_1)/n:當 β1=0.5\beta_1 = 0.5、有 25 個觀測值時,估計值的平均約為 0.40。正態性同樣不成立:大部分經濟和金融序列的誤差都是偏態或厚尾的。於是剩下兩個問題:樣本大時,OLS 是否接近真值?它的 t 和 F 檢定是否仍然近似有效?

Consistency一致性

An estimator θ^n\hat\theta_n, computed from nn observations, is consistent for θ\theta if the probability that it misses by more than any fixed amount goes to zero as nn grows:

由 nn 個觀測值計算的估計量 θ^n\hat\theta_n,如果它偏離真值超過任何固定數量的機率,隨 nn 增大而趨向零,它便是 θ\theta 的一致估計量:

Pr⁡(∣θ^n−θ∣>ε)→0for every ε>0.\Pr\big(|\hat\theta_n - \theta| > \varepsilon\big) \to 0 \quad \text{for every } \varepsilon > 0.

We say θ^n\hat\theta_n converges in probability to θ\theta and write plim⁡θ^n=θ\operatorname{plim} \hat\theta_n = \theta or θ^n→pθ\hat\theta_n \xrightarrow{p} \theta. Unbiasedness is about the centre of the distribution at a fixed nn; consistency is about the whole distribution collapsing onto the truth as nn grows.

我們說 θ^n\hat\theta_n 依機率收斂到 θ\theta,記作 plim⁡θ^n=θ\operatorname{plim} \hat\theta_n = \theta 或 θ^n→pθ\hat\theta_n \xrightarrow{p} \theta。無偏性關乎固定 nn 下分佈的中心;一致性則關乎整個分佈隨 nn 增大而收縮到真值上。

The sample mean. For i.i.d. X1,…,XnX_1, \dots, X_n with mean μ\mu and variance σ2\sigma^2, Xˉ\bar X has mean μ\mu and variance σ2/n\sigma^2/n. As nn grows the variance vanishes, so Xˉ\bar X is consistent. This is the law of large numbers.

樣本均值。對於均值為 μ\mu、方差為 σ2\sigma^2 的獨立同分佈 X1,…,XnX_1, \dots, X_n,Xˉ\bar X 的均值是 μ\mu,方差是 σ2/n\sigma^2/n。隨 nn 增大,方差消失,所以 Xˉ\bar X 是一致的。這就是大數定律。

Show every step: why the sample mean is consistent 顯示完整推導:為甚麼樣本均值是一致的

Chebyshev’s inequality says that for any random variable ZZ with mean μZ\mu_Z and variance σZ2\sigma_Z^2, Pr⁡(∣Z−μZ∣>ε)≤σZ2/ε2\Pr(|Z - \mu_Z| > \varepsilon) \leq \sigma_Z^2/\varepsilon^2. Apply it to Xˉ\bar X:

切比雪夫不等式指出,對任何均值為 μZ\mu_Z、方差為 σZ2\sigma_Z^2 的隨機變數 ZZ,都有 Pr⁡(∣Z−μZ∣>ε)≤σZ2/ε2\Pr(|Z - \mu_Z| > \varepsilon) \leq \sigma_Z^2/\varepsilon^2。把它應用到 Xˉ\bar X:

Pr⁡(∣Xˉ−μ∣>ε)≤σ2nε2→0.\Pr\big(|\bar X - \mu| > \varepsilon\big) \leq \frac{\sigma^2}{n\varepsilon^2} \to 0.

However small ε\varepsilon is, the bound goes to zero. The same argument works for any estimator whose bias and variance both go to zero.

無論 ε\varepsilon 多小,上界都趨向零。同樣的論證適用於任何偏誤和方差都趨向零的估計量。

The two properties are different, and neither implies the other:

兩個性質並不相同,也不互相蘊含:

  • Biased but consistent: X~=Xˉ+1/n\tilde X = \bar X + 1/n has mean μ+1/n\mu + 1/n, so it is biased, but the bias and the variance σ2/n\sigma^2/n both vanish.

    有偏但一致:X~=Xˉ+1/n\tilde X = \bar X + 1/n 的均值是 μ+1/n\mu + 1/n,所以有偏,但偏誤和方差 σ2/n\sigma^2/n 都會消失。

  • Unbiased but inconsistent: the first observation X1X_1 has mean μ\mu, but its variance stays σ2\sigma^2 however large the sample.

    無偏但不一致:第一個觀測值 X1X_1 的均值是 μ\mu,但無論樣本多大,它的方差都維持 σ2\sigma^2。

OLS is consistentOLS 的一致性

Consistency of OLS needs a weaker version of A3: each error need only be unrelated to the regressors of its own period,

OLS 的一致性只需要 A3 的較弱版本:每個誤差只需與其同期的解釋變數無關:

A3′ ⁣:E⁡(ut∣xt)=0,xt=(xt1,…,xtk).\begin{aligned} \text{A3}^\prime\!: \quad &\operatorname{E}(u_t \mid \mathbf{x}_t) = 0, \\ &\mathbf{x}_t = (x_{t1}, \dots, x_{tk}). \end{aligned}

Under A1, A2 and A3′, and if the data are stationary and weakly dependent (observations far apart in time are close to independent, so a law of large numbers applies), OLS is consistent: plim⁡β^=β\operatorname{plim} \bhv = \boldsymbol{\beta}. The AR(1) model satisfies A3′ when utu_t is white noise: yt−1y_{t-1} depends only on past shocks, and utu_t is a new one.

在 A1、A2 和 A3′ 下,如果數據是平穩且弱相依的(時間上相距很遠的觀測值接近獨立,使大數定律適用),OLS 便是一致的:plim⁡β^=β\operatorname{plim} \bhv = \boldsymbol{\beta}。當 utu_t 是白噪音時,AR(1) 模型滿足 A3′:yt−1y_{t-1} 只取決於過去的衝擊,而 utu_t 是新的衝擊。

Show every step: why OLS is consistent 顯示完整推導:為甚麼 OLS 是一致的

Simple regression. Substitute yt=β0+β1xt+uty_t = \beta_0 + \beta_1 x_t + u_t into the slope formula and divide the top and bottom by nn:

簡單回歸。把 yt=β0+β1xt+uty_t = \beta_0 + \beta_1 x_t + u_t 代入斜率公式,分子分母同除以 nn:

β^1=β1+1n∑t(xt−xˉ)ut1n∑t(xt−xˉ)2.\bh_1 = \beta_1 + \frac{\frac{1}{n}\sum_t (x_t - \bar x) u_t}{\frac{1}{n}\sum_t (x_t - \bar x)^2}.

Both are averages. By the law of large numbers the numerator converges to Cov⁡(xt,ut)\operatorname{Cov}(x_t, u_t) and the denominator to Var⁡(xt)>0\operatorname{Var}(x_t) > 0. The plim of a ratio is the ratio of the plims, so

兩者都是平均數。根據大數定律,分子收斂到 Cov⁡(xt,ut)\operatorname{Cov}(x_t, u_t),分母收斂到 Var⁡(xt)>0\operatorname{Var}(x_t) > 0。比率的機率極限等於機率極限之比,所以

plim⁡β^1=β1+Cov⁡(xt,ut)Var⁡(xt).\operatorname{plim} \bh_1 = \beta_1 + \frac{\operatorname{Cov}(x_t, u_t)}{\operatorname{Var}(x_t)}.

A3′ implies Cov⁡(xt,ut)=0\operatorname{Cov}(x_t, u_t) = 0, so plim⁡β^1=β1\operatorname{plim} \bh_1 = \beta_1. Note that only the same-period covariance appears. Correlation between utu_t and future regressors, which ruined unbiasedness, does not matter here.

A3′ 蘊含 Cov⁡(xt,ut)=0\operatorname{Cov}(x_t, u_t) = 0,所以 plim⁡β^1=β1\operatorname{plim} \bh_1 = \beta_1。留意只有同期的協方差出現。utu_t 與未來解釋變數之間的相關(它破壞了無偏性)在這裏並不重要。

Matrix form. In the same way,

矩陣形式。同樣地,

β^=β+(1nX′X)−1(1nX′u),\bhv = \boldsymbol{\beta} + \Big(\tfrac{1}{n}\mathbf{X}\T\mathbf{X}\Big)^{-1}\Big(\tfrac{1}{n}\mathbf{X}\T\mathbf{u}\Big),

where 1nX′X=1n∑txtxt′→pQ\tfrac{1}{n}\mathbf{X}\T\mathbf{X} = \tfrac{1}{n}\sum_t \mathbf{x}_t\mathbf{x}_t\T \xrightarrow{p} \mathbf{Q}, an invertible matrix by A2, and 1nX′u=1n∑txtut→pE⁡(xtut)=0\tfrac{1}{n}\mathbf{X}\T\mathbf{u} = \tfrac{1}{n}\sum_t \mathbf{x}_t u_t \xrightarrow{p} \operatorname{E}(\mathbf{x}_t u_t) = \mathbf{0} by A3′.

其中 1nX′X=1n∑txtxt′→pQ\tfrac{1}{n}\mathbf{X}\T\mathbf{X} = \tfrac{1}{n}\sum_t \mathbf{x}_t\mathbf{x}_t\T \xrightarrow{p} \mathbf{Q},根據 A2 是可逆矩陣;而根據 A3′,1nX′u=1n∑txtut→pE⁡(xtut)=0\tfrac{1}{n}\mathbf{X}\T\mathbf{u} = \tfrac{1}{n}\sum_t \mathbf{x}_t u_t \xrightarrow{p} \operatorname{E}(\mathbf{x}_t u_t) = \mathbf{0}。

When OLS is not consistentOLS 不一致的情況

A3′ can fail too, and then OLS is not even consistent. The classic case combines a lagged dependent variable with serially correlated errors:

A3′ 同樣可能不成立,那時 OLS 連一致性也沒有。典型情況是滯後被解釋變數加上序列相關的誤差:

yt=β0+β1yt−1+ut,∣β1∣<1,ut=θut−1+et,et∼i.i.d.(0,σ2).\begin{aligned} y_t &= \beta_0 + \beta_1 y_{t-1} + u_t, \quad |\beta_1| < 1, \\ u_t &= \theta u_{t-1} + e_t, \quad e_t \sim \text{i.i.d.}(0, \sigma^2). \end{aligned}

The regressor yt−1y_{t-1} contains ut−1u_{t-1}, and ut−1u_{t-1} is correlated with utu_t through θ\theta. So Cov⁡(yt−1,ut)≠0\operatorname{Cov}(y_{t-1}, u_t) \neq 0 unless θ=0\theta = 0, and OLS converges to the wrong value:

解釋變數 yt−1y_{t-1} 包含 ut−1u_{t-1},而 ut−1u_{t-1} 透過 θ\theta 與 utu_t 相關。所以除非 θ=0\theta = 0,否則 Cov⁡(yt−1,ut)≠0\operatorname{Cov}(y_{t-1}, u_t) \neq 0,OLS 會收斂到錯誤的數值:

plim⁡β^1=β1+θ1+β1θ.\operatorname{plim} \bh_1 = \frac{\beta_1 + \theta}{1 + \beta_1 \theta}.

With β1=0.5\beta_1 = 0.5 and θ=0.5\theta = 0.5, OLS converges to 1/1.25=0.81/1.25 = 0.8, not 0.5. More data only makes it more certain of the wrong answer:

當 β1=0.5\beta_1 = 0.5、θ=0.5\theta = 0.5 時,OLS 收斂到 1/1.25=0.81/1.25 = 0.8,而不是 0.5。更多數據只會令它對錯誤答案更有把握:

nnθ=0\theta = 0θ=0.5\theta = 0.5
MeansdMean
100.2700.3100.569
250.4030.1850.707
500.4480.1260.756
1000.4720.0890.780
2500.4910.0560.792
1,0000.4980.0270.798

OLS estimates of β₁ = 0.5 in 4,000 simulated samples for each n. With θ = 0 the mean approaches 0.5; with θ = 0.5 it approaches 0.8.

每個 n 模擬 4,000 個樣本,以 OLS 估計 β₁ = 0.5。θ = 0 時均值趨近 0.5;θ = 0.5 時則趨近 0.8。

Show every step: the probability limit 顯示完整推導:機率極限

OLS of yty_t on yt−1y_{t-1} converges to Cov⁡(yt,yt−1)/Var⁡(yt−1)=ρ1\operatorname{Cov}(y_t, y_{t-1})/\operatorname{Var}(y_{t-1}) = \rho_1, the first autocorrelation of yy, whatever model generated it. So we need ρ1\rho_1. Write (1−β1L)yt=β0+ut(1 - \beta_1 L) y_t = \beta_0 + u_t and (1−θL)ut=et(1 - \theta L) u_t = e_t, where LL shifts a series back one period. Multiplying out, yy is an AR(2) process:

把 yty_t 對 yt−1y_{t-1} 做 OLS,結果收斂到 Cov⁡(yt,yt−1)/Var⁡(yt−1)=ρ1\operatorname{Cov}(y_t, y_{t-1})/\operatorname{Var}(y_{t-1}) = \rho_1,即 yy 的一階自相關,不論數據由甚麼模型產生。所以我們需要 ρ1\rho_1。寫成 (1−β1L)yt=β0+ut(1 - \beta_1 L) y_t = \beta_0 + u_t 和 (1−θL)ut=et(1 - \theta L) u_t = e_t,其中 LL 把序列向後移一期。展開後,yy 是一個 AR(2) 過程:

yt=c+ϕ1yt−1+ϕ2yt−2+et,ϕ1=β1+θ,ϕ2=−β1θ.\begin{aligned} y_t &= c + \phi_1 y_{t-1} + \phi_2 y_{t-2} + e_t, \\ \phi_1 &= \beta_1 + \theta, \quad \phi_2 = -\beta_1\theta. \end{aligned}

Multiply the AR(2) equation, in deviations from the mean, by yt−1y_{t-1} and take expectations. Since ete_t is uncorrelated with the past, γ1=ϕ1γ0+ϕ2γ1\gamma_1 = \phi_1 \gamma_0 + \phi_2 \gamma_1. Divide by γ0\gamma_0:

把以均值偏差表示的 AR(2) 方程乘以 yt−1y_{t-1} 並取期望。由於 ete_t 與過去無關,γ1=ϕ1γ0+ϕ2γ1\gamma_1 = \phi_1 \gamma_0 + \phi_2 \gamma_1。除以 γ0\gamma_0:

ρ1=ϕ11−ϕ2=β1+θ1+β1θ=β1+θ(1−β12)1+β1θ.\begin{aligned} \rho_1 &= \frac{\phi_1}{1 - \phi_2} = \frac{\beta_1 + \theta}{1 + \beta_1\theta} \\ &= \beta_1 + \frac{\theta(1 - \beta_1^2)}{1 + \beta_1\theta}. \end{aligned}

The last form shows the inconsistency directly: it is zero only when θ=0\theta = 0.

最後一個形式直接顯示了不一致性:只有當 θ=0\theta = 0 時它才等於零。

This is why Week 10 kept adding lags until the Breusch–Godfrey test found no serial correlation: in a model with lagged y, serially correlated errors mean inconsistent estimates, not just wrong standard errors.

這就是為甚麼第 10 週不斷加入滯後項,直至 Breusch–Godfrey 檢定找不到序列相關:在包含滯後 y 的模型中,序列相關的誤差意味著估計值不一致,而不只是標準誤錯誤。

Samples 樣本數
0
Probability limit 機率極限
–
Mean of estimates 估計值平均
–
sd of estimates 估計值標準差
–
Within 0.1 of β₁ 與 β₁ 相差少於 0.1
–

Each sample comes from yt=β1yt−1+uty_t = \beta_1 y_{t-1} + u_t with ut=θut−1+etu_t = \theta u_{t-1} + e_t. Raise nn with θ=0\theta = 0: the histogram closes in on β1\beta_1 and the share within 0.1 heads to 100%. Then set θ=0.5\theta = 0.5: it closes in on the probability limit instead, and the share within 0.1 of the truth heads to zero.

每個樣本來自 yt=β1yt−1+uty_t = \beta_1 y_{t-1} + u_t,其中 ut=θut−1+etu_t = \theta u_{t-1} + e_t。在 θ=0\theta = 0 時增大 nn:直方圖向 β1\beta_1 收窄,相差少於 0.1 的比例趨向 100%。然後設 θ=0.5\theta = 0.5:直方圖改為向機率極限收窄,與真值相差少於 0.1 的比例趨向零。

Asymptotic normality漸近正態性

For tests we need the shape of the distribution of β^\bhv, not just where it is centred. Week 7 obtained an exact normal distribution from A5, normal errors. In large samples A5 is not needed. Replace A4 by its time-series version,

做檢定需要知道 β^\bhv 的分佈形狀,而不只是它的中心。第 7 週由 A5(正態誤差)得到準確的正態分佈。在大樣本中並不需要 A5。把 A4 換成其時間序列版本:

A4′ ⁣:Var⁡(ut∣xt)=σ2,E⁡(utus∣xt,xs)=0(t≠s).\begin{aligned} \text{A4}^\prime\!: \quad &\operatorname{Var}(u_t \mid \mathbf{x}_t) = \sigma^2, \\ &\operatorname{E}(u_t u_s \mid \mathbf{x}_t, \mathbf{x}_s) = 0 \quad (t \neq s). \end{aligned}

Under A1, A2, A3′ and A4′, with stationary and weakly dependent data, OLS is asymptotically normal:

在 A1、A2、A3′ 和 A4′ 下,加上平穩且弱相依的數據,OLS 具漸近正態性:

β^∼aN ⁣(β,  σ2(X′X)−1).\bhv \overset{a}{\sim} N\!\big(\boldsymbol{\beta},\; \sigma^2 (\mathbf{X}\T\mathbf{X})^{-1}\big).

The reason is the central limit theorem: the average of many random variables with finite variance is approximately normal, whatever their own distribution. β^−β=(1nX′X)−11n∑txtut\bhv - \boldsymbol{\beta} = (\tfrac{1}{n}\mathbf{X}\T\mathbf{X})^{-1}\tfrac{1}{n}\sum_t \mathbf{x}_t u_t is a fixed matrix times an average, so it inherits approximate normality. Consequently, for each coefficient,

原因在於中央極限定理:許多方差有限的隨機變數的平均,無論它們本身服從甚麼分佈,都近似正態。β^−β=(1nX′X)−11n∑txtut\bhv - \boldsymbol{\beta} = (\tfrac{1}{n}\mathbf{X}\T\mathbf{X})^{-1}\tfrac{1}{n}\sum_t \mathbf{x}_t u_t 是固定矩陣乘以一個平均數,所以承襲了近似正態性。因此對每個係數,

β^j−βjse⁡(β^j)→dN(0,1).\frac{\bh_j - \beta_j}{\operatorname{se}(\bh_j)} \xrightarrow{d} N(0, 1).

A tt distribution with many degrees of freedom is almost identical to N(0,1)N(0, 1), so the usual t and F tests from Week 4 are approximately valid in large samples, even if yy is far from normal.

自由度很大的 tt 分佈與 N(0,1)N(0, 1) 幾乎相同,所以第 4 週的一般 t 和 F 檢定在大樣本中近似有效,即使 yy 遠非正態。

Show every step: where normality comes from 顯示完整推導:正態性從何而來

Multiply the matrix form of Section 3 by n\sqrt{n}:

把第 3 節的矩陣形式乘以 n\sqrt{n}:

n (β^−β)=(1nX′X)−11n∑t=1nxtut.\sqrt{n}\,(\bhv - \boldsymbol{\beta}) = \Big(\tfrac{1}{n}\mathbf{X}\T\mathbf{X}\Big)^{-1} \frac{1}{\sqrt{n}}\sum_{t=1}^{n} \mathbf{x}_t u_t.

The terms xtut\mathbf{x}_t u_t have mean zero by A3′. By A4′ they are uncorrelated over time with variance E⁡(ut2xtxt′)=σ2Q\operatorname{E}(u_t^2 \mathbf{x}_t\mathbf{x}_t\T) = \sigma^2 \mathbf{Q}. A central limit theorem for weakly dependent series gives 1n∑txtut→dN(0,σ2Q)\tfrac{1}{\sqrt{n}}\sum_t \mathbf{x}_t u_t \xrightarrow{d} N(\mathbf{0}, \sigma^2 \mathbf{Q}). The first factor converges to Q−1\mathbf{Q}^{-1}, so

根據 A3′,xtut\mathbf{x}_t u_t 各項的均值為零。根據 A4′,它們在不同時期之間不相關,方差為 E⁡(ut2xtxt′)=σ2Q\operatorname{E}(u_t^2 \mathbf{x}_t\mathbf{x}_t\T) = \sigma^2 \mathbf{Q}。弱相依序列的中央極限定理給出 1n∑txtut→dN(0,σ2Q)\tfrac{1}{\sqrt{n}}\sum_t \mathbf{x}_t u_t \xrightarrow{d} N(\mathbf{0}, \sigma^2 \mathbf{Q})。第一個因子收斂到 Q−1\mathbf{Q}^{-1},所以

n (β^−β)→dN(0, Q−1σ2Q Q−1)=N(0, σ2Q−1).\begin{aligned} \sqrt{n}\,(\bhv - \boldsymbol{\beta}) &\xrightarrow{d} N\big(\mathbf{0},\, \mathbf{Q}^{-1}\sigma^2 \mathbf{Q}\, \mathbf{Q}^{-1}\big) \\ &= N\big(\mathbf{0},\, \sigma^2 \mathbf{Q}^{-1}\big). \end{aligned}

Dividing by n\sqrt{n} and replacing Q\mathbf{Q} by 1nX′X\tfrac{1}{n}\mathbf{X}\T\mathbf{X} gives β^∼aN(β,σ2(X′X)−1)\bhv \overset{a}{\sim} N(\boldsymbol{\beta}, \sigma^2(\mathbf{X}\T\mathbf{X})^{-1}). Normal errors were never used. A4′ is what makes the middle σ2Q\sigma^2\mathbf{Q}; without it the sandwich of Weeks 8 and 9 appears instead.

除以 n\sqrt{n},並把 Q\mathbf{Q} 換成 1nX′X\tfrac{1}{n}\mathbf{X}\T\mathbf{X},便得到 β^∼aN(β,σ2(X′X)−1)\bhv \overset{a}{\sim} N(\boldsymbol{\beta}, \sigma^2(\mathbf{X}\T\mathbf{X})^{-1})。推導中從未用到正態誤差。正是 A4′ 令中間部分等於 σ2Q\sigma^2\mathbf{Q};沒有它,便會出現第 8、9 週的三文治形式。

Example: are stock returns predictable?例子:股票回報可以預測嗎?

The efficient markets hypothesis says that past returns cannot predict future returns: E⁡(returnt∣returnt−1,returnt−2,… )=μ\operatorname{E}(\text{return}_t \mid \text{return}_{t-1}, \text{return}_{t-2}, \dots) = \mu. The nyse data hold weekly percentage returns on the New York Stock Exchange index from 1976 to 1989. Fit an AR(1):

有效市場假說認為過去的回報無法預測將來的回報:E⁡(returnt∣returnt−1,returnt−2,… )=μ\operatorname{E}(\text{return}_t \mid \text{return}_{t-1}, \text{return}_{t-2}, \dots) = \mu。nyse 數據記錄了 1976 至 1989 年紐約證券交易所指數的每週百分比回報。估計 AR(1):

return^t=0.180(0.081)+0.0589(0.038) returnt−1,n=689.\begin{aligned} \widehat{\text{return}}_t &= \underset{(0.081)}{0.180} + \underset{(0.038)}{0.0589}\, \text{return}_{t-1}, \\ n &= 689. \end{aligned}

The t statistic for H0:β1=0H_0: \beta_1 = 0 is 1.55 (p = 0.12): no evidence of predictability. Adding a second lag gives −0.038-0.038 on returnt−2\text{return}_{t-2}, and the joint F test of both lags is 1.65 (p = 0.19).

H0:β1=0H_0: \beta_1 = 0 的 t 統計量是 1.55(p = 0.12):沒有可預測性的證據。加入第二個滯後項,returnt−2\text{return}_{t-2} 的係數為 −0.038-0.038,兩個滯後項的聯合 F 檢定為 1.65(p = 0.19)。

Can these tests be trusted? The model has a lagged dependent variable, so OLS is biased in finite samples, and the residuals are clearly not normal:

這些檢定可信嗎?模型包含滯後被解釋變數,所以 OLS 在有限樣本中有偏,而殘差顯然不是正態的:

  • Skewness −0.60, where a normal distribution has 0: crashes are larger than booms.

    偏度為 −0.60,而正態分佈為 0:暴跌的幅度大於暴漲。

  • Kurtosis 7.59, against 3 for a normal: far more extreme weeks. 0.87% of residuals lie beyond three standard deviations, more than three times the normal 0.27%. The largest fall, −15.3%, is week 616 of the sample: the October 1987 crash.

    峰度為 7.59,而正態分佈為 3:極端週份多得多。0.87% 的殘差超出三個標準差,是正態分佈 0.27% 的三倍多。最大跌幅 −15.3% 是樣本中的第 616 週,即 1987 年 10 月股災。

Neither matters much here. Returns are close to stationary and weakly dependent, the shocks are unpredictable from the past (which is what A3′ needs), and with 689 weeks the central limit theorem applies. The estimates are consistent and the t and F tests approximately valid, as long as A4′ holds.

在這裏兩者都不太重要。回報接近平穩且弱相依,衝擊無法由過去預測(這正是 A3′ 所需),而且有 689 週的數據,中央極限定理適用。只要 A4′ 成立,估計值便是一致的,t 和 F 檢定也近似有效。

When A4 failsA4 不成立時

A4′ is the remaining weak point. If Var⁡(ut∣xt)\operatorname{Var}(u_t \mid \mathbf{x}_t) changes with xt\mathbf{x}_t, or errors are correlated across periods, OLS is still consistent and asymptotically normal, but its variance is the sandwich, not σ2(X′X)−1\sigma^2(\mathbf{X}\T\mathbf{X})^{-1}. The fix is the one from Weeks 8 and 9: keep OLS, and use heteroskedasticity-robust or HAC standard errors.

A4′ 是餘下的弱點。如果 Var⁡(ut∣xt)\operatorname{Var}(u_t \mid \mathbf{x}_t) 隨 xt\mathbf{x}_t 改變,或不同時期的誤差相關,OLS 仍然一致並具漸近正態性,但它的方差是三文治形式,而不是 σ2(X′X)−1\sigma^2(\mathbf{X}\T\mathbf{X})^{-1}。修正方法與第 8、9 週相同:保留 OLS,改用異方差穩健或 HAC 標準誤。

Stock returns are a case in point. Regressing the squared residuals on returnt−1\text{return}_{t-1} gives a slope of −1.10 with t=−5.48t = -5.48: the market is more volatile after a fall, so A4′ fails. The robust (HC1) standard error on returnt−1\text{return}_{t-1} is 0.0692, against the usual 0.0380, and the t statistic falls from 1.55 to 0.85. The conclusion holds, more firmly: past returns do not predict future returns.

股票回報正是一例。把殘差平方對 returnt−1\text{return}_{t-1} 回歸,斜率為 −1.10,t=−5.48t = -5.48:市場在下跌之後波動更大,所以 A4′ 不成立。returnt−1\text{return}_{t-1} 的穩健(HC1)標準誤為 0.0692,一般標準誤則為 0.0380,t 統計量由 1.55 降至 0.85。結論依然成立,而且更穩固:過去的回報無法預測將來的回報。

Finite-sample and large-sample assumptions有限樣本與大樣本假設

The large-sample assumptions are weaker where it matters for time series, at the price of needing many observations:

大樣本假設在對時間序列重要的地方較弱,代價是需要大量觀測值:

Finite sample (Weeks 7–8) 有限樣本(第 7–8 週)Large sample (this week) 大樣本(本週)
A3E⁡(u∣X)=0\operatorname{E}(\mathbf{u} \mid \mathbf{X}) = \mathbf{0}
errors unrelated to the regressors of every period 誤差與所有時期的解釋變數無關
E⁡(ut∣xt)=0\operatorname{E}(u_t \mid \mathbf{x}_t) = 0
errors unrelated to the same period’s regressors 誤差只需與同期解釋變數無關
A4Var⁡(u∣X)=σ2I\operatorname{Var}(\mathbf{u} \mid \mathbf{X}) = \sigma^2 \mathbf{I}Var⁡(ut∣xt)=σ2\operatorname{Var}(u_t \mid \mathbf{x}_t) = \sigma^2, E⁡(utus∣xt,xs)=0\operatorname{E}(u_t u_s \mid \mathbf{x}_t, \mathbf{x}_s) = 0
A5Normal errors 誤差服從正態分佈Not needed 不需要
Also needed 另需—Stationary, weakly dependent data; large n 平穩、弱相依的數據;大樣本
You get 得到Unbiased; exact t and F 無偏;準確的 t 和 FConsistent; approximately valid t and F 一致;近似有效的 t 和 F

These results justify everything done with time series in Weeks 9 and 10, and they apply equally to cross sections: with a large sample, OLS gives valid inference whatever the distribution of the errors.

這些結果為第 9、10 週處理時間序列的所有做法提供理據,同樣也適用於橫截面數據:只要樣本夠大,無論誤差服從甚麼分佈,OLS 都能給出有效的推論。

Reproduce the results自己重現結果

The data come with the free wooldridge package. Both snippets reproduce the NYSE results and end with a small simulation of consistency. The simulations draw random numbers, so the last line differs slightly between R, Python and the table in Section 4.

數據收錄在免費的 wooldridge 套件中。兩段程式碼都會重現紐約證券交易所的結果,最後以一個小型模擬展示一致性。模擬會抽取隨機數,所以最後一行在 R、Python 和第 4 節的表之間略有不同。

R
library(wooldridge)

# Efficient markets: weekly NYSE returns (%), 1976-1989
m <- lm(return ~ return_1, data = nyse)
summary(m)                                  # 0.0589 (0.0380), t = 1.55

# The residuals are far from normal
e <- resid(m); n <- length(e); z <- (e - mean(e)) / sqrt(mean((e - mean(e))^2))
c(n = n, skewness = mean(z^3), kurtosis = mean(z^4))   # 689, -0.60, 7.59
mean(abs(z) > 3)                            # 0.0087, against 0.0027 if normal

# Two lags, and a joint F test of both
nyse$return_2 <- c(NA, head(nyse$return_1, -1))
m2 <- lm(return ~ return_1 + return_2, data = nyse)
anova(lm(return ~ 1, data = model.frame(m2)), m2)   # F = 1.65, p = 0.19

# Heteroskedasticity-robust (HC1) standard error for the AR(1) slope
X <- model.matrix(m); B <- solve(crossprod(X))
V <- B %*% crossprod(X * e) %*% B * n / (n - 2)
sqrt(diag(V))                               # 0.0853, 0.0692

# Consistency in a simulation: AR(1) slope, true value 0.5
set.seed(2410)
ar_slope <- function(n, b1 = 0.5) {
  y <- arima.sim(list(ar = b1), n = n + 1)
  coef(lm(y[-1] ~ y[-(n + 1)]))[2]
}
sapply(c(10, 25, 100, 1000), function(n) mean(replicate(2000, ar_slope(n))))
# roughly 0.27, 0.40, 0.47, 0.50: biased, but the bias vanishes as n grows
Python
# pip install wooldridge statsmodels
import numpy as np
import statsmodels.formula.api as smf
import wooldridge as wd

# Efficient markets: weekly NYSE returns (%), 1976-1989
nyse = wd.data("nyse")
m = smf.ols("Q('return') ~ return_1", data=nyse).fit()   # "return" is a Python keyword
print(m.params["return_1"], m.bse["return_1"])           # 0.0589 (0.0380), t = 1.55

# The residuals are far from normal
z = (m.resid - m.resid.mean()) / m.resid.std(ddof=0)
print(len(z), (z**3).mean(), (z**4).mean())    # 689, -0.60, 7.59
print((z.abs() > 3).mean())                    # 0.0087, against 0.0027 if normal

# Two lags, and a joint F test of both
nyse["return_2"] = nyse["return_1"].shift(1)
m2 = smf.ols("Q('return') ~ return_1 + return_2", data=nyse).fit()
print(m2.fvalue, m2.f_pvalue)                  # F = 1.65, p = 0.19

# Heteroskedasticity-robust (HC1) standard error for the AR(1) slope
print(smf.ols("Q('return') ~ return_1", data=nyse).fit(cov_type="HC1").bse)   # 0.0853, 0.0692

# Consistency in a simulation: AR(1) slope, true value 0.5
rng = np.random.default_rng(2410)
def ar_slope(n, b1=0.5, burn=100):
    e = rng.normal(size=n + 1 + burn)
    y = np.zeros_like(e)
    for t in range(1, len(e)):
        y[t] = b1 * y[t - 1] + e[t]
    y = y[burn:]
    return np.polyfit(y[:-1], y[1:], 1)[0]
print([round(np.mean([ar_slope(n) for _ in range(2000)]), 2) for n in (10, 25, 100, 1000)])
# roughly 0.27, 0.40, 0.47, 0.50: biased, but the bias vanishes as n grows

Check your understanding自我測驗

  1. Is μ~=1n−1∑i=1nXi\tilde\mu = \frac{1}{n - 1}\sum_{i=1}^{n} X_i unbiased for μ\mu? Is it consistent?

    μ~=1n−1∑i=1nXi\tilde\mu = \frac{1}{n - 1}\sum_{i=1}^{n} X_i 是 μ\mu 的無偏估計量嗎?它是一致的嗎?

    Answer 答案

    Biased: E⁡(μ~)=nn−1μ\operatorname{E}(\tilde\mu) = \frac{n}{n-1}\mu. But consistent: μ~=nn−1Xˉ\tilde\mu = \frac{n}{n-1}\bar X, the factor tends to 1 and Xˉ→pμ\bar X \xrightarrow{p} \mu.

    有偏:E⁡(μ~)=nn−1μ\operatorname{E}(\tilde\mu) = \frac{n}{n-1}\mu。但一致:μ~=nn−1Xˉ\tilde\mu = \frac{n}{n-1}\bar X,因子趨向 1,而 Xˉ→pμ\bar X \xrightarrow{p} \mu。

  2. In yt=β0+β1yt−1+uty_t = \beta_0 + \beta_1 y_{t-1} + u_t with white-noise errors, which of A3 and A3′ holds?

    在誤差為白噪音的 yt=β0+β1yt−1+uty_t = \beta_0 + \beta_1 y_{t-1} + u_t 中,A3 和 A3′ 哪一個成立?

    Answer 答案

    A3′ holds: utu_t is a new shock, unrelated to yt−1y_{t-1}. A3 fails: utu_t is part of yty_t, the regressor of period t+1t + 1. So OLS is consistent but biased.

    A3′ 成立:utu_t 是新的衝擊,與 yt−1y_{t-1} 無關。A3 不成立:utu_t 是 yty_t 的一部分,而 yty_t 是第 t+1t + 1 期的解釋變數。所以 OLS 一致但有偏。

  3. In the model of Section 4, take β1=0.3\beta_1 = 0.3 and θ=0.6\theta = 0.6. What does OLS converge to?

    在第 4 節的模型中,設 β1=0.3\beta_1 = 0.3、θ=0.6\theta = 0.6。OLS 收斂到甚麼數值?

    Answer 答案

    (0.3+0.6)/(1+0.18)=0.763(0.3 + 0.6)/(1 + 0.18) = 0.763, more than double the true value.

    (0.3+0.6)/(1+0.18)=0.763(0.3 + 0.6)/(1 + 0.18) = 0.763,比真值大一倍以上。

  4. Your dependent variable is household wealth, heavily right-skewed, and you have 2,000 observations. Can you use the usual t test?

    你的被解釋變數是住戶財富,嚴重右偏,你有 2,000 個觀測值。可以使用一般的 t 檢定嗎?

    Answer 答案

    Yes, as far as normality goes: with 2,000 observations the central limit theorem makes the t statistic approximately normal. But skewed outcomes often come with heteroskedasticity (Week 8’s wealth example did), so check A4 and use robust standard errors if needed.

    就正態性而言可以:有 2,000 個觀測值,中央極限定理令 t 統計量近似正態。但偏態的結果往往伴隨異方差(第 8 週的財富例子正是如此),所以應檢查 A4,有需要時使用穩健標準誤。

  5. Why does serial correlation matter more in Week 10’s ARDL models than in Week 9’s regression of accidents on a trend and month dummies?

    為甚麼序列相關在第 10 週的 ARDL 模型中,比在第 9 週把交通意外對趨勢和月份虛擬變數回歸時更重要?

    Answer 答案

    With only a trend and dummies, the regressors are fixed and unrelated to the errors, so OLS stays consistent and only the standard errors need fixing. With a lagged dependent variable, serially correlated errors are correlated with that regressor, A3′ fails and the coefficients themselves are inconsistent.

    只有趨勢和虛擬變數時,解釋變數是固定的,與誤差無關,所以 OLS 仍然一致,只需修正標準誤。有滯後被解釋變數時,序列相關的誤差會與該解釋變數相關,A3′ 不成立,係數本身便不一致。

Sources and acknowledgement 資料來源與鳴謝

  • Lecture materials for Introductory Econometrics (ETC2410) by Associate Professor Didier Nibbering, Department of Econometrics and Business Statistics, Monash Business School.
  • Jeffrey M. Wooldridge, Introductory Econometrics: A Modern Approach, Chapters 5, 11.1–11.2 and 12.1, and Appendix C.3.
  • Data: nyse, distributed with the textbook and in the wooldridge R package. All estimates on this page were computed from it. The simulation table and demo are simulated.

Any errors are our own.