Nonstationary time series非平穩時間序列

Week 11 showed that OLS and its tests work in large samples, provided the series are stationary. Many economic series are not: GDP, prices and stock indices drift upwards and never settle. This week distinguishes two kinds of nonstationarity, a deterministic trend and a unit root, shows how to tell them apart, and how to transform each so the tools of the course apply again.

第 11 週說明了只要序列是平穩的,OLS 及其檢定在大樣本中便有效。但很多經濟序列並不平穩:國內生產總值、物價和股市指數都向上漂移,永不穩定下來。本週區分兩種非平穩性:確定性趨勢和單位根;說明怎樣分辨兩者,以及怎樣轉換各自的序列,令本課程的工具再次適用。

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

Nonstationary time series非平穩時間序列

Recall from Week 10 that a series is (weakly, or covariance) stationary if its mean μ\mu, its variance γ0\gamma_0 and its autocovariances γj\gamma_j are finite and do not change over time. Any series with a trend breaks the first condition. There are two kinds of trend:

回顧第 10 週,如果序列的均值 μ\mu、方差 γ0\gamma_0 和自協方差 γj\gamma_j 都有限而且不隨時間改變,它便是(弱或協方差)平穩的。任何有趨勢的序列都違反第一個條件。趨勢有兩種:

deterministic trend:yt=β0+β1t+ut,stochastic trend (unit root):yt=yt−1+ut.\begin{aligned} &\text{deterministic trend:} \\ &\qquad y_t = \beta_0 + \beta_1 t + u_t, \\ &\text{stochastic trend (unit root):} \\ &\qquad y_t = y_{t-1} + u_t. \end{aligned}

They can look alike in a chart, but they behave differently and need different treatment. Getting it wrong matters: regressing one unit-root series on another unrelated one can produce a large t statistic and a high R² from nothing, a spurious regression.

兩者在圖上可能相似,但性質不同,需要不同的處理。處理錯誤的後果很嚴重:把一個單位根序列對另一個毫不相關的單位根序列回歸,可能憑空得出很大的 t 統計量和很高的 R²,即虛假回歸。

Deterministic trends and detrending確定性趨勢與去趨勢

In the deterministic trend model, with utu_t stationary,

在確定性趨勢模型中,若 utu_t 是平穩的,

E⁡(yt)=β0+β1t,\operatorname{E}(y_t) = \beta_0 + \beta_1 t,

so the mean changes with tt and yty_t is nonstationary. But the deviations from the trend, utu_t, are stationary. Such a series is called trend stationary: after a shock it returns to its trend line. It is handled as in Week 10, by including tt as a regressor; OLS and the usual tests then remain valid.

所以均值隨 tt 改變,yty_t 是非平穩的。但偏離趨勢的部分 utu_t 是平穩的。這樣的序列稱為趨勢平穩:受衝擊後會回到趨勢線上。處理方法與第 10 週相同,把 tt 作為解釋變數;OLS 和一般的檢定仍然有效。

Detrending makes the check concrete. Regress yty_t on a constant and tt and keep the residuals,

去趨勢令檢查變得具體。把 yty_t 對常數項和 tt 回歸,保留殘差:

u^t=yt−β^0−β^1t.\uh_t = y_t - \bh_0 - \bh_1 t.

If the detrended series u^t\uh_t looks stationary, returning to zero with autocorrelations that die out quickly, yty_t is trend stationary. If u^t\uh_t still wanders, with a first autocorrelation near 1 and a correlogram that decays slowly, yty_t has a unit root, whether or not it also has a deterministic trend.

如果去趨勢後的序列 u^t\uh_t 看來是平穩的,即會回到零而且自相關很快消失,yty_t 便是趨勢平穩的。如果 u^t\uh_t 仍然游走,一階自相關接近 1,相關圖緩慢遞減,那麼無論 yty_t 是否同時有確定性趨勢,它都有單位根。

Unit roots單位根

The random walk yt=yt−1+uty_t = y_{t-1} + u_t, with ut∼i.i.d.(0,σ2)u_t \sim \text{i.i.d.}(0, \sigma^2), is the AR(1) of Week 10 with ϕ1=1\phi_1 = 1. It is said to have a unit root: the coefficients on the lagged dependent variable sum to one. Substituting backwards to a starting value y0y_0,

隨機漫步 yt=yt−1+uty_t = y_{t-1} + u_t(其中 ut∼i.i.d.(0,σ2)u_t \sim \text{i.i.d.}(0, \sigma^2))就是第 10 週 ϕ1=1\phi_1 = 1 的 AR(1)。它被稱為有單位根:滯後被解釋變數的係數之和等於一。向後代入至起始值 y0y_0:

yt=yt−1+ut=yt−2+ut−1+ut=y0+u1+u2+⋯+ut.\begin{aligned} y_t &= y_{t-1} + u_t = y_{t-2} + u_{t-1} + u_t \\ &= y_0 + u_1 + u_2 + \dots + u_t. \end{aligned}

Every shock stays in the series forever. Given y0y_0, E⁡(yt)=y0\operatorname{E}(y_t) = y_0 but Var⁡(yt)=σ2t\operatorname{Var}(y_t) = \sigma^2 t, which grows without limit, so the random walk is nonstationary even though its mean is constant. Adding a drift ϕ0\phi_0 gives both kinds of trend at once:

每個衝擊都永遠留在序列之中。給定 y0y_0,E⁡(yt)=y0\operatorname{E}(y_t) = y_0,但 Var⁡(yt)=σ2t\operatorname{Var}(y_t) = \sigma^2 t 會無限增大,所以即使均值不變,隨機漫步也是非平穩的。加入漂移項 ϕ0\phi_0,便同時有兩種趨勢:

yt=ϕ0+yt−1+ut=y0+ϕ0t+u1+⋯+ut,\begin{aligned} y_t &= \phi_0 + y_{t-1} + u_t \\ &= y_0 + \phi_0 t + u_1 + \dots + u_t, \end{aligned}

with E⁡(yt)=y0+ϕ0t\operatorname{E}(y_t) = y_0 + \phi_0 t and Var⁡(yt)=σ2t\operatorname{Var}(y_t) = \sigma^2 t. Removing the deterministic part ϕ0t\phi_0 t still leaves the random walk u1+⋯+utu_1 + \dots + u_t: detrending cannot make it stationary.

其中 E⁡(yt)=y0+ϕ0t\operatorname{E}(y_t) = y_0 + \phi_0 t,Var⁡(yt)=σ2t\operatorname{Var}(y_t) = \sigma^2 t。去除確定性部分 ϕ0t\phi_0 t 後,仍然剩下隨機漫步 u1+⋯+utu_1 + \dots + u_t:去趨勢無法令它平穩。

Why does a unit root show up as a correlogram stuck near 1? Between two points hh periods apart, the random walk shares all the shocks up to the earlier one:

為甚麼單位根會表現為一直接近 1 的相關圖?相隔 hh 期的兩點,共享直至較早一點為止的所有衝擊:

Corr⁡(yt,yt−h)=t−ht=1−ht,\operatorname{Corr}(y_t, y_{t-h}) = \sqrt{\frac{t - h}{t}} = \sqrt{1 - \frac{h}{t}},

which is close to 1 when tt is large relative to hh. So the sample autocorrelations of a unit-root series start near 1 and fall very slowly, and the partial autocorrelation has a single spike near 1 at lag 1.

當 tt 遠大於 hh 時,它接近 1。所以單位根序列的樣本自相關由接近 1 開始,下降得非常緩慢,而偏自相關只在滯後 1 期有一個接近 1 的尖峰。

Show every step: the autocorrelation of a random walk 顯示完整推導:隨機漫步的自相關

Take y0y_0 as given and h<th < t. Write yt=yt−h+(ut−h+1+⋯+ut)y_t = y_{t-h} + (u_{t-h+1} + \dots + u_t). The bracket contains shocks after t−ht - h, independent of yt−hy_{t-h}, so

把 y0y_0 視為給定,並設 h<th < t。寫成 yt=yt−h+(ut−h+1+⋯+ut)y_t = y_{t-h} + (u_{t-h+1} + \dots + u_t)。括號內是 t−ht - h 之後的衝擊,與 yt−hy_{t-h} 獨立,所以

Cov⁡(yt,yt−h)=Var⁡(yt−h)=σ2(t−h),Corr⁡(yt,yt−h)=σ2(t−h)σ2t⋅σ2(t−h)=t−ht.\begin{aligned} \operatorname{Cov}(y_t, y_{t-h}) &= \operatorname{Var}(y_{t-h}) \\ &= \sigma^2 (t - h), \\ \operatorname{Corr}(y_t, y_{t-h}) &= \frac{\sigma^2 (t - h)}{\sqrt{\sigma^2 t \cdot \sigma^2 (t - h)}} \\ &= \sqrt{\frac{t - h}{t}}. \end{aligned}

The correlation depends on tt, not only on the gap hh: one more way the random walk breaks stationarity.

相關係數取決於 tt,而不只取決於間隔 hh:這是隨機漫步違反平穩性的另一方面。

Differencing差分

A unit root is removed by differencing. For the random walk with drift,

單位根可以透過差分去除。對帶漂移的隨機漫步:

Δyt=yt−yt−1=ϕ0+ut,\Delta y_t = y_t - y_{t-1} = \phi_0 + u_t,

so E⁡(Δyt)=ϕ0\operatorname{E}(\Delta y_t) = \phi_0, Var⁡(Δyt)=σ2\operatorname{Var}(\Delta y_t) = \sigma^2 and Cov⁡(Δyt,Δyt−1)=Cov⁡(ut,ut−1)=0\operatorname{Cov}(\Delta y_t, \Delta y_{t-1}) = \operatorname{Cov}(u_t, u_{t-1}) = 0: the differenced series is stationary. Differencing removes the deterministic trend too, which becomes the constant mean ϕ0\phi_0. A series that is stationary after differencing once is called integrated of order one, I(1); a stationary series is I(0).

所以 E⁡(Δyt)=ϕ0\operatorname{E}(\Delta y_t) = \phi_0、Var⁡(Δyt)=σ2\operatorname{Var}(\Delta y_t) = \sigma^2,而 Cov⁡(Δyt,Δyt−1)=Cov⁡(ut,ut−1)=0\operatorname{Cov}(\Delta y_t, \Delta y_{t-1}) = \operatorname{Cov}(u_t, u_{t-1}) = 0:差分後的序列是平穩的。差分同時去除了確定性趨勢,它變成常數均值 ϕ0\phi_0。差分一次後便平穩的序列稱為一階整合,記作 I(1);平穩序列則是 I(0)。

For a series in logs, the difference is the growth rate: 100 Δlog⁡yt100\,\Delta \log y_t is approximately the percentage change from t−1t - 1 to tt. This is usually the quantity of interest anyway: returns rather than the level of a stock index, growth rather than the level of GDP.

對於取了對數的序列,差分就是增長率:100 Δlog⁡yt100\,\Delta \log y_t 大約是由 t−1t - 1 至 tt 的百分比變化。這通常本來就是我們關心的量:關心股市指數的回報而非水平,關心國內生產總值的增長而非水平。

Detrend or difference?去趨勢還是差分?

In practice, look at the series, detrend it, and look at the correlograms:

實際操作時,觀察序列,去趨勢,再看相關圖:

  1. Plot the series. Does it return to a fixed level or a straight trend line, or does it wander off and stay away?

    畫出序列。它會回到固定水平或一條直線趨勢上,還是游走開去並一直遠離?

  2. Detrend it if it trends, and look at the residuals and their correlogram.

    如有趨勢便去趨勢,然後觀察殘差及其相關圖。

  3. A first autocorrelation close to 1, decaying very slowly, points to a unit root: difference the series. Autocorrelations that die out quickly point to trend stationarity: keep the levels and include a trend.

    一階自相關接近 1 並且非常緩慢地遞減,表示有單位根:應做差分。自相關很快消失,則表示趨勢平穩:保留水平值並加入趨勢。

Correlogram of what is plotted 圖中序列的相關圖

ρ:
The series is 序列屬於
–
ρ^1\hat\rho_1
–
ρ^12\hat\rho_{12}
–

The series is yt=10+0.1t+uty_t = 10 + 0.1t + u_t with ut=ρut−1+etu_t = \rho u_{t-1} + e_t, 200 periods and the same shocks throughout. For ρ<1\rho < 1 it is trend stationary: detrending leaves a stationary series. At ρ=1\rho = 1 it is a random walk with drift: the detrended series still wanders and its correlogram stays high, while the differenced series is stationary. Difference a trend-stationary series with ρ=0\rho = 0 and the first autocorrelation drops to about −0.5.

序列為 yt=10+0.1t+uty_t = 10 + 0.1t + u_t,其中 ut=ρut−1+etu_t = \rho u_{t-1} + e_t,共 200 期,衝擊保持不變。當 ρ<1\rho < 1 時,序列是趨勢平穩的:去趨勢後得到平穩序列。當 ρ=1\rho = 1 時,它是帶漂移的隨機漫步:去趨勢後的序列仍然游走,相關圖一直維持在高位,而差分後的序列則是平穩的。如果把 ρ=0\rho = 0 的趨勢平穩序列差分,一階自相關會降至約 −0.5。

Example: the stock market index例子:股市指數

The nyse data from Week 11 also record the level of the New York Stock Exchange index each week from 1976 to 1989, 691 weeks. The index climbs from about 50 to a peak near 187 with long rises and falls, never returning to any fixed level, and not along a straight trend either:

第 11 週的 nyse 數據同時記錄了 1976 至 1989 年每週的紐約證券交易所指數水平,共 691 週。指數由約 50 升至接近 187 的高峰,期間有長時間的升跌,從不回到任何固定水平,也不是沿著一條直線趨勢:

NYSE index, weekly level50100150Weekly return, 100 Δlog(price), %−1001976197819801982198419861988

The October 1987 crash is the deep spike in the returns panel.

回報圖中最深的尖峰是 1987 年 10 月的股災。

Lag 滯後期123612
NYSE index 紐約證券交易所指數0.9950.9890.9830.9670.934
NYSE return 紐約證券交易所回報0.066−0.0330.0260.020−0.015
IP, detrended 工業生產(去趨勢)0.9880.9700.9480.8700.705
IP growth 工業生產增長0.3950.2360.178−0.002−0.197

Sample autocorrelations ρ^j\hat\rho_j at selected lags jj. The 5% bands are about ±0.075\pm 0.075 for the weekly series and ±0.083\pm 0.083 for the monthly ones.

選定滯後期 jj 的樣本自相關 ρ^j\hat\rho_j。5% 範圍約為週度序列 ±0.075\pm 0.075、月度序列 ±0.083\pm 0.083。

The correlogram of the level confirms a unit root: the first autocorrelation is 0.995, and after 12 weeks it is still 0.934. The partial autocorrelation is 0.995 at lag 1 and within ±0.06\pm 0.06 after that, the signature of a random walk.

指數水平的相關圖證實了單位根:一階自相關是 0.995,12 週後仍有 0.934。偏自相關在滯後 1 期為 0.995,之後都在 ±0.06\pm 0.06 之內,正是隨機漫步的特徵。

That does not stop the analysis. Investors care about returns, and the weekly log return 100 Δlog⁡(pricet)100\,\Delta \log(\text{price}_t) has autocorrelations close to zero (0.066 at lag 1, the largest in absolute value 0.067 at lag 10). The returns are stationary, and Week 11’s efficient-markets regression was run on exactly this kind of series.

這並不妨礙分析。投資者關心的是回報,而每週對數回報 100 Δlog⁡(pricet)100\,\Delta \log(\text{price}_t) 的自相關接近零(滯後 1 期為 0.066,絕對值最大的是滯後 10 期的 0.067)。回報是平穩的,第 11 週的有效市場回歸正是以這類序列進行。

Example: industrial production例子:工業生產

The volat data include the US industrial production index, monthly from January 1947 to June 1993: 558 months. Its log rises steadily, so it might be trend stationary. Regress log⁡(IPt)\log(\text{IP}_t) on a constant and tt:

volat 數據包括美國工業生產指數,由 1947 年 1 月至 1993 年 6 月的月度數據,共 558 個月。它的對數穩定上升,所以可能是趨勢平穩的。把 log⁡(IPt)\log(\text{IP}_t) 對常數項和 tt 回歸:

log⁡(IPt)^=3.193+0.002982 t,R2=0.969.\widehat{\log(\text{IP}_t)} = 3.193 + 0.002982\, t, \qquad R^2 = 0.969.

Production grew about 0.30% a month, 3.6% a year. But the residuals do not behave like a stationary series. They make long swings: below the trend for most of 1947–1964, above it for almost all of 1965–1979, below again for most of the 1980s. Their autocorrelations are 0.988, 0.970 and 0.948 at lags 1 to 3, still 0.705 after a year. Log industrial production has a unit root as well as a deterministic trend.

生產每月增長約 0.30%,即每年 3.6%。但殘差的表現並不像平穩序列。它們出現長幅度的擺動:1947–1964 年大部分時間低於趨勢,1965–1979 年幾乎一直高於趨勢,1980 年代大部分時間又低於趨勢。滯後 1 至 3 期的自相關為 0.988、0.970 和 0.948,一年後仍有 0.705。工業生產的對數除了確定性趨勢之外,還有單位根。

log(industrial production) and its fitted linear trend3.03.54.04.5Detrended: residual from the trend−0.200.00Growth, 100 Δlog(IP), % a month0519501960197019801990

US industrial production index, January 1947 to June 1993.

美國工業生產指數,1947 年 1 月至 1993 年 6 月。

So model the growth rate, gt=100 Δlog⁡(IPt)g_t = 100\,\Delta \log(\text{IP}_t), which removes both. It averages 0.29% a month and its autocorrelations die out within a few months (0.395, 0.236, 0.178, then near zero), apart from a negative value at lag 12. To find an AR model for it, follow Week 10’s recipe. With monthly data, start from an AR(12); drop the least significant lag one at a time until every remaining lag is significant at 5%; then check the residuals for serial correlation. The search drops lags 9, 10, 7, 6, 4, 8, 5 and 2, in that order, and ends at

所以應改為對增長率 gt=100 Δlog⁡(IPt)g_t = 100\,\Delta \log(\text{IP}_t) 建模,這同時去除兩種趨勢。它平均每月 0.29%,自相關在幾個月內便消失(0.395、0.236、0.178,然後接近零),只有滯後 12 期出現一個負值。要為它找一個 AR 模型,可依照第 10 週的方法。月度數據由 AR(12) 開始;每次剔除最不顯著的滯後項,直至餘下的滯後項全部在 5% 水平下顯著;然後檢查殘差是否有序列相關。這個搜索依次剔除滯後 9、10、7、6、4、8、5 和 2 期,最後得到

g^t=0.191(0.046)+0.380(0.039) gt−1+0.083(0.039) gt−3+0.094(0.042) gt−11−0.233(0.042) gt−12,R2=0.21,n=545.\begin{aligned} \hat g_t &= \underset{(0.046)}{0.191} + \underset{(0.039)}{0.380}\, g_{t-1} + \underset{(0.039)}{0.083}\, g_{t-3} \\ &\quad + \underset{(0.042)}{0.094}\, g_{t-11} - \underset{(0.042)}{0.233}\, g_{t-12}, \\ R^2 &= 0.21, \quad n = 545. \end{aligned}

The Breusch–Godfrey test with 12 lags gives 20.22 against a 5% critical value of 21.03 (p = 0.063): no significant serial correlation remains. The implied mean growth rate is 0.191/(1−0.380−0.083−0.094+0.233)=0.28%0.191/(1 - 0.380 - 0.083 - 0.094 + 0.233) = 0.28\% a month, close to the sample average. The strong negative coefficient at lag 12 is probably a by-product of seasonal adjustment, which can leave a trace one year apart.

12 個滯後期的 Breusch–Godfrey 檢定得出 20.22,而 5% 臨界值為 21.03(p = 0.063):已沒有顯著的序列相關。隱含的平均增長率為每月 0.191/(1−0.380−0.083−0.094+0.233)=0.28%0.191/(1 - 0.380 - 0.083 - 0.094 + 0.233) = 0.28\%,接近樣本平均。滯後 12 期的顯著負係數,很可能是季節調整的副產品,季節調整可能在相隔一年處留下痕跡。

Reproduce the results自己重現結果

Both datasets come with the free wooldridge package. Both snippets reproduce every figure on this page.

兩個數據集都收錄在免費的 wooldridge 套件中。兩段程式碼都會重現本頁的所有數字。

R
library(wooldridge)

# Example 1: the NYSE index, weekly, 1976-1989
price <- nyse$price
acf(price, lag.max = 12)                    # 0.995, 0.989, 0.983, ... decaying slowly
pacf(price, lag.max = 12)                   # 0.995, then close to zero
ret <- 100 * diff(log(price))               # weekly log returns, %
acf(ret, lag.max = 12)                      # 0.066, -0.033, ...: no persistence

# Example 2: US industrial production, monthly, 1947-1993
lip <- log(volat$ip); t <- seq_along(lip)
trend <- lm(lip ~ t)                        # 0.298% a month
acf(resid(trend), lag.max = 12)             # 0.988, 0.970, 0.948, ...: unit root

g <- 100 * diff(lip)                        # monthly growth, %
acf(g, lag.max = 12)                        # 0.395, 0.236, 0.178, ...

# General to specific: start from an AR(12), drop the least significant lag
D <- embed(g, 13)                           # column 1 is g_t, column j + 1 is g_{t-j}
D <- setNames(as.data.frame(D), c("g", paste0("g", 1:12)))
keep <- paste0("g", 1:12)
repeat {
  m <- lm(reformulate(keep, "g"), data = D)
  p <- coef(summary(m))[-1, 4]
  if (max(p) < 0.05) break
  keep <- setdiff(keep, names(which.max(p)))
}
summary(m)                                  # lags 1, 3, 11, 12

bg <- function(m, q) {                      # Breusch-Godfrey, (n - q) R^2
  e <- resid(m); n <- length(e)
  lags <- sapply(1:q, function(j) c(rep(NA, j), e[1:(n - j)]))
  aux <- lm(e ~ model.matrix(m)[, -1] + lags)
  s <- (n - q) * summary(aux)$r.squared
  c(BG = s, p = pchisq(s, q, lower.tail = FALSE))
}
bg(m, 12)                                   # 20.22, p = 0.063
Python
# pip install wooldridge statsmodels
import numpy as np
import pandas as pd
import statsmodels.formula.api as smf
from statsmodels.tsa.stattools import acf, pacf
import wooldridge as wd

# Example 1: the NYSE index, weekly, 1976-1989
price = wd.data("nyse")["price"].to_numpy()
print(acf(price, nlags=12)[1:].round(3))       # 0.995, 0.989, 0.983, ... decaying slowly
print(pacf(price, nlags=12, method="ldb")[1:].round(3))   # 0.995, then close to zero
ret = 100 * np.diff(np.log(price))             # weekly log returns, %
print(acf(ret, nlags=12)[1:].round(3))         # 0.066, -0.033, ...: no persistence

# Example 2: US industrial production, monthly, 1947-1993
lip = np.log(wd.data("volat")["ip"].to_numpy())
t = np.arange(1, len(lip) + 1)
trend = smf.ols("lip ~ t", data={"lip": lip, "t": t}).fit()   # 0.298% a month
print(acf(trend.resid, nlags=12)[1:].round(3)) # 0.988, 0.970, 0.948, ...: unit root

g = 100 * np.diff(lip)                         # monthly growth, %
print(acf(g, nlags=12)[1:].round(3))           # 0.395, 0.236, 0.178, ...

# General to specific: start from an AR(12), drop the least significant lag
D = pd.DataFrame({"g": g})
for j in range(1, 13):
    D[f"g{j}"] = D["g"].shift(j)
D = D.dropna()
keep = [f"g{j}" for j in range(1, 13)]
while True:
    m = smf.ols("g ~ " + " + ".join(keep), data=D).fit()
    p = m.pvalues.drop("Intercept")
    if p.max() < 0.05:
        break
    keep.remove(p.idxmax())
print(m.params.round(4))                       # lags 1, 3, 11, 12

def bg(m, q):                                  # Breusch-Godfrey, (n - q) R^2
    e = m.resid.to_numpy()
    lags = np.column_stack([np.r_[np.full(j, np.nan), e[:-j]] for j in range(1, q + 1)])
    ok = ~np.isnan(lags).any(axis=1)
    Z = np.column_stack([m.model.exog, lags])[ok]
    r = e[ok] - Z @ np.linalg.lstsq(Z, e[ok], rcond=None)[0]
    return ok.sum() * (1 - (r @ r) / ((e[ok] - e[ok].mean()) ** 2).sum())
print(bg(m, 12))                               # 20.22, p = 0.063

Check your understanding自我測驗

  1. For a random walk yt=yt−1+uty_t = y_{t-1} + u_t with y0=0y_0 = 0 and σ2=4\sigma^2 = 4, find Var⁡(y25)\operatorname{Var}(y_{25}) and Corr⁡(y100,y96)\operatorname{Corr}(y_{100}, y_{96}).

    對於隨機漫步 yt=yt−1+uty_t = y_{t-1} + u_t,y0=0y_0 = 0、σ2=4\sigma^2 = 4,求 Var⁡(y25)\operatorname{Var}(y_{25}) 和 Corr⁡(y100,y96)\operatorname{Corr}(y_{100}, y_{96})。

    Answer 答案

    Var⁡(y25)=4×25=100\operatorname{Var}(y_{25}) = 4 \times 25 = 100. Corr⁡(y100,y96)=96/100=0.98\operatorname{Corr}(y_{100}, y_{96}) = \sqrt{96/100} = 0.98.

    Var⁡(y25)=4×25=100\operatorname{Var}(y_{25}) = 4 \times 25 = 100。Corr⁡(y100,y96)=96/100=0.98\operatorname{Corr}(y_{100}, y_{96}) = \sqrt{96/100} = 0.98。

  2. A series trends upwards. After detrending, its first autocorrelation is 0.45 and the correlogram is inside the bands from lag 3 on. Detrend or difference?

    一個序列向上趨勢。去趨勢後,一階自相關為 0.45,相關圖由滯後 3 期起都在範圍之內。應去趨勢還是差分?

    Answer 答案

    Detrend: the deviations from trend are stationary, so the series is trend stationary. Model it in levels with a time trend. Differencing it would introduce negative serial correlation.

    去趨勢:偏離趨勢的部分是平穩的,所以序列是趨勢平穩的。應以水平值加上時間趨勢建模。差分反而會引入負序列相關。

  3. If yt=5+0.2t+uty_t = 5 + 0.2t + u_t with white-noise utu_t, what are the mean and the first autocorrelation of Δyt\Delta y_t?

    如果 yt=5+0.2t+uty_t = 5 + 0.2t + u_t,utu_t 是白噪音,Δyt\Delta y_t 的均值和一階自相關是多少?

    Answer 答案

    Δyt=0.2+ut−ut−1\Delta y_t = 0.2 + u_t - u_{t-1}: mean 0.2, first autocorrelation −0.5-0.5. Differencing kept the growth rate but created serial correlation.

    Δyt=0.2+ut−ut−1\Delta y_t = 0.2 + u_t - u_{t-1}:均值 0.2,一階自相關 −0.5-0.5。差分保留了增長率,卻製造了序列相關。

  4. Why can Week 11’s large-sample results not be used for a regression of the NYSE index level on its own lag?

    為甚麼第 11 週的大樣本結果,不能用於把紐約證券交易所指數水平對其自身滯後項回歸?

    Answer 答案

    They require stationary, weakly dependent data. The index has a unit root: its variance grows over time and its autocorrelations stay near 1, so neither condition holds and the usual t statistics do not follow their usual distributions. Returns, its first difference, are fine.

    那些結果要求數據平穩且弱相依。指數有單位根:方差隨時間增大,自相關一直接近 1,兩個條件都不成立,一般的 t 統計量也不服從一般的分佈。回報(即其一階差分)則沒有問題。

  5. The lecture’s quarterly model is 100Δlog(GDP)ₜ = 0.49 + 0.36 · 100Δlog(GDP)ₜ₋₁. What is the implied average annual growth rate?

    課堂的季度模型為 100Δlog(GDP)ₜ = 0.49 + 0.36 · 100Δlog(GDP)ₜ₋₁。隱含的平均年增長率是多少?

    Answer 答案

    The mean quarterly growth rate is 0.49/(1−0.36)=0.77%0.49/(1 - 0.36) = 0.77\%, so about 4×0.77=3.1%4 \times 0.77 = 3.1\% a year.

    平均季度增長率為 0.49/(1−0.36)=0.77%0.49/(1 - 0.36) = 0.77\%,所以每年約為 4×0.77=3.1%4 \times 0.77 = 3.1\%。

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 10.5, 11.3 and 18.2.
  • Data: nyse and volat, distributed with the textbook and in the wooldridge R package. All estimates on this page were computed from them. The demo is simulated.

Any errors are our own.