অর্থনীতি · বই 4 · স্নাতক দ্বিতীয় বর্ষ

University Economics — Year 2

এই বইটি এখনো বাংলা ভাষায় পাওয়া যায় না। সংস্করণ: English।

University Economics — Year 2 · স্নাতক দ্বিতীয় বর্ষ

34Time Series: A First Course

Most macroeconomic data are time series: one country, observed quarter after quarter. Each observation resembles the one before it, the samples are short, and many series wander without returning to a fixed level. The regression methods of the last four chapters assumed independent observations; this chapter shows what changes when they are not. The chart shows the main danger: two series that have nothing to do with each other.

Two independent simulated random walks of 200 steps (each step a standard normal draw), and the regression of one on the other: R2 = 0.548, t = -15.5.
Two independent simulated random walks of 200 steps (each step a standard normal draw), and the regression of one on the other: R2=0.548R^2 = 0.548, t=−15.5t = -15.5. Source: Simulated (seeded); our computation

Each walk adds an independent random step to its previous value; the two were drawn separately. Yet the regression of B on A has an R2R^2 of 0.55 and a tt statistic of −15.5-15.5. The pair was picked to make the point; the chapter’s first listing measures how often such a result appears by chance.

You already know

From the Year 1 volume: logarithms and growth rates, the OLS estimator, R2R^2, tests and confidence intervals. From Chapter 31: robust standard errors and the size of a test. From Chapter 28: detrending and the cyclical component.

34.1 Trend and season

A series yty_t, t=1,…,Tt = 1, \dots, T, often has a trend, a slow, persistent movement such as the growth of real GDP, and a season, a pattern that repeats each year, such as retail sales that peak in December. Official statistics usually publish seasonally adjusted series, from which the season has been estimated and removed; the series used below are all seasonally adjusted. A trend is handled by taking logarithms and differences: 100Δln⁡yt100\Delta\ln y_t is the growth rate in per cent, and four times it, for a quarterly series, the annualised rate. The deviation from a smooth trend was the business cycle of Chapter 28.

34.2 Autocorrelation

Definition 34.1 (Autocorrelation function)

The autocorrelation function of a series gives, for each lag kk, the correlation ρk=Cov⁡(yt,yt−k)/Var⁡(yt)\rho_k = \operatorname{Cov}(y_t, y_{t-k})/\operatorname{Var}(y_t) between the series and itself kk periods earlier. Its sample version is rk=∑t=k+1T(yt−yˉ)(yt−k−yˉ)/∑t=1T(yt−yˉ)2r_k = \sum_{t=k+1}^T(y_t - \bar y)(y_{t-k} - \bar y)/\sum_{t=1}^T(y_t - \bar y)^2.

Sample autocorrelations of US quarterly inflation (annualised) and of the unemployment rate, lags 1 to 12 quarters, 1959–2009. Dashed lines: ±1.96/√T, the 95 per cent band for a series with no autocorrelation.
Sample autocorrelations of US quarterly inflation (annualised) and of the unemployment rate, lags 1 to 12 quarters, 1959–2009. Dashed lines: ±1.96/T\pm1.96/\sqrt{T}, the 95 per cent band for a series with no autocorrelation. Source: statsmodels macrodata (FRED and Bureau of Labor Statistics); our computation
"""Sample autocorrelations of US inflation and unemployment, 1959-2009."""

import numpy as np
from econdata import sm_dataset
from statsmodels.tsa.stattools import acf

d = sm_dataset("macrodata")
for name in ("infl", "unemp"):
    x = d[name].to_numpy()
    r = acf(x, nlags=4)
    xd = x - x.mean()
    r1 = (xd[1:] @ xd[:-1]) / (xd @ xd)  # lag 1 by hand
    print(f"{name:6s} lags 1-4: {np.round(r[1:], 3)}   lag 1 by hand {r1:.3f}")
print(f"band for white noise: +/- {1.96 / np.sqrt(len(d)):.3f}")
Listing 34.1. Sample autocorrelations, with lag 1 also computed by hand. code/bachelor-2/34-time-series/listings/acf.py
$ python acf.py
infl   lags 1-4: [0.642 0.595 0.616 0.493]   lag 1 by hand 0.642
unemp  lags 1-4: [0.956 0.88  0.793 0.706]   lag 1 by hand 0.956
band for white noise: +/- 0.138
Output 34.1. Both series remember: unemployment almost perfectly from one quarter to the next.

Inflation has a first autocorrelation of 0.64, unemployment of 0.96, and both stay above the band for twelve quarters. A regression on such data has far fewer independent observations than its 203 quarters suggest.

34.3 Stationarity

Definition 34.2 (Weak stationarity)

A series is weakly stationary if its mean E[yt]E[y_t] and variance Var⁡(yt)\operatorname{Var}(y_t) do not depend on tt, and the covariance Cov⁡(yt,yt−k)\operatorname{Cov}(y_t, y_{t-k}) depends only on the lag kk.

Definition 34.3 (White noise)

A white noise is a series εt\varepsilon_t with mean zero, constant variance σ2\sigma^2 and no autocorrelation at any lag.

A stationary series returns to its mean; its past is informative about its future, but less and less so at longer horizons. A series with a trend is not stationary, nor is a random walk (Section 34.5). Least squares, its standard errors and its tests keep their usual large-sample behaviour when the series involved are stationary and their autocorrelations die out fast enough; they lose it when the series are not.

34.4 Autoregressive and moving-average models

Definition 34.4 (Autoregressive process)

An autoregressive process of order pp, AR(pp), is yt=c+ϕ1yt−1+⋯+ϕpyt−p+εty_t = c + \phi_1y_{t-1} + \dots + \phi_py_{t-p} + \varepsilon_t with εt\varepsilon_t white noise.

Definition 34.5 (Moving-average process)

A moving-average process of order qq, MA(qq), is yt=μ+εt+θ1εt−1+⋯+θqεt−qy_t = \mu + \varepsilon_t + \theta_1\varepsilon_{t-1} + \dots + \theta_q\varepsilon_{t-q} with εt\varepsilon_t white noise.

Proposition 34.6 (Moments of an AR(1))

If yt=c+ϕyt−1+εty_t = c + \phi y_{t-1} + \varepsilon_t with ∣ϕ∣<1|\phi| < 1 and yty_t stationary, then

E[yt]=c1−ϕ,Var⁡(yt)=σ21−ϕ2,ρk=ϕk.E[y_t] = \frac{c}{1 - \phi},\qquad \operatorname{Var}(y_t) = \frac{\sigma^2}{1 - \phi^2},\qquad \rho_k = \phi^k.

Proof. Take expectations: μ=c+ϕμ\mu = c + \phi\mu, so μ=c/(1−ϕ)\mu = c/(1 - \phi). Take variances, using that εt\varepsilon_t is uncorrelated with yt−1y_{t-1} (which depends only on earlier shocks): γ0=ϕ2γ0+σ2\gamma_0 = \phi^2\gamma_0 + \sigma^2. Multiply yt−μ=ϕ(yt−1−μ)+εty_t - \mu = \phi(y_{t-1} - \mu) + \varepsilon_t by yt−k−μy_{t-k} - \mu and take expectations: γk=ϕγk−1\gamma_k = \phi\gamma_{k-1} for k≥1k \ge 1, so γk=ϕkγ0\gamma_k = \phi^k\gamma_0 and ρk=ϕk\rho_k = \phi^k. ∎

A shock to an AR(1) decays geometrically: after hh periods a fraction ϕh\phi^h remains, and half of it is gone after ln⁡0.5/ln⁡ϕ\ln 0.5/\ln\phi periods, the shock’s half-life. An MA(1) remembers one period only: ρ1=θ/(1+θ2)\rho_1 = \theta/(1 + \theta^2) and ρk=0\rho_k = 0 for k≥2k \ge 2 (Exercise 10). An AR model is fitted by least squares of yty_t on its own lags.

"""AR(1) and AR(2) for US unemployment: least squares by hand, and AutoReg."""

import numpy as np
import statsmodels.api as sm
from econdata import sm_dataset
from statsmodels.tsa.ar_model import AutoReg

u = sm_dataset("macrodata").unemp.to_numpy()

ols1 = sm.OLS(u[1:], sm.add_constant(u[:-1])).fit()
ar1 = AutoReg(u, lags=1).fit()
print(f"AR(1) by OLS:     c {ols1.params[0]:.4f}, phi {ols1.params[1]:.4f}")
print(f"AR(1) by AutoReg: c {ar1.params[0]:.4f}, phi {ar1.params[1]:.4f}")
c, phi = ols1.params
half_life = np.log(0.5) / np.log(phi)
print(f"implied mean {c / (1 - phi):.2f}; half-life {half_life:.1f} quarters")

X2 = sm.add_constant(np.column_stack([u[1:-1], u[:-2]]))
ols2 = sm.OLS(u[2:], X2).fit()
ar2 = AutoReg(u, lags=2).fit()
print(f"AR(2) by OLS:     {np.round(ols2.params, 4)}")
print(f"AR(2) by AutoReg: {np.round(ar2.params, 4)}")
print(f"t of the second lag {ols2.tvalues[2]:.2f}")
Listing 34.2. AR(1) and AR(2) for US unemployment, by least squares and by statsmodels’ AutoReg. code/bachelor-2/34-time-series/listings/ar_fit.py
$ python ar_fit.py
AR(1) by OLS:     c 0.0889, phi 0.9880
AR(1) by AutoReg: c 0.0889, phi 0.9880
implied mean 7.44; half-life 57.6 quarters
AR(2) by OLS:     [ 0.2487  1.6394 -0.68  ]
AR(2) by AutoReg: [ 0.2487  1.6394 -0.68  ]
t of the second lag -12.90
Output 34.2. The two routes agree. The AR(1) coefficient is close to one; the AR(2) has a large negative second lag.

The AR(1) coefficient of 0.988 implies a half-life of 58 quarters, more than fourteen years, which is not a credible description of how unemployment recovers from a recession. The AR(2) tells a different story: a rise in unemployment is followed by further rises (ϕ1=1.64\phi_1 = 1.64), then a fall (ϕ2=−0.68\phi_2 = -0.68, t=−12.9t = -12.9), the hump of a recession and its recovery. A coefficient this close to one also raises the question of the next section.

34.5 Unit roots and spurious regression

Definition 34.7 (Unit root)

A series has a unit root if it is an autoregression whose coefficients sum to one; the simplest case is the random walk yt=yt−1+εty_t = y_{t-1} + \varepsilon_t. Its shocks never decay, and its variance grows with tt.

Definition 34.8 (Spurious regression)

A spurious regression is a regression between series with unit roots that shows a large R2R^2 and significant tt statistics although the series are unrelated.

"""Spurious regression: independent random walks, regressed on each other."""

import numpy as np
import statsmodels.api as sm

rng = np.random.default_rng(34)
n, reps = 200, 2000
levels = diffs = 0
r2 = []
for _ in range(reps):
    x = rng.standard_normal(n).cumsum()
    y = rng.standard_normal(n).cumsum()  # independent of x
    fit = sm.OLS(y, sm.add_constant(x)).fit()
    levels += abs(fit.tvalues[1]) > 1.96
    r2.append(fit.rsquared)
    fit_d = sm.OLS(np.diff(y), sm.add_constant(np.diff(x))).fit()
    diffs += abs(fit_d.tvalues[1]) > 1.96

print(f"levels:      |t| > 1.96 in {levels / reps:.3f} of samples")
print(f"             median R2 {np.median(r2):.3f}")
print(f"differences: |t| > 1.96 in {diffs / reps:.3f} of samples")
Listing 34.3. Two thousand pairs of independent random walks, regressed in levels and in differences. code/bachelor-2/34-time-series/listings/random_walks.py
$ python random_walks.py
levels:      |t| > 1.96 in 0.839 of samples
             median R2 0.174
differences: |t| > 1.96 in 0.059 of samples
Output 34.3. In levels, a test of size 5 per cent rejects 84 per cent of the time; in differences, 6 per cent.

In levels the tt test rejects the true hypothesis of no relation in 84 per cent of the samples, and the median R2R^2 is 0.17. The residuals of such a regression are themselves a random walk, and the formulas for the standard errors assume they are not. In differences, where each series is white noise, the test rejects 5.9 per cent of the time, as it should.

Definition 34.9 (Dickey–Fuller test)

The Dickey–Fuller test tests the null hypothesis of a unit root by regressing Δyt\Delta y_t on a constant (and possibly a trend), yt−1y_{t-1}, and lags of Δyt\Delta y_t; the statistic is the tt ratio of the coefficient on yt−1y_{t-1}, compared with critical values derived under the unit-root null, which are more negative than those of the normal distribution.

Under a unit root the tt ratio does not follow the usual distribution: the 5 per cent critical value is about −2.9-2.9 with a constant and −3.4-3.4 with a constant and a trend, against −1.65-1.65 for a one-sided normal test. The version with lags of Δyt\Delta y_t is called augmented.

"""Dickey-Fuller tests: log real GDP (with a trend) and its growth rate."""

import numpy as np
from econdata import sm_dataset
from statsmodels.tsa.stattools import adfuller

d = sm_dataset("macrodata")
lgdp = np.log(d.realgdp.to_numpy())
growth = 400 * np.diff(lgdp)  # annualised, per cent

for name, x, trend in (("log real GDP", lgdp, "ct"), ("GDP growth", growth, "c")):
    stat, p, lags, nobs, crit, _ = adfuller(
        x, regression=trend, autolag="AIC", result_object=False
    )
    print(f"{name:13s} ADF {stat:6.2f}, 5 % critical value {crit['5%']:.2f},"
          f" p-value {p:.3f}, lags {lags}")  # fmt: skip
Listing 34.4. Augmented Dickey–Fuller tests on US log real GDP (with a trend) and on its growth rate. code/bachelor-2/34-time-series/listings/adf.py
$ python adf.py
log real GDP  ADF  -2.38, 5 % critical value -3.43, p-value 0.389, lags 2
GDP growth    ADF  -6.97, 5 % critical value -2.88, p-value 0.000, lags 1
Output 34.4. A unit root is not rejected in the level of log GDP, and clearly rejected in its growth rate.

Log real GDP gives −2.38-2.38, short of the critical value of −3.43-3.43: the data cannot reject a unit root around a trend. Its growth rate gives −6.97-6.97, far beyond −2.88-2.88. The test has low power: it often fails to reject a unit root in series that are stationary but persistent, and 50 years of quarterly data rarely settle the question. The practical lesson is narrower: a regression in levels of persistent series needs a reason to be believed, and regressions in growth rates are the safer default.

34.6 Distributed lags

Definition 34.10 (Distributed-lag model)

A distributed-lag model relates yty_t to current and past values of a regressor: yt=α+β0xt+β1xt−1+⋯+βqxt−q+uty_t = \alpha + \beta_0x_t + \beta_1x_{t-1} + \dots + \beta_qx_{t-q} + u_t.

Definition 34.11 (Dynamic multiplier)

In a distributed-lag model the dynamic multiplier at horizon hh is βh\beta_h, the effect on yt+hy_{t+h} of a one-unit change in xtx_t alone; the long-run multiplier is β0+β1+⋯+βq\beta_0 + \beta_1 + \dots + \beta_q, the effect of a permanent one-unit change in xx.

If a rise of one point in a tax rate lowers sales by 0.2 per cent in the same quarter, 0.3 in the next and 0.1 in the one after, the dynamic multipliers are −0.2-0.2, −0.3-0.3 and −0.1-0.1, and the long-run effect of a permanent rise is −0.6-0.6 per cent. The coefficients have a causal reading only if xx is unrelated to the error at all leads and lags, the conditions of Chapter 33 stated in time; and since utu_t is usually autocorrelated, the standard errors need the correction of Section 34.9.

34.7 Forecasting and how to score it

Definition 34.12 (Out-of-sample forecast)

An out-of-sample forecast of yt+hy_{t+h} is made with a model fitted only on data available at date tt; a pseudo out-of-sample exercise repeats this for each tt in a past period, refitting each time, and compares the forecasts with what happened.

Definition 34.13 (Root mean squared forecast error)

The root mean squared forecast error of forecasts y^t+h\hat y_{t+h} is 1m∑t(yt+h−y^t+h)2\sqrt{\tfrac1m\sum_t(y_{t+h} - \hat y_{t+h})^2} over the mm forecasts made.

A model’s fit within its own sample flatters it: it was chosen to fit those data. The honest test is out of sample, against a simple benchmark. For inflation the benchmark is the random walk: inflation over the next four quarters equals inflation over the past four.

"""Four-quarter inflation forecasts, 1986-2009: a regression against a random walk."""

import numpy as np
from econdata import sm_dataset

d = sm_dataset("macrodata")
t = (d.year + (d.quarter - 1) / 4).to_numpy()
p = np.log(d.cpi.to_numpy())
pi4 = np.full(len(d), np.nan)
pi4[4:] = 100 * (p[4:] - p[:-4])  # inflation over the past four quarters

err_ar, err_rw = [], []
for i in range(len(d) - 4):
    if t[i] < 1985:
        continue
    j = np.arange(8, i - 3)  # past pairs (j -> j + 4) known at quarter i
    A = np.column_stack([np.ones(len(j)), pi4[j], pi4[j - 4]])
    b = np.linalg.lstsq(A, pi4[j + 4], rcond=None)[0]  # refitted every quarter
    forecast = b @ [1, pi4[i], pi4[i - 4]]
    err_ar.append(pi4[i + 4] - forecast)
    err_rw.append(pi4[i + 4] - pi4[i])  # random walk: no change

for name, e in (("regression", err_ar), ("random walk", err_rw)):
    e = np.array(e)
    print(f"{name:12s} RMSE {np.sqrt(np.mean(e**2)):.3f}, mean error {e.mean():.3f}")
print(f"forecasts: {len(err_ar)}")
Listing 34.5. Each quarter from 1985, a regression forecast of inflation four quarters ahead, refitted on the data then available, against the random walk. code/bachelor-2/34-time-series/listings/forecast.py
$ python forecast.py
regression   RMSE 1.772, mean error -0.722
random walk  RMSE 1.624, mean error -0.178
forecasts: 95
Output 34.5. The random walk wins.
US consumer-price inflation over four quarters, 1986–2009, and its forecasts made four quarters earlier: by a regression on past inflation, refitted each quarter, and by the random walk (past four-quarter inflation), per cent.
US consumer-price inflation over four quarters, 1986–2009, and its forecasts made four quarters earlier: by a regression on past inflation, refitted each quarter, and by the random walk (past four-quarter inflation), per cent. Source: statsmodels macrodata (FRED); our computation

Over 95 forecasts the regression misses by 1.77 points in root mean square, the random walk by 1.62. The regression forecasts lie above the outcome on average (a mean error of −0.72-0.72): fitted on data that include the high inflation of the 1970s, it keeps predicting a return toward a higher mean that did not come. Both miss the fall of 2009 by several points.

On the record — Inflation forecasts against a random walk

Atkeson and Ohanian (2001) compared three sets of inflation forecasts built on the relation between inflation and unemployment (a textbook model, two models of a type then common in research, and the forecasts of the Federal Reserve Board) with the naive forecast that inflation over the next year equals inflation over the past year, over the previous 15 years. None was more accurate than the naive forecast, and they predicted the direction of the change in inflation no better than a coin flip.

34.8 What Granger causality does and does not mean

Definition 34.14 (Granger causality)

A series xx Granger-causes a series yy if past values of xx help predict yty_t given past values of yy; the test is an FF test that the coefficients on the lags of xx are all zero in a regression of yty_t on lags of yy and of xx.

"""Granger causality between money growth and inflation, US 1959-2009."""

import numpy as np
import pandas as pd
from econdata import sm_dataset
from statsmodels.tsa.stattools import grangercausalitytests

d = sm_dataset("macrodata")
m = 400 * np.diff(np.log(d.m1.to_numpy()))  # M1 growth, annualised
infl = d.infl.to_numpy()[1:]
data = pd.DataFrame({"infl": infl, "money": m})

for target, cause in (("infl", "money"), ("money", "infl")):
    res = grangercausalitytests(data[[target, cause]], maxlag=4)
    F, p = res[4][0]["ssr_ftest"][:2]
    print(f"does {cause} help predict {target}? F {F:.2f}, p-value {p:.3f}")
Listing 34.6. Does money growth help predict inflation, and the reverse? Four lags each. code/bachelor-2/34-time-series/listings/granger.py
$ python granger.py
does money help predict infl? F 2.15, p-value 0.076
does infl help predict money? F 1.47, p-value 0.213
Output 34.6. Neither test rejects at 5 per cent.

With four quarterly lags, money growth does not help predict inflation at the 5 per cent level (p=0.076p = 0.076), nor inflation money growth (p=0.213p = 0.213). The name promises more than the test delivers. Granger causality is about prediction, not about effects in the sense of Chapter 33: a variable that responds to expectations of the future, such as an asset price, can predict an outcome it does not cause, and a policy that offsets shocks can cause an outcome while failing to predict it. The test answers a forecasting question; for that question it is the right one.

34.9 Serial correlation in regressions

When the errors of a regression are autocorrelated, least squares remains unbiased if the regressors are unrelated to the errors, but the classical and the heteroskedasticity-robust standard errors are both wrong: they ignore that neighbouring errors move together. Overlapping data make the problem certain: the change in inflation over the next four quarters, measured each quarter, shares three quarters with its neighbour.

Definition 34.15 (HAC standard error)

A HAC standard error (heteroskedasticity and autocorrelation consistent) replaces the middle term of the sandwich formula by ∑tu^t2xtxt′+∑j=1Lwj∑tu^tu^t−j(xtxt−j′+xt−jxt′)\sum_t\hat u_t^2x_tx_t' + \sum_{j=1}^Lw_j\sum_t\hat u_t\hat u_{t-j}(x_tx_{t-j}' + x_{t-j}x_t') with weights wj=1−j/(L+1)w_j = 1 - j/(L + 1); this is the Newey–West estimator.

"""Overlapping four-quarter changes: classical and Newey-West standard errors."""

import numpy as np
import statsmodels.api as sm
from econdata import sm_dataset

d = sm_dataset("macrodata")
p = np.log(d.cpi.to_numpy())
pi4 = 100 * (p[4:] - p[:-4])  # four-quarter inflation from 1960Q1
u = d.unemp.to_numpy()[4:]
change = pi4[4:] - pi4[:-4]  # change in inflation over the next four quarters
X = sm.add_constant(u[:-4])  # unemployment at the start

classical = sm.OLS(change, X).fit()
hac = sm.OLS(change, X).fit(cov_type="HAC", cov_kwds={"maxlags": 4})
res = classical.resid
r1 = (res[1:] @ res[:-1]) / (res @ res)
print(f"slope on unemployment {classical.params[1]:.3f}")
print(f"classical s.e. {classical.bse[1]:.3f}, Newey-West s.e. {hac.bse[1]:.3f}")
print(f"first autocorrelation of the residuals {r1:.3f}")
Listing 34.7. The change in inflation over the next four quarters against unemployment now: classical and Newey–West standard errors. code/bachelor-2/34-time-series/listings/hac.py
$ python hac.py
slope on unemployment -0.286
classical s.e. 0.095, Newey-West s.e. 0.151
first autocorrelation of the residuals 0.777
Output 34.7. The residuals are strongly autocorrelated, and the honest standard error is 60 per cent larger.

The slope is −0.29-0.29: higher unemployment is followed by falling inflation. The residuals have a first autocorrelation of 0.78, and the Newey–West standard error, 0.151, is 1.6 times the classical 0.095. The tt statistic falls from −3.0-3.0 to −1.9-1.9: significant at 5 per cent with the wrong standard error, not quite with the right one.

Model — AR(1) model

Assumes. yt=c+ϕyt−1+εty_t = c + \phi y_{t-1} + \varepsilon_t with ∣ϕ∣<1|\phi| < 1 and white-noise shocks: the series returns to a fixed mean, and a shock decays by the factor ϕ\phi each period.

Predicts. Autocorrelations ϕk\phi^k; a forecast that moves from the last value toward the mean c/(1−ϕ)c/(1 - \phi); forecast intervals that widen with the horizon toward the series’ own spread.

Tested. US unemployment fits an AR(1) with ϕ=0.988\phi = 0.988, a half-life of 58 quarters at odds with its recoveries; an AR(2) fits its hump far better. Inflation forecasts from regressions on past inflation did no better than a random walk from 1986 to 2009, as Atkeson and Ohanian (2001) found for richer models.

Breaks. When the mean shifts (inflation in the 1970s and after 1985) or the series has a unit root, the fitted ϕ\phi and the implied mean describe the sample, not the future; short samples cannot tell a large ϕ\phi from a unit root.

34.10 Exercises

Exercise 34.1 ★

Read the opening chart. If you knew nothing of how the walks were made, what would the regression suggest? Why is the suggestion wrong?

Solution

Solution of Exercise 34.1.

A strong negative relation: R2=0.55R^2 = 0.55, t=−15.5t = -15.5. It is wrong because the walks are independent by construction. Both wander far from their start, and two wandering series drift in some direction relative to each other in any sample; the tt statistic, computed as if the residuals were independent, treats this drift as evidence.

Exercise 34.2 ★

From the ACF chart, give the first and the twelfth autocorrelations of inflation and of unemployment, and the band. Which series is more persistent?

Solution

Solution of Exercise 34.2.

Inflation 0.642 at lag 1 and 0.238 at lag 12; unemployment 0.956 and 0.260; band ±0.138\pm0.138. Unemployment is far more persistent from quarter to quarter; after three years the two have similar autocorrelations, both still outside the band.

Exercise 34.3 ★

A distributed-lag model has β0=0.4\beta_0 = 0.4, β1=0.3\beta_1 = 0.3, β2=0.2\beta_2 = 0.2, β3=0.1\beta_3 = 0.1. Give the dynamic multipliers and the long-run multiplier.

Solution

Solution of Exercise 34.3.

Dynamic multipliers 0.4, 0.3, 0.2 and 0.1 at horizons 0 to 3; long-run multiplier 0.4+0.3+0.2+0.1=1.00.4 + 0.3 + 0.2 + 0.1 = 1.0.

Exercise 34.4 ★

A share price predicts next quarter’s GDP. Does it Granger-cause GDP? Does it cause GDP?

Solution

Solution of Exercise 34.4.

It Granger-causes GDP if it helps predict GDP given GDP’s own past, which is what the statement says. That does not mean it causes GDP: share prices respond to expected profits, so they move before the GDP changes that investors foresee, without producing them.

Exercise 34.5 ★★

For an AR(1) with ϕ=0.5\phi = 0.5, c=1c = 1, σ=1\sigma = 1: give the mean, the variance, the first three autocorrelations and the half-life of a shock.

Solution

Solution of Exercise 34.5.

Mean 1/(1−0.5)=21/(1 - 0.5) = 2; variance 1/(1−0.25)=1.331/(1 - 0.25) = 1.33; autocorrelations 0.5, 0.25, 0.125; half-life ln⁡0.5/ln⁡0.5=1\ln 0.5/\ln 0.5 = 1 period.

Exercise 34.6 ★★

From the AR(1) output for unemployment, compute the implied mean and the half-life. Compare the implied mean with the sample mean of the unemployment rate (5.9 per cent). What explains the gap?

Solution

Solution of Exercise 34.6.

Implied mean 0.0889/(1−0.9880)=7.440.0889/(1 - 0.9880) = 7.44 per cent; half-life ln⁡0.5/ln⁡0.988=57.6\ln 0.5/\ln 0.988 = 57.6 quarters. The sample mean is 5.9. With ϕ\phi so close to one, c/(1−ϕ)c/(1 - \phi) is very sensitive to small errors in ϕ\phi: its delta-method standard error is 3.0 points, so the gap is well within the estimate’s uncertainty. The AR(1) is also the wrong shape (the AR(2) fits much better), which biases its ϕ\phi toward one.

Exercise 34.7 ★★

(D) Add the unemployment rate at the forecast date to the forecasting regression of the listing and repeat the exercise. Does the root mean squared error fall?

Solution

Solution of Exercise 34.7.

Root mean squared errors: 1.772 without unemployment, 1.775 with it, 1.624 for the random walk. Adding unemployment does not help; the random walk still wins, as Atkeson and Ohanian (2001) found with richer models over a similar period.

Exercise 34.8 ★★

Why does the regression in differences of the random-walk listing reject at the nominal rate while the regression in levels does not?

Solution

Solution of Exercise 34.8.

In differences both series are independent white noise: the regression’s errors are white noise, independent of the regressor, and the usual tt statistic has its usual distribution, so it rejects 5.9 per cent of the time, close to 5. In levels the errors are a random walk, so the classical standard error is far too small and the tt statistic does not settle down as the sample grows.

Exercise 34.9 ★★

From the HAC output, compute the tt statistic of the slope with each standard error. Which conclusion changes at the 5 per cent level, and which does not?

Solution

Solution of Exercise 34.9.

t=−0.286/0.095=−3.0t = -0.286/0.095 = -3.0 with the classical error and −0.286/0.151=−1.9-0.286/0.151 = -1.9 with Newey–West. At the 5 per cent level the classical test rejects a zero slope and the Newey–West test does not; at 10 per cent both reject. The estimate itself is the same.

Exercise 34.10 ★★★

For the MA(1) yt=εt+θεt−1y_t = \varepsilon_t + \theta\varepsilon_{t-1}, derive the variance and the autocorrelations. Which value of θ\theta gives the largest first autocorrelation?

Solution

Solution of Exercise 34.10.

Var⁡(yt)=σ2(1+θ2)\operatorname{Var}(y_t) = \sigma^2(1 + \theta^2); Cov⁡(yt,yt−1)=E[(εt+θεt−1)(εt−1+θεt−2)]=θσ2\operatorname{Cov}(y_t, y_{t-1}) = E[(\varepsilon_t + \theta\varepsilon_{t-1})(\varepsilon_{t-1} + \theta\varepsilon_{t-2})] = \theta\sigma^2, so ρ1=θ/(1+θ2)\rho_1 = \theta/(1 + \theta^2); at lags 2 and more the two terms share no shock, so ρk=0\rho_k = 0. The derivative of θ/(1+θ2)\theta/(1 + \theta^2) is (1−θ2)/(1+θ2)2(1 - \theta^2)/(1 + \theta^2)^2, zero at θ=1\theta = 1, where ρ1=0.5\rho_1 = 0.5: an MA(1) can never have a first autocorrelation above one half.

Exercise 34.11 ★★★

For a random walk starting at y0=0y_0 = 0, show that Var⁡(yt)=tσ2\operatorname{Var}(y_t) = t\sigma^2 and that the correlation of yty_t with yt−ky_{t-k} is (t−k)/t\sqrt{(t - k)/t}. Why does this rule out stationarity?

Solution

Solution of Exercise 34.11.

yt=ε1+⋯+εty_t = \varepsilon_1 + \dots + \varepsilon_t, a sum of tt independent shocks, so Var⁡(yt)=tσ2\operatorname{Var}(y_t) = t\sigma^2. Cov⁡(yt,yt−k)=Var⁡(yt−k)=(t−k)σ2\operatorname{Cov}(y_t, y_{t-k}) = \operatorname{Var}(y_{t-k}) = (t - k)\sigma^2, since the later shocks are independent of yt−ky_{t-k}; the correlation is (t−k)σ2/tσ2(t−k)σ2=(t−k)/t(t - k)\sigma^2/\sqrt{t\sigma^2(t - k)\sigma^2} = \sqrt{(t - k)/t}. The variance and the correlation depend on tt, which weak stationarity forbids.

Exercise 34.12 ★★★

For an AR(1) with known cc, ϕ\phi and σ\sigma, derive the hh-step forecast E[yt+h∣yt]E[y_{t+h} \mid y_t] and its error variance. What do they tend to as hh grows?

Solution

Solution of Exercise 34.12.

With μ=c/(1−ϕ)\mu = c/(1 - \phi), yt+h−μ=ϕh(yt−μ)+εt+h+ϕεt+h−1+⋯+ϕh−1εt+1y_{t+h} - \mu = \phi^h(y_t - \mu) + \varepsilon_{t+h} + \phi\varepsilon_{t+h-1} + \dots + \phi^{h-1}\varepsilon_{t+1}. So E[yt+h∣yt]=μ+ϕh(yt−μ)E[y_{t+h} \mid y_t] = \mu + \phi^h(y_t - \mu), and the error variance is σ2(1+ϕ2+⋯+ϕ2(h−1))=σ2(1−ϕ2h)/(1−ϕ2)\sigma^2(1 + \phi^2 + \dots + \phi^{2(h-1)}) = \sigma^2(1 - \phi^{2h})/(1 - \phi^2). As hh grows the forecast tends to the mean and the error variance to the series’ own variance σ2/(1−ϕ2)\sigma^2/(1 - \phi^2): far enough ahead, knowing yty_t does not help.

34.11 Problem: Brenland’s inflation

Problem 34.1

Weekend problem — Brenland’s inflation: growth rates and autocorrelation, an AR(1), a unit-root test, and a two-year forecast

Brenland’s consumer price index for 2000–2025 is in the country’s national accounts (accounts, column cpi, 2015 = 100). Use annual inflation πt=100ln⁡(CPIt/CPIt−1)\pi_t = 100\ln(\mathit{CPI}_t/\mathit{CPI}_{t-1}), 2001–2025.

Part I — Growth rates and autocorrelation.

  1. How many observations of πt\pi_t are there?
  2. Give the mean and standard deviation of inflation.
  3. In which year was inflation highest, and how high?
  4. Give inflation in 2025.
  5. Give the first sample autocorrelation.
  6. Is it outside the 95 per cent band for white noise?

Part II — An AR(1).

  1. Fit πt=c+ϕπt−1+εt\pi_t = c + \phi\pi_{t-1} + \varepsilon_t by least squares: give cc and ϕ\phi.
  2. Give the standard error of ϕ\phi and its tt statistic against zero.
  3. Give the implied mean and compare it with the sample mean.
  4. Give the half-life of an inflation shock.
  5. Give the standard deviation of the residuals.
  6. What does the AR(1) say about the 2022 surge?

Part III — A unit-root test.

  1. Write the Dickey–Fuller regression with a constant and no lags.
  2. Give the statistic.
  3. Give the 5 per cent critical value for this sample.
  4. Is a unit root rejected at 5 per cent? At 10 per cent?
  5. How can ϕ^=0.48\hat\phi = 0.48 fail to reject ϕ=1\phi = 1?
  6. What does this mean for Part IV?

Part IV — A forecast and its interval.

  1. Forecast inflation for 2026.
  2. Forecast inflation for 2027.
  3. Give the standard error of each forecast, ignoring the uncertainty in cc and ϕ\phi.
  4. Give the 95 per cent interval for 2027.
  5. Why is the 2027 interval wider than the 2026 one, and what width does it tend to?
  6. What would a random-walk forecast give for 2027?
  7. State the result: the AR(1) persistence, the half-life of an inflation shock, and the two-year forecast with its interval.
Solution

Solution of Problem 34.1.

Part I. 1. 25 (2001–2025). 2. Mean 2.69 per cent, standard deviation 1.71. 3. 2022, at 9.70 per cent. 4. 2.47 per cent. 5. 0.48. 6. Yes: the band is ±1.96/25=±0.39\pm1.96/\sqrt{25} = \pm0.39. Part II. 7. c=1.40c = 1.40, ϕ=0.48\phi = 0.48. 8. Standard error 0.186; t=0.4845/0.1863=2.60t = 0.4845/0.1863 = 2.60. 9. 1.397/(1−0.4845)=2.711.397/(1 - 0.4845) = 2.71, close to the sample mean of 2.69. 10. ln⁡0.5/ln⁡0.4845=0.96\ln 0.5/\ln 0.4845 = 0.96 years: about a year. 11. 1.56 points. 12. The 2022 residual is 6.51 points, 4.2 residual standard deviations: an exceptional shock, which the AR(1) then expects to halve each year. Its forecasts for 2023 and 2024 (6.09 and 4.05) were close to the outcomes (5.49 and 3.71), a little above them. Part III. 13. Δπt=α+γπt−1+et\Delta\pi_t = \alpha + \gamma\pi_{t-1} + e_t with γ=ϕ−1\gamma = \phi - 1; the null is γ=0\gamma = 0. 14. −2.77-2.77. 15. −2.99-2.99 (with 25 observations; −2.64-2.64 at 10 per cent). 16. Not at 5 per cent; yes at 10 per cent (p=0.063p = 0.063). 17. The statistic is (ϕ^−1)/s.e.=(0.4845−1)/0.1863=−2.77(\hat\phi - 1)/\mathrm{s.e.} = (0.4845 - 1)/0.1863 = -2.77: with 24 usable years the standard error is large, and under the null the statistic has a distribution shifted to the left, so even an estimate far below one is not far enough. The test has little power in so short a sample. 18. The AR(1) forecast assumes inflation returns to 2.7; if inflation has a unit root, it need not, and the intervals of Part IV are too narrow. The test cannot rule this out, so the forecast is conditional on stationarity. Part IV. 19. 1.397+0.4845×2.469=2.591.397 + 0.4845 \times 2.469 = 2.59 per cent. 20. 1.397+0.4845×2.594=2.651.397 + 0.4845 \times 2.594 = 2.65 per cent. 21. 1.56 for 2026; 1.5651+0.48452=1.741.565\sqrt{1 + 0.4845^2} = 1.74 for 2027. 22. 2.65±1.96×1.742.65 \pm 1.96 \times 1.74: from −0.75-0.75 to 6.06 per cent. 23. Two years ahead, two shocks are unknown. As the horizon grows the standard error tends to 1.565/1−0.48452=1.791.565/\sqrt{1 - 0.4845^2} = 1.79, a half-width of 3.5 points. 24. 2.47 per cent, the last observation, with an error that keeps growing with the horizon. 25. Brenland’s inflation has an AR(1) persistence of 0.48: half of an inflation shock is gone in about a year (0.96 years), and the two-year-ahead forecast for 2027 is 2.65 per cent, with a 95 per cent interval from −0.75-0.75 to 6.06 — on the assumption, which 25 years of data cannot confirm, that inflation has no unit root.

এই অধ্যায়ে সংজ্ঞায়িত পরিভাষা-শব্দ

পরিভাষায় সব 1086 টি শব্দ দেখো