ECON 4354/6354 — Homework 2: Solutions

Published

October 12, 2026

  • This is one set of acceptable answers. For the conceptual questions there is more than one defensible line of argument.
  • Questions are from Diebold, Forecasting, Sections 2.12 (Problems 1, 5a, 6c) and 3.5 (Problem 1).

0. Setup

library(tidyverse)
library(lmtest)       # dwtest(), bgtest(), bptest(), resettest(), gqtest(), coeftest()
library(sandwich)     # NeweyWest()
library(tseries)      # jarque.bera.test()
library(strucchange)  # sctest(), efp()

smu_blue <- "#354CA1"
smu_red  <- "#CC0035"
theme_set(theme_minimal(base_size = 12))

1. Properties of Loss Functions

Plot the four candidates

L_a <- function(e) e^2 + e
L_b <- function(e) e^4 + 2 * e^2
L_c <- function(e) 3 * e^2 + 1
L_d <- function(e) ifelse(e > 0, sqrt(pmax(e, 0)), abs(e))

loss_grid <- tibble(e = seq(-2, 2, length.out = 801)) |>
  mutate(
    `(a)  e² + e`        = L_a(e),
    `(b)  e⁴ + 2e²`      = L_b(e),
    `(c)  3e² + 1`       = L_c(e),
    `(d)  √e  /  |e|`    = L_d(e)
  ) |>
  pivot_longer(-e, names_to = "candidate", values_to = "loss")

ggplot(loss_grid, aes(e, loss)) +
  geom_hline(yintercept = 0, colour = "grey60") +
  geom_vline(xintercept = 0, colour = "grey60") +
  geom_line(colour = smu_blue, linewidth = 0.9) +
  facet_wrap(~ candidate, scales = "free_y") +
  labs(x = "forecast error  e", y = "L(e)",
       title = "Four candidate loss functions")

The pictures give away the answers: panel (a) has its minimum to the left of the origin and dips below zero, panel (c) sits on a pedestal of height 1, and panel (d) is visibly lopsided.

(a) \(L(e) = e^2 + e\): not a valid loss function

\(L\) is minimized at \(-1/2\) not \(0\) and it can take negative values.

(b) \(L(e) = e^4 + 2e^2\): valid, symmetric

(c) \(L(e) = 3e^2 + 1\): not a valid loss function as \(L(0) \neq 0\).

However, it becomes a valid loss function if we normalize it by subtracting a constant \(1\).

(d) valid, asymmetric

Which one would you use for a firm’s quarterly sales?

Only (b) and (d) are admissible. If over- and under-prediction cost the firm roughly the same, use a symmetric loss: (b), or its simpler cousin \(e^2\), which has the additional virtue that the optimal forecast is the conditional mean, and the conditional mean is precisely what a regression estimates. If the firm’s costs are genuinely one-sided, for instance when a stock-out loses a customer permanently but excess inventory only ties up working capital for a quarter, then an asymmetric loss such as (d) or the linlin loss is the honest choice, and you should then expect the optimal forecast to be biased rather than treat the bias as a defect.

2. Univariate and Multivariate Information Sets

Write \(p_t\) for the stock’s price and \(v_t\) for its volatility. The distinction in §2.2.1 is about what you condition on, not about how many variables you forecast:

\[\Omega_T^{\text{univariate}} = \{y_T,\, y_{T-1},\, \dots,\, y_1\}, \qquad \Omega_T^{\text{multivariate}} = \{y_T,\, x_T,\, y_{T-1},\, x_{T-1},\, \dots,\, y_1,\, x_1\}.\]

i. Price history to forecast price: univariate. \[\Omega_T = \{p_T,\, p_{T-1},\, \dots,\, p_1\}.\] One variable is modeled and forecast entirely on the basis of its own past. This is the pure time series case.

ii. Price and volatility history to forecast price: multivariate. \[\Omega_T = \{p_T,\, v_T,\, p_{T-1},\, v_{T-1},\, \dots,\, p_1,\, v_1\}.\] The conditioning set now contains the history of a second variable, so the information set is multivariate even though only one variable is being forecast. This is a single forecasting equation with an extra predictor.

iii. Price and volatility history to forecast price and volatility: multivariate. \[\Omega_T = \{p_T,\, v_T,\, p_{T-1},\, v_{T-1},\, \dots,\, p_1,\, v_1\},\] exactly as in (ii).

What actually separates (ii) from (iii)

Situations (ii) and (iii) have identical information sets. What differs is the forecast object. In (ii) you need one equation, for \(p_{T+1}\). In (iii) you need a system: an equation for \(p_{T+1}\) and an equation for \(v_{T+1}\), each conditioning on the joint past, and, if you want joint interval or density statements, the dependence between the two forecast errors as well.

3. Assessing a Forecasting Situation: the D&D Advertising Campaign

Omitted.

4. Regression, Regression Diagnostics, and Regression Graphics in Action

The data

dat <- read_csv("data/hw2_gdp_spread.csv")
glimpse(dat)
Rows: 262
Columns: 5
$ date       <date> 1959-01-01, 1959-04-01, 1959-07-01, 1959-10-01, 1960-01-01…
$ quarter    <chr> "1959 Q1", "1959 Q2", "1959 Q3", "1959 Q4", "1960 Q1", "196…
$ gdp        <dbl> 3352.129, 3427.667, 3430.057, 3439.832, 3517.181, 3498.246,…
$ gdp_growth <dbl> 7.6009, 8.9137, 0.2788, 1.1383, 8.8949, -2.1592, 1.9549, -5…
$ spread     <dbl> 1.2167, 1.2567, 0.9633, 0.3533, 0.6133, 1.2667, 1.4733, 1.5…
reg <- dat |>
  mutate(y = gdp_growth, xlag1 = lag(spread)) |>
  filter(!is.na(xlag1))

nrow(reg)
[1] 261
range(reg$quarter)
[1] "1959 Q2" "2024 Q2"

Lagging costs one observation, so 261 quarters remain, 1959Q2 through 2024Q2.

(a) Why a lagged right-hand-side variable?

Reason 1: a forecast must be computable from what you know when you make it. Standing at the end of quarter \(t-1\) and wanting a forecast of \(y_t\), a model \[y_t = \beta_1 + \beta_2 x_t + \varepsilon_t\] is not directly useful, because \(x_t\) will not be realized until the end of quarter \(t\), the same moment at which \(y_t\) itself becomes known. To use such an equation you would first have to forecast \(x_t\), which replaces one forecasting problem with another and injects the error in \(\hat{x}_t\) into the forecast of \(y_t\).

Reason 2: it is natural to incorporate time dependence in the economic dynamics. The lag is part of the mechanism, not just a computational convenience.

(b) Graph Y vs. XLAG1

ggplot(reg, aes(xlag1, y)) +
  geom_point(alpha = 0.6, colour = smu_blue) +
  geom_smooth(method = "lm", se = FALSE, colour = smu_red, linewidth = 0.9) +
  labs(x = "term spread, lagged one quarter (percentage points)",
       y = "real GDP growth (annualized %)",
       title = "Y vs. XLAG1, 1959Q2 to 2024Q2")
`geom_smooth()` using formula = 'y ~ x'

dat |>
  select(date, `real GDP growth (annualized %)` = gdp_growth,
         `term spread (pct. points)` = spread) |>
  pivot_longer(-date) |>
  ggplot(aes(date, value)) +
  geom_hline(yintercept = 0, colour = "grey60") +
  geom_line(colour = smu_blue) +
  facet_wrap(~ name, ncol = 1, scales = "free_y") +
  labs(x = NULL, y = NULL, title = "The two series")

The scatterplot shows a weak but visibly positive relationship: the cloud tilts upward, and a wide spread is more often followed by a quarter of above-average growth than by a quarter of below-average growth. The tilt is slight relative to the vertical scatter, which is a preview of the very small \(R^2\) to come.

Two features should worry you immediately.

  1. Two points are wildly detached from the rest. Near the bottom and top of the vertical axis sit 2020Q2 (\(-32.8\)% annualized) and 2020Q3 (\(+29.9\)%), the COVID shutdown and reopening. Both occurred at an entirely ordinary value of the lagged spread, so they carry no information about the relationship being estimated but enormous weight in a least-squares fit.
  2. The vertical scatter is not constant over time. The time plot shows that GDP growth is far more volatile before the mid-1980s than after, the Great Moderation. A single regression line with one error variance is being asked to describe two rather different regimes.

(c) Regress Y on XLAG1

fit <- lm(y ~ xlag1, data = reg)
summary(fit)

Call:
lm(formula = y ~ xlag1, data = reg)

Residuals:
    Min      1Q  Median      3Q     Max 
-35.301  -1.524   0.021   1.680  27.304 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)   2.3716     0.4075   5.820 1.73e-08 ***
xlag1         0.4190     0.2182   1.921   0.0559 .  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 4.236 on 259 degrees of freedom
Multiple R-squared:  0.01404,   Adjusted R-squared:  0.01024 
F-statistic: 3.689 on 1 and 259 DF,  p-value: 0.05588

The fitted forecasting equation is \[\hat{y}_t = 2.37 + 0.419\, x_{t-1},\] with \(R^2 = 0.014\) and \(SER = 4.24\).

Interpretation. The intercept says that when the yield curve is flat, \(x_{t-1}=0\), the model forecasts real GDP growth of about 2.4% at an annual rate, a little below the sample mean of 3.0%. The slope says that a one-percentage-point wider spread this quarter is associated with about 0.42 percentage points more annualized GDP growth next quarter. The sign is what theory predicts: a steep curve signals expected expansion, an inverted curve signals expected contraction. The magnitude is economically meaningful but small relative to the quarter-to-quarter variation in growth. The slope’s \(t\) statistic is 1.92, \(p = 0.056\), so it is not significant at the 5% level, and the \(F\) statistic tells the same story because there is only one regressor.

Is the \(R^2\) of 1.4% disappointing? It should not be, and it is not the right thing to look at.

(d) Variations on the theme

Begin, as the hint says, with the residual plot. It determines which formal test is worth running, and which is not to be trusted.

reg <- reg |> mutate(e = resid(fit), yhat = fitted(fit))

reg |>
  select(date, Actual = y, Fitted = yhat, Residual = e) |>
  pivot_longer(-date, names_to = "series") |>
  mutate(panel = if_else(series == "Residual", "Residual", "Actual and fitted")) |>
  ggplot(aes(date, value, colour = series)) +
  geom_hline(yintercept = 0, colour = "grey60") +
  geom_line(linewidth = 0.5) +
  facet_wrap(~ panel, ncol = 1, scales = "free_y") +
  scale_colour_manual(values = c(Actual = "grey45", Fitted = smu_red,
                                 Residual = smu_blue)) +
  labs(x = NULL, y = NULL, colour = NULL, title = "Residual plot")

The plot is dominated by 2020. The fitted values are a thin, nearly flat ribbon, because the model explains almost nothing, and the residuals inherit essentially all the variation in \(y\), including the two COVID spikes. The residuals are also visibly less volatile after the mid-1980s.

(i) Is an intercept necessary?

Yes, plainly. The mean of \(y\) over the sample is about 3.0% and the mean of \(x_{t-1}\) is about 1.4, so a line through the origin cannot pass through the center of the data. Dropping the intercept forces the slope to absorb the level:

coef(summary(lm(y ~ 0 + xlag1, data = reg)))
      Estimate Std. Error  t value     Pr(>|t|)
xlag1 1.391025  0.1490246 9.334194 4.703329e-18
mean(reg$y)
[1] 2.970541

The slope jumps from 0.42 to about 1.39 and acquires a spectacular \(t\) statistic, which is an artifact: with no intercept the regressor is doing the job of the constant, and the reported \(R^2\) from a no-intercept regression is not comparable to the usual one because the total sum of squares is no longer taken around \(\bar{y}\). The intercept also has a direct forecasting interpretation here, since it is the forecast issued when the yield curve is flat. Keep it.

(ii) Is the functional form adequate? Might the relationship be nonlinear?

resettest(fit, power = 2:3, type = "fitted")

    RESET test

data:  fit
RESET = 1.7407, df1 = 2, df2 = 257, p-value = 0.1775
coef(summary(lm(y ~ xlag1 + I(xlag1^2), data = reg)))
              Estimate Std. Error   t value     Pr(>|t|)
(Intercept)  2.2846098  0.4083639  5.594544 5.636324e-08
xlag1        1.1737502  0.4651856  2.523187 1.223123e-02
I(xlag1^2)  -0.2843825  0.1550092 -1.834617 6.771385e-02

On the full sample RESET does not reject, \(p = 0.18\), and the quadratic term is insignificant. But this is one of the tests the residual plot warned us not to trust: the two COVID observations inflate the residual variance so much that they swamp the power of any test based on it. Removing them changes the verdict (see (iv) below, where RESET has \(p = 0.07\) and the quadratic term is significant at the 5% level with a negative coefficient). The tentative conclusion is that the relationship is mildly concave: the predictive value of a steep curve tails off, while inversions carry real information. Given the small sample and the modest evidence, a linear specification is a defensible working choice, but not one to be asserted confidently.

(iii) Are the residuals random? Serially correlated? Heteroskedastic?

Run the tests on the full sample first, and then see why the answers are not to be believed.

dwtest(fit)

    Durbin-Watson test

data:  fit
DW = 1.9609, p-value = 0.3544
alternative hypothesis: true autocorrelation is greater than 0
bgtest(fit, order = 4)

    Breusch-Godfrey test for serial correlation of order up to 4

data:  fit
LM test = 2.7306, df = 4, p-value = 0.6039
bptest(fit)

    studentized Breusch-Pagan test

data:  fit
BP = 2.2414, df = 1, p-value = 0.1344

Taken at face value: \(DW = 1.96\), essentially the textbook ideal of 2; Breusch-Godfrey with four lags gives \(p = 0.60\); Breusch-Pagan gives \(p = 0.13\). One would conclude that the residuals are clean.

They are not. The residual autocorrelation function shows why the tests look so healthy:

acf_gg <- function(e, lag.max = 20) {
  a <- acf(e, lag.max = lag.max, plot = FALSE)
  tibble(lag = as.numeric(a$lag), acf = as.numeric(a$acf))[-1, ] |>
    ggplot(aes(lag, acf)) +
    geom_hline(yintercept = 0, colour = "grey50") +
    geom_segment(aes(xend = lag, yend = 0), colour = smu_blue, linewidth = 0.8) +
    geom_hline(yintercept = c(-1, 1) * qnorm(0.975) / sqrt(length(e)),
               linetype = "dashed", colour = smu_red) +
    labs(x = "lag", y = "ACF")
}

acf_gg(reg$e) + labs(title = "Residual ACF, full sample")

Every autocorrelation is inside the bands. The explanation is arithmetic: the residual variance in the denominator of every autocorrelation is enormous because of 2020, so the numerators, which are ordinary-sized, produce tiny ratios. Two observations out of 261 have anaesthetized the whole diagnostic apparatus. That is the central lesson of this exercise, and it is why the residual plot comes first.

(iv) Outliers, and robustness

reg |>
  mutate(std_resid = e / sd(e), cooks_d = cooks.distance(fit)) |>
  arrange(desc(abs(e))) |>
  select(quarter, y, xlag1, e, std_resid, cooks_d) |>
  head(6)
# A tibble: 6 × 6
  quarter      y  xlag1      e std_resid cooks_d
  <chr>    <dbl>  <dbl>  <dbl>     <dbl>   <dbl>
1 2020 Q2 -32.8   0.267 -35.3      -8.35  0.261 
2 2020 Q3  29.9   0.543  27.3       6.46  0.124 
3 2008 Q4  -8.85  2.37  -12.2      -2.89  0.0260
4 1978 Q2  15.2   1.62   12.1       2.87  0.0162
5 1980 Q2  -8.33 -1.37  -10.1      -2.40  0.0738
6 1982 Q1  -6.26  2.34   -9.61     -2.27  0.0157
4 / nrow(reg)   # a common rule-of-thumb cutoff for Cook's distance
[1] 0.01532567

2020Q2 has a standardized residual of \(-8.4\) and 2020Q3 one of \(+6.5\); under normality, observations of that size should essentially never occur in 261 draws. Their Cook’s distances, 0.26 and 0.12, exceed the \(4/n = 0.015\) rule of thumb by an order of magnitude. The next largest residuals, 2008Q4 and 1978Q2, are around \(\pm 2.9\) standard deviations, which is unremarkable in a sample of this size.

These are not data errors. They are a genuine, and genuinely once-off, administrative shutdown of the economy and its reversal. That is exactly the case for treating them separately: they are not draws from the process we are trying to model, and the exercise is to forecast the process, not the pandemic.

Re-estimating without them:

reg_ex <- reg |> filter(!quarter %in% c("2020 Q2", "2020 Q3"))
fit_ex <- lm(y ~ xlag1, data = reg_ex)
summary(fit_ex)

Call:
lm(formula = y ~ xlag1, data = reg_ex)

Residuals:
     Min       1Q   Median       3Q      Max 
-12.2069  -1.4963   0.0345   1.6254  12.0960 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)   2.4673     0.3112   7.929 6.78e-14 ***
xlag1         0.3739     0.1660   2.252   0.0252 *  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 3.214 on 257 degrees of freedom
Multiple R-squared:  0.01936,   Adjusted R-squared:  0.01554 
F-statistic: 5.072 on 1 and 257 DF,  p-value: 0.02515

The point estimates are fairly robust: the slope moves from 0.419 to 0.374, well within one standard error. The inference is not robust at all. \(SER\) falls from 4.24 to 3.21, and now that the residual variance is no longer inflated, the diagnostics change completely:

dwtest(fit_ex)

    Durbin-Watson test

data:  fit_ex
DW = 1.463, p-value = 5.574e-06
alternative hypothesis: true autocorrelation is greater than 0
bgtest(fit_ex, order = 4)

    Breusch-Godfrey test for serial correlation of order up to 4

data:  fit_ex
LM test = 26.39, df = 4, p-value = 2.64e-05
resettest(fit_ex, power = 2:3, type = "fitted")

    RESET test

data:  fit_ex
RESET = 2.6529, df1 = 2, df2 = 255, p-value = 0.07239
coef(summary(lm(y ~ xlag1 + I(xlag1^2), data = reg_ex)))
              Estimate Std. Error   t value     Pr(>|t|)
(Intercept)  2.3872659  0.3105775  7.686538 3.237489e-13
xlag1        1.0884788  0.3517183  3.094746 2.188452e-03
I(xlag1^2)  -0.2695618  0.1172455 -2.299124 2.230360e-02
acf_gg(resid(fit_ex)) + labs(title = "Residual ACF, excluding 2020Q2 and 2020Q3")

\(DW\) falls to 1.46 with \(p \approx 6 \times 10^{-6}\), Breusch-Godfrey rejects with \(p \approx 3 \times 10^{-5}\), and the residual ACF shows clear positive autocorrelation at the first two lags, about 0.26 and 0.23. So the residuals are serially correlated, and the full-sample tests in (iii) were simply not able to see it. Serially correlated forecast errors mean the errors are themselves forecastable, which by the criterion of §2.2.3 means the forecasts can be improved. The obvious improvement is to let the model use the recent history of \(y\), and it works:

reg_ar <- reg_ex |> mutate(ylag1 = lag(y))
summary(lm(y ~ xlag1 + ylag1, data = reg_ar))$coefficients
             Estimate Std. Error  t value     Pr(>|t|)
(Intercept) 1.6773836 0.34275228 4.893866 1.754668e-06
xlag1       0.3452929 0.15940618 2.166120 3.122888e-02
ylag1       0.2690440 0.05930863 4.536339 8.818516e-06
summary(lm(y ~ xlag1 + ylag1, data = reg_ar))$r.squared
[1] 0.09316094

Lagged growth enters with a coefficient of about 0.27 and \(t \approx 4.5\), and \(R^2\) rises from 0.019 to 0.093, five times the fit of the spread alone.

On heteroskedasticity, Breusch-Pagan still fails to reject, but that is because BP asks whether the residual variance depends on the regressor, and here the variance shift is in time:

bptest(fit_ex)

    studentized Breusch-Pagan test

data:  fit_ex
BP = 2.2384, df = 1, p-value = 0.1346
gqtest(fit_ex, point = 0.5, alternative = "two.sided", order.by = reg_ex$date)

    Goldfeld-Quandt test

data:  fit_ex
GQ = 0.39704, df1 = 128, df2 = 127, p-value = 3.057e-07
alternative hypothesis: variance changes from segment 1 to 2
e_ex  <- resid(fit_ex)
pre84  <- e_ex[reg_ex$date <  as.Date("1984-01-01")]
post84 <- e_ex[reg_ex$date >= as.Date("1984-01-01")]
c(sd_pre = sd(pre84), sd_post = sd(post84))
  sd_pre  sd_post 
4.157259 2.378064 
var.test(pre84, post84)

    F test to compare two variances

data:  pre84 and post84
F = 3.0561, num df = 98, denom df = 159, p-value = 3.603e-10
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
 2.153513 4.404136
sample estimates:
ratio of variances 
          3.056095 

The residual standard deviation is 4.16 before 1984 and 2.38 after, a variance ratio of 3.1, and an \(F\) test rejects equality with \(p \approx 4 \times 10^{-10}\). The Goldfeld-Quandt test, which orders the observations by date, rejects as well, and its statistic of 0.40, below one, points the same way: the variance falls over the sample rather than rising. This is the Great Moderation, and it means the model’s uncertainty is badly mis-stated: a single \(SER\) of 3.21 overstates forecast uncertainty for the recent period and understates it for the 1970s. Any interval or density forecast built from the pooled \(SER\) would be wrong in both halves of the sample.

Because the errors are both serially correlated and heteroskedastic, the OLS standard errors are not consistent. HAC standard errors give a fairer reading of the evidence for predictability:

coeftest(fit_ex, vcov = NeweyWest(fit_ex, lag = 4, prewhite = FALSE))

t test of coefficients:

            Estimate Std. Error t value  Pr(>|t|)    
(Intercept)  2.46730    0.40438  6.1015 3.846e-09 ***
xlag1        0.37392    0.20385  1.8343   0.06776 .  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

The slope’s \(t\) statistic falls from 2.25 to 1.83, \(p = 0.068\). Whatever significance the naive regression appeared to show does not survive correcting the standard errors. Note the caveat from §3.5, Problem 6: HAC gives robust inference about predictor relevance, but it does not exploit the serial correlation to improve the point forecast. The lagged-\(y\) regression above does.

(v) Are the disturbances normal?

jarque.bera.test(reg$e)       # full sample

    Jarque Bera Test

data:  reg$e
X-squared = 6336.6, df = 2, p-value < 2.2e-16
jarque.bera.test(resid(fit_ex))  # excluding 2020

    Jarque Bera Test

data:  resid(fit_ex)
X-squared = 31.766, df = 2, p-value = 1.265e-07
bind_rows(
  tibble(sample = "full sample",    e = reg$e),
  tibble(sample = "excluding 2020", e = resid(fit_ex))
) |>
  mutate(sample = factor(sample, levels = c("full sample", "excluding 2020"))) |>
  ggplot(aes(sample = e)) +
  stat_qq(colour = smu_blue, alpha = 0.7) +
  stat_qq_line(colour = smu_red) +
  facet_wrap(~ sample, scales = "free_y") +
  labs(x = "theoretical quantile", y = "sample quantile",
       title = "Normal QQ plots of the residuals")

No. On the full sample the Jarque-Bera statistic is about 6337, which is not a borderline rejection but an annihilation, driven entirely by the two COVID observations. Dropping them reduces it to about 32, still rejecting at any conventional level with \(p \approx 10^{-7}\). The residual skewness is about \(-0.22\) and the kurtosis about 4.6 against the Gaussian value of 3, so the culprit is fat tails rather than asymmetry: macroeconomic data produce more large surprises than a normal distribution allows.

What follows from this is narrower than students often think. Non-normality does not bias \(\hat{\beta}\), and with \(n = 259\) the central limit theorem makes the \(t\) statistics approximately valid regardless. What it does damage is interval and density forecasting. A 95% interval computed as \(\hat{y} \pm 1.96\,SER\) assumes Gaussian disturbances, and with kurtosis of 4.6 such an interval will be too narrow in the tails: extreme outcomes will fall outside it more often than 5% of the time. If interval or density forecasts are the deliverable, use the simulation-based or non-parametric approach of §4.1.5, resampling the actual residuals rather than drawing from a normal.

(vi) Is the model structurally stable?

This turns out to be the most damaging finding of all. There are three standard ways to look, and they agree.

A Chow test at a break date suggested by the data’s history. The Great Moderation is conventionally dated to the early 1980s, so test at 1984Q1.

k <- which(reg_ex$quarter == "1984 Q1")
sctest(y ~ xlag1, data = reg_ex, type = "Chow", point = k)

    Chow test

data:  y ~ xlag1
F = 10.254, p-value = 5.21e-05

A test that does not require choosing the break date in advance, which matters because picking a break date after looking at the data invalidates the nominal size of the Chow test:

sctest(y ~ xlag1, data = reg_ex, type = "supF", from = 0.15)

    supF test

data:  y ~ xlag1
sup.F = 25.445, p-value = 9.299e-05

Recursive residuals (CUSUM), which show where the instability is rather than only that it exists:

rec <- efp(y ~ xlag1, data = reg_ex, type = "Rec-CUSUM")
sctest(rec)

    Recursive CUSUM test

data:  rec
S = 1.6093, p-value = 6.135e-05
plot(rec)

All three reject decisively: the Chow test gives \(F = 10.3\) with \(p \approx 5 \times 10^{-5}\), the supF test \(p \approx 9 \times 10^{-5}\), and the recursive CUSUM \(p \approx 6 \times 10^{-5}\). Splitting the sample shows what the instability consists of:

pre  <- reg_ex |> filter(date <  as.Date("1984-01-01"))
post <- reg_ex |> filter(date >= as.Date("1984-01-01"))

coef(summary(lm(y ~ xlag1, data = pre)))
            Estimate Std. Error  t value     Pr(>|t|)
(Intercept) 2.216818  0.5437980 4.076547 9.362574e-05
xlag1       1.277666  0.3716421 3.437894 8.651944e-04
coef(summary(lm(y ~ xlag1, data = post)))
              Estimate Std. Error  t value     Pr(>|t|)
(Intercept) 2.55687659  0.3324498 7.691016 1.468790e-12
xlag1       0.09837582  0.1591765 0.618030 5.374454e-01
c(n_pre = nrow(pre), n_post = nrow(post),
  sd_y_pre = sd(pre$y), sd_y_post = sd(post$y))
     n_pre     n_post   sd_y_pre  sd_y_post 
 99.000000 160.000000   4.274876   2.358675 

Before 1984 the slope is 1.28 with \(t = 3.44\), a large and clearly significant predictive relationship. After 1984 it is 0.098 with \(t = 0.62\) and an \(R^2\) of 0.002: the one-quarter-ahead predictive content of the term spread has essentially vanished. A rolling window makes the decay visible:

w <- 60  # 15-year window
roll <- map(seq_len(nrow(reg_ex) - w + 1), function(i) {
  s <- reg_ex[i:(i + w - 1), ]
  f <- lm(y ~ xlag1, data = s)
  tibble(end = s$date[w], slope = coef(f)[2], se = sqrt(diag(vcov(f)))[2])
}) |> list_rbind()

ggplot(roll, aes(end, slope)) +
  geom_ribbon(aes(ymin = slope - 1.96 * se, ymax = slope + 1.96 * se),
              fill = smu_blue, alpha = 0.18) +
  geom_line(colour = smu_blue, linewidth = 0.9) +
  geom_hline(yintercept = 0, colour = smu_red, linetype = "dashed") +
  labs(x = "end of 15-year rolling window", y = "slope on XLAG1",
       title = "The predictive slope is not stable")

The rolling slope runs from about 2.1 in the windows ending in the early 1980s down to values indistinguishable from zero, and occasionally negative, in the windows ending in the 2000s and 2010s.

Several stories are consistent with this: the change in monetary policy regime after 1979, the compression of term premia in the low-inflation era, the zero lower bound and quantitative easing distorting the long end of the curve after 2008, and the ordinary attrition of a publicly known predictor. For forecasting purposes the diagnosis matters less than the fact. A relationship that has been absent for forty years is not a basis for a forecast, however strong it was in the first half of the sample. Structural change, not the small \(R^2\), is the fatal problem with this regression.

(e) What would you actually forecast with?

Not with this regression as it stands. Three changes, in order of importance.

  1. Re-estimate on the post-1984 sample only, and then admit what it shows. Estimating on 1959 to 2024 averages two regimes that the data say are different, and the pooled slope is a weighted average of a relationship that used to exist and one that does not. On the post-1984 sample the spread at a one-quarter lag adds nothing, and an honest forecaster reports that rather than leaning on the full-sample coefficient.

  2. Add the recent history of \(y\). The serial correlation in (d)(iii) is a statement that the model is leaving forecastable structure in its errors. Adding \(y_{t-1}\) raises \(R^2\) five-fold and is the single largest improvement available here. That points toward the autoregressive models of the second half of the course, and it is a reminder that a univariate model is the benchmark a multivariate one has to beat.

  3. Lengthen the horizon. The term spread is a leading indicator at business-cycle frequencies, not at one quarter. Its predictive content shows up several quarters out:

reg4 <- dat |>
  mutate(y = gdp_growth, xlag4 = lag(spread, 4)) |>
  filter(!is.na(xlag4), !quarter %in% c("2020 Q2", "2020 Q3"))

coef(summary(lm(y ~ xlag4, data = reg4)))
             Estimate Std. Error  t value     Pr(>|t|)
(Intercept) 2.1748879  0.3170253 6.860298 5.219518e-11
xlag4       0.5610855  0.1684203 3.331460 9.923953e-04
summary(lm(y ~ xlag4, data = reg4))$r.squared
[1] 0.04186603

At a four-quarter lag the slope is 0.56 with \(t = 3.3\) and \(R^2 = 0.042\), more than twice the fit at one quarter. §2.4 warned that the best model changes with the horizon; here is a clean example.

Two further points of practice. First, decide in advance how to handle the COVID observations and say so: dropping them, or equivalently including dummies for 2020Q2 and 2020Q3, is defensible, and leaving them in unremarked is not, because they silently disable every residual diagnostic. Second, none of the evidence above is out-of-sample. The whole exercise has been in-sample fitting and in-sample diagnostics, and §3.4.10 is explicit that in-sample fit is at best an estimate of what we actually care about. Before anyone forecasts with this model it should be evaluated on a genuine out-of-sample period against the simplest possible benchmark, the sample mean of \(y\). Given an \(R^2\) of 1.4% and a slope that is unstable across regimes, the benchmark is the way to bet.