Module 13: Forecast Uncertainty, Predictive Information, and Error Correction
Applied Time Series Econometrics Β· Econ 6376
How to use these notes
Imagine writing a quarterly unemployment forecast. Your colleague asks which shocks make the forecast uncertain. Another asks whether wage growth helps predict unemployment. A third asks whether your model throws away useful information when you difference the series. Each question calls for a different exhibit. By the end of the chapter you should be able to choose the exhibit, read it, and explain the assumptions behind your answer.
The six Core sections are the reading path for everyone. Practice reading the supplied tables, naming the null in words, choosing a model, and predicting the direction of adjustment. The Deeper Dives and Technical Note develop the matrix algebra and test statistics. Each code panel opens to show the R that produced the exhibit. For a local rerun, start in the course folder or its notes subfolder with vars, urca, ggplot2, lmtest and knitr installed. The course supplies the two Granger test helpers, the cointegration helpers, and the consumption and income data. Run the chunks in order.
13.1 Whose shocks make the forecast uncertain? β Core
Stand at the end of quarter and make a forecast of for next quarter. Tomorrowβs surprises can make that forecast miss. Now forecast four quarters ahead from the same date. A surprise next quarter can propagate for three more quarters. A surprise in the fourth quarter can affect immediately. Your four-quarter miss contains the effects of all four sets of future surprises.
The forecast error variance decomposition (FEVD) gives the share of the forecast-error variance of a particular outcome, at a particular horizon, attributable to each shock under a specified identification. It describes the uncertainty you face when making the forecast. Explaining one unusually large miss after it happens is a different exercise that also requires the realized shocks.
From one response to one variance share
Return to the two-equation system in Modules 11β12. Two shocks arrive each period, each with mean zero and variance one. They are uncorrelated with one another and across dates. In the generating system a one-standard-deviation shock raises on impact by . An equally standardized shock raises by . The first shock enters the forecast error with twice the weight. How much more variance does it contribute?
Variance scales with the square of the weight. The shock contributes and the shock contributes . Uncorrelated contributions add to squared units of . The shock therefore accounts for , or 20%, of the one-quarter uncertainty. A negative impact of the same magnitude would give the same share. Read the signed impulse response function (IRF) when the direction matters.
At four quarters use the impact response, the one-quarter response, the two-quarter response, and the three-quarter response. Each belongs to an innovation arriving on a different date. Square each weight, add within each shock, and divide by the total across shocks. That logic extends Module 6βs calculation of a forecast-error variance from the weights on future innovations.
Show R code
B <-matrix(c(1, -.5, -.25, 1), 2, byrow =TRUE)structural_lags <-matrix(c(.3, 0, .1, .4), 2, byrow =TRUE)A1 <-solve(B, structural_lags)C_true <-solve(B) # structural shock variances are oneSigma <-tcrossprod(C_true)C_yfirst <-t(chol(Sigma))account_for_y <-function(impact, horizons =8L) { response <- impact contributions <-c(y =0, x =0) result <-matrix(NA_real_, horizons, 4,dimnames =list(NULL, c("IRF_x", "Total", "Share_y", "Share_x")))for (h inseq_len(horizons)) { contributions <- contributions + response[1, ]^2 total <-sum(contributions) result[h, ] <-c(response[1, 2], total, contributions / total) response <- A1 %*% response }as.data.frame(result)}truth <-account_for_y(C_true)recursive <-account_for_y(C_yfirst)h <-c(1L, 4L)stopifnot(isTRUE(all.equal(truth$Total, recursive$Total)),abs(truth$Share_x[1] - .2) <1e-12, recursive$Share_x[1] ==0)knitr::kable(data.frame(Quarters = h, Variance = truth$Total[h],"Generating x shock (%)"=100* truth$Share_x[h],"Second shock, y first (%)"=100* recursive$Share_x[h],check.names =FALSE), digits =c(0, 5, 2, 2),caption ="Population forecast-error variance of y and its allocation under two identifications.")
Population forecast-error variance of y and its allocation under two identifications.
Quarters
Variance
Generating x shock (%)
Second shock, y first (%)
1
1.63265
20.00
0.0
4
2.42931
30.21
3.6
Under the generating structure, the shockβs share grows from 20.00% to 30.21%. Its lagged propagation matters for the longer forecast. Now read across the table. The alternative identification orders first and assumes its within-quarter response to the second shock is zero. That restriction makes the second shockβs one-quarter share zero by construction. The same shock in this recursive model can reach through lagged adjustment, giving it 3.60% at four quarters. The recursive second shock and the generating disturbance are two different definitions of a shock.
On the course mixing board, FEVD reads the dynamics and shocks already present in the VAR. Both analysts use identical reduced dynamics and innovation covariance. They agree on total variance, and hence on the magnitude of forecast uncertainty, at each horizon. How they assign that variance depends on the contemporaneous restrictions. The simulator knows which shocks generated the observations. An analyst working with economic data must defend the identification.
Show R code
shapes <-rbind(data.frame(time =0:7, value = truth$IRF_x,panel ="IRF (y units above baseline)"),data.frame(time =1:8, value =100* truth$Share_x,panel ="FEVD (percent of error variance)"))shapes$panel <-factor(shapes$panel, levels =unique(shapes$panel))ggplot(shapes, aes(time, value)) +geom_line(colour ="#176b72", linewidth = .9) +geom_point(colour ="#176b72", size =2) +facet_wrap(~panel, scales ="free", ncol =1) +scale_x_continuous(breaks =0:8) +labs(x ="Quarters", y =NULL)
FigureΒ 1: In the generating system the response to one x shock declines after impact, while the shockβs share of forecast uncertainty grows across these horizons. The axes use different units and start at different horizons.
13.2 Read a Canadian unemployment FEVD β Core
A Canadian labor-market analyst forecasts the quarterly change in the unemployment rate. What should go in the forecast briefing at one quarter and one year? The Canada data contain 84 quarterly observations from 1980Q1 through 2000Q4. The stored employment (e), productivity (prod), and real manufacturing wage (rw) series already use 100 times a log. Their first differences measure log-point growth and approximate quarterly percentage changes. U is a rate in percent. Its first difference is a percentage-point change. Our four-quarter target is the change in the fourth quarter, forecast today. Canadian data definitions
Start with the archived two-lag VAR in these four changes and an intercept. All four change series reject an individual unit root at 5% in an ADF check with an intercept and two lagged differences. The fitted systemβs largest companion eigenvalue modulus is 0.68, below one. These checks support treating the transformed dynamics as stable. They do not establish that every level needed differencing. Differencing an already stationary level can discard useful information, as can omitting a stationary combination of wandering levels. Section 13.4 takes up the latter possibility.
Show R code
data("Canada", package ="vars")changes <-diff(Canada)fit_ca <-VAR(changes, p =2, type ="const")adf_changes <-apply(changes, 2, function(z) { test <-ur.df(z, type ="drift", lags =2)c(statistic = test@teststat[1], critical_5 = test@cval[1, "5pct"])})criteria <-VARselect(changes, lag.max =4, type ="const")$selectionpt_ca <-serial.test(fit_ca, lags.pt =8, type ="PT.adjusted")$serialknitr::kable(t(adf_changes), digits =2,caption ="Individual ADF checks on quarterly changes. Reject when the statistic is more negative than its critical value.")
Individual ADF checks on quarterly changes. Reject when the statistic is more negative than its critical value.
statistic
critical_5
e
-4.11
-2.89
prod
-3.99
-2.89
rw
-3.64
-2.89
U
-3.79
-2.89
The Akaike criterion chooses two lags when comparing one through four on common rows. The Schwarz and HannanβQuinn criteria choose one. We retain the historical two-lag specification and check its residual dynamics. A system-wide adjusted portmanteau test through eight quarters gives . It detects little joint evidence of remaining serial dependence. Section 13.3 checks the particular forecasting equations as well.
Read the target first, then the horizon and shocks
Order the changes as employment, productivity, real wage, unemployment. This recursive scheme lets unemployment respond within a quarter to innovations in all three other series. Employment, first, cannot respond on impact to later innovations. This is a working timing assumption. Quarterly aggregation makes a different timing assumption plausible. The code selects $U because unemployment change is the target. Every column describes a shock. fevd() returns fractions, which we multiply by 100 for display.
Show R code
hh <-c(1L, 4L, 8L)share_ca <-fevd(fit_ca, n.ahead =max(hh))$U# Psi includes impact in its first slice. Sum the squared responses of U.variance_of_U <-function(fit, horizons) { response <-Psi(fit, nstep =max(horizons) -1L) i <-match("U", colnames(fit$y))vapply(horizons, function(h) sum(response[i, , seq_len(h)]^2), numeric(1))}total_ca <-variance_of_U(fit_ca, hh)knitr::kable(data.frame(Quarters = hh, Variance = total_ca,round(100* share_ca[hh, ], 1), check.names =FALSE),digits =c(0, 4, 1, 1, 1, 1),caption ="Forecast-error variance of quarterly unemployment-rate change (squared percentage points) and percent shares of each recursive shock. Column order is the identifying order.")
Forecast-error variance of quarterly unemployment-rate change (squared percentage points) and percent shares of each recursive shock. Column order is the identifying order.
Quarters
Variance
e
prod
rw
U
1
0.0862
46.2
0.2
4.1
49.4
4
0.1805
50.2
12.2
11.6
26.0
8
0.2095
46.8
14.4
15.5
23.3
At one quarter, unemploymentβs own shock accounts for 49.4% of total variance and employmentβs shock for 46.2%. At four quarters, the employment component is 50.2%, while the own component is 26.0%. The total variance rises from 0.0862 to 0.1805 squared percentage points. A falling share can accompany a rising variance contribution. Here the own contribution goes from about 0.0425 to 0.0469 squared percentage points. Use both the total and the share to support a claim about the size of a risk.
Put unemployment first and keep the other variablesβ relative order, lag choice, and estimation rows fixed. What should its one-quarter own share be before you run the code?
Show R code
u_first <-c("U", "e", "prod", "rw")other_fit <-VAR(changes[, u_first], p =2, type ="const")other_share <-fevd(other_fit, n.ahead =max(hh))$Ustopifnot(max(abs(total_ca -variance_of_U(other_fit, hh))) <1e-10,max(abs(rowSums(share_ca) -1)) <1e-10,max(abs(rowSums(other_share) -1)) <1e-10)knitr::kable(data.frame(Quarters = hh,"Own share, U last (%)"=100* share_ca[hh, "U"],"Own share, U first (%)"=100* other_share[hh, "U"],check.names =FALSE), digits =c(0, 1, 1),caption ="Same Canadian target and fitted reduced dynamics, two recursive definitions of the unemployment shock.")
Same Canadian target and fitted reduced dynamics, two recursive definitions of the unemployment shock.
Quarters
Own share, U last (%)
Own share, U first (%)
1
49.4
100.0
4
26.0
63.9
8
23.3
55.6
Under the second ordering, unemploymentβs own share is 100% at one quarter and 63.9% at four. The original four-quarter estimate of 26.0% is conditional on letting the three other surprises reach unemployment within the quarter. A forecast briefing could report both allocations and explain which timing assumption the economist finds more credible. A high share does not tell us which forecasting model wins on held-out data. It also gives no sign for the effect of the shock on unemployment. R documentation for FEVD
13.3 Does another seriesβ history help predict the target? β Core
Suppose a forecaster knows the histories of unemployment changes, employment growth, and productivity growth. Would adding real-wage growth from the previous two quarters improve the modelβs one-step prediction of the unemployment-rate change? This time the extra information is already available when the forecast is made. In the FEVD we were allocating the variance generated by future shocks. A wage series can supply useful lagged information even if the forecast is relatively insensitive to the shock labeled βwageβ under a particular ordering.
In a linear VAR, the Granger noncausality null for this direction says that both coefficients on lagged wage growth in the unemployment-change equation equal zero, conditional on the retained histories. Fit the full equation, then fit the equation with both wage lags removed. Keep the same sample, intercept, and other lags. The full equation fits at least as well in sample because it has more freedom. The joint test asks whether the gain is large relative to the sampling variation under the null. Reverse the equation and the excluded lags to test the other direction. The two decisions can differ.
Why a predictive lag can appear
In the Module 11 generating model, yesterdayβs had a direct coefficient of zero in todayβs structural equation. But yesterdayβs helps predict todayβs , and todayβs enters todayβs . After solving the two simultaneous equations, the reduced equation has an -lag coefficient of . The forecast uses yesterdayβs information and incorporates the indirect route through the rest of the system. Establishing which intervention moves requires economic identification beyond that predictive fact.
Test both directions in the Canadian system
Read the table at 5%. The first row asks whether wage history adds information for unemployment change. The second asks whether the history of unemployment changes adds information for wage growth. The last column checks the residuals of that rowβs full equation. It is a separate diagnostic with a separate null.
Show R code
direction_test <-function(target, predictor) { rows <-model.frame(fit_ca$varresult[[target]]) rows$const <-NULL# lm supplies the same intercept full <-lm(y ~ ., data = rows) remove <-paste0(predictor, ".l", 1:fit_ca$p) keep <-setdiff(names(rows), c("y", remove)) reduced <-lm(reformulate(keep, response ="y"), data = rows) joint <-granger_nested_test(reduced, full) bg <-granger_bg_test(full, order =4)data.frame(F = joint$F, df1 = joint$q, df2 = joint$df2,test_p = joint$p_value, BG_p = bg$p_value)}directions <-rbind("Wage growth to unemployment change"=direction_test("U", "rw"),"Unemployment change to wage growth"=direction_test("rw", "U"))knitr::kable(directions, digits =c(3, 0, 0, 4, 4),col.names =c("F", "df1", "df2", "Lag-test p", "BG(4) p"),caption ="Equation-specific lag tests on the same 81 estimation rows. BG checks for remaining serial dependence through four quarters.")
Equation-specific lag tests on the same 81 estimation rows. BG checks for remaining serial dependence through four quarters.
F
df1
df2
Lag-test p
BG(4) p
Wage growth to unemployment change
6.242
2
72
0.0032
0.065
Unemployment change to wage growth
0.648
2
72
0.5260
0.013
For wage growth predicting unemployment change, and . The nominal test rejects joint exclusion. For unemployment change predicting wage growth, and . The reverse test supplies little evidence against its null. Both comparisons retain the targetβs own lags and the lags of employment and productivity. Neither requires assigning contemporaneous shocks, so permuting the same reduced system for FEVD leaves these directional tests unchanged.
Would you trust the forecast briefing? The courseβs BreuschβGodfrey (BG) diagnostic drops the first four auxiliary observations so every residual lag is observed. For the wage equation it rejects at 5% (). For unemployment it gives , close enough to examine sensitivity. The common alternative of initializing missing residual lags at zero gives for that equation. A joint portmanteau test across four equations can miss dependence picked up by a targeted diagnostic. The forward test is evidence of predictive content under this specification, with enough residual-dynamics uncertainty to warrant revisiting the model. The reverse nonrejection comes from an equation that fails the targeted check. A genuine forecasting-performance claim would require evaluation on forecasts made outside the estimation sample.
Show R code
rows_U <-model.frame(fit_ca$varresult$U)rows_U$const <-NULLzero_fill <- lmtest::bgtest(lm(y ~ ., data = rows_U), order =4, fill =0)stopifnot(zero_fill$p.value < .05)
Which R test? In this four-variable system, vars::causality(fit_ca, cause = "rw")$Granger tests the wage lag block across all three remaining equations. Our question names unemployment alone, so we tested only that equation. The separately labeled instantaneous-causality output concerns contemporaneous innovation covariance. R documentation for causality tests
13.4 How many stable relationships link the levels? β Core
Return to Harry and his dog Mouse. Both wander down the street. If yesterdayβs separation tends to call them back toward each other, the separation can be stationary while both locations wander. Add Karen on her own walk. We have three wandering series, one stable gap, and two independent sources of permanent wandering. Twice the HarryβMouse gap also stays stationary, but it gives the same information. The cointegration rank counts linearly independent stationary combinations of the levels.
There are two practical ways to investigate a proposed long-run relation.
EngleβGranger. For a pair plausibly integrated of order one, estimate a normalized levels relation, for example log consumption on a constant and log disposable income. Plot the fitted gap and test it for a unit root. The null is no cointegration. A sufficiently negative residual-ADF statistic supports a stationary gap. Because the gap was estimated from the data, compare with the appropriate cointegration critical value. Ordinary ADF critical values for an observed series give the wrong calibration here.
Johansen. Specify a dynamic system in levels and ask how many independent stationary combinations it supports. The trace test starts at a proposed rank of zero. If the statistic exceeds its matching critical value, reject that rank bound and try the next. Stop at the first nonrejection. Start with the row labeled even if the software prints it at the bottom. The sample, integration orders, lag order, and placement of constants or trends are part of the question.
For a regular, nonexplosive system with at most I(1) stochastic components, the decision has an immediate use.
Evidence under the stated specification
Candidate forecasting model
Rank zero and credible I(1) components
A VAR in changes. Lagged changes can predict other changes.
Positive rank below the number of variables
A VECM. Preserve the stationary gaps as predictors of future changes.
Full rank
Reconsider the individual unit-root diagnoses. A stationary levels VAR around the specified deterministic terms is a candidate.
Read a rank table when the truth is known
Use the same 240 retained observations and seed as Module 10. The two walkers each close one tenth of yesterdayβs gap on average. The simulation adds the correction, plus a new independent step, to yesterdayβs position in an R loop. Karenβs steps are independent of both. For this rank test keep just Mouse and Harry. Allow a constant in the equilibrium relation and no separate drift. The generator has one levels lag. ca.jo() requires at least two, so the fitted system includes a lagged change whose population coefficient is zero. Its K argument counts levels lags.
Show R code
set.seed(637610)steps <-matrix(rnorm(3*1240), ncol =3)walk <-walkers(steps, adjust_h = .1, adjust_m = .1, burn =1000)MH <-as.matrix(walk[, c("Mouse", "Harry")])jo_walk <-ca.jo(MH, type ="trace", ecdet ="const",K =2, spec ="transitory")trace_table <-function(fit) { k <-length(fit@teststat)data.frame(Rank_bound =0:(k -1L),Trace =rev(unname(fit@teststat)),Critical_5 =rev(unname(fit@cval[, "5pct"])))}walk_rank <-trace_table(jo_walk)knitr::kable(walk_rank, digits =c(0, 2, 2),caption ="Simulated Mouse and Harry, trace test in decision order. Each null bounds the rank from above.")
Simulated Mouse and Harry, trace test in decision order. Each null bounds the rank from above.
Rank_bound
Trace
Critical_5
0
34.16
19.96
1
5.73
9.24
First compare 34.16 with 19.96. Reject no stable relation. Next compare 5.73 with 9.24. Retain βat most one.β Taken together, the tests select one relation at 5%. We can check that sample decision against a truth known from the code. With real economic data we get only the evidence.
Reopen the consumptionβincome case
We have 203 U.S. quarterly observations, 1959Q1β2009Q3. Both series are natural logs of real aggregate dollar amounts. In Module 10 individual ADF checks failed to reject a unit root in each log level and rejected in the differences. That makes I(1) a working model. For the intercept-only bivariate EngleβGranger regression with four lagged residual differences, the statistic is β2.589, against β3.367 at 5%. We fail to reject no cointegration. Using zero lagged residual differences produced a narrow rejection and left residual dependence. Data definitions and vintage
For the system test, use four levels lags as a fixed quarterly baseline, giving three lags of changes. Both log series grow over this long historical span. Allow an unrestricted constant in the change equations so levels can have drift. In urca::ca.jo() this case uses ecdet = "none", meaning no separately restricted intercept in the cointegrating term. The change-equation intercept can capture a component in the adjustment direction as well as drift in the common trend. For sensitivity, also report two and six levels lags under the same deterministic case and one four-lag fit that restricts the constant to the equilibrium relation. That restriction rules out drift in the common stochastic trend. The comparison tests how much the conclusion depends on that substantive assumption.
Show R code
ci <-read.csv(file.path(course_dir, "data", "module_10_consumption_income.csv"))ci_levels <-cbind(log_C =log(ci$realcons), log_Y =log(ci$realdpi))eg_ci <-eg_test(ci_levels[, "log_C"], ci_levels[, "log_Y"], p_adf =4)specs <-data.frame(p =c(4L, 2L, 6L, 4L),det =c("none", "none", "none", "const"))trace_pair <-function(p, det) { fit <-ca.jo(ci_levels, type ="trace", K = p, ecdet = det,spec ="transitory") tab <-trace_table(fit) stop_row <-which(tab$Trace <= tab$Critical_5) rank <-if (length(stop_row)) tab$Rank_bound[stop_row[1]] elsenrow(tab)c(tab$Trace[1], tab$Critical_5[1], tab$Trace[2], tab$Critical_5[2], rank)}results <-t(mapply(trace_pair, specs$p, specs$det))colnames(results) <-c("Trace 0", "CV 0", "Trace at most 1", "CV at most 1", "Rank")knitr::kable(data.frame(Constant =c("Unrestricted", "Unrestricted", "Unrestricted", "Restricted"),p = specs$p, results, check.names =FALSE), digits =c(0, 0, 2, 2, 2, 2, 0),caption ="Consumption and income. The first row is the baseline. Both rank statistics are shown for comparison. Stop inference at the first nonrejection.")
Consumption and income. The first row is the baseline. Both rank statistics are shown for comparison. Stop inference at the first nonrejection.
Constant
p
Trace 0
CV 0
Trace at most 1
CV at most 1
Rank
Unrestricted
4
15.14
17.95
3.58
8.18
0
Unrestricted
2
12.24
17.95
3.55
8.18
0
Unrestricted
6
16.86
17.95
3.90
8.18
0
Restricted
4
36.85
19.96
8.18
9.24
1
Show R code
rank0_ci <-VAR(diff(ci_levels), p =3, type ="const")pt_ci <-serial.test(rank0_ci, lags.pt =12, type ="PT.adjusted")$serial
The baseline trace statistic 15.14 falls below 17.95, so we stop at rank zero. Two and six levels lags give the same rank decision when drift is allowed. The fitted rank-zero model in changes has an adjusted residual portmanteau through twelve quarters. The baseline EngleβGranger and Johansen analyses both leave insufficient evidence for a stable consumptionβincome gap. They reach that conclusion through different models and reference distributions.
Now compare the last row with the first. Restricting the constant changes the answer to rank one at 5% because the zero-rank statistic exceeds 19.96 and the next statistic falls below 9.24. This specification gives the persistent growth in these log levels a different interpretation. Report the sensitivity, the economic argument for allowing drift, and the resulting uncertainty. For the baseline a changes model is a defensible starting point. This sample does not settle whether consumption and income share a stable relation in other periods or under another specification. Johansen procedure and deterministic cases
13.5 Who adjusts when the gap opens? β Core
A vector error correction model writes an equation for the change in each variable. The predictors are lagged changes and one or more lagged deviations from long-run relationships. Yesterdayβs gap is known when we make todayβs forecast. A variableβs coefficient on the gap is its adjustment loading. Here is the population model used to generate the two walkers, with the gap oriented as Mouse minus Harry:
Give the gap a sign before reading a loading. If Mouse is two units ahead, her expected next change is and Harryβs is . The expected separation shrinks by . Their new shocks can still push them apart on a particular day. If you instead define the gap as Harry minus Mouse, both loadings reverse signs and both predictions stay the same. The weights defining the relationship tell you how to measure the gap. The loadings tell you who moves in response.
What differencing alone would discard
Imagine two histories with identical recent changes. In one, Mouse and Harry are together. In the other, Mouse is two units ahead. A VAR that uses only those recent changes as predictors gives the same forecast of changes in the two histories. The VECM above gives zero expected movement in the first history and opposite movements in the second. A levels forecast from a changes model still starts from the observed level. What that model omits is the dependence of future changes on the starting gap.
Now switch off Harryβs response. Mouse still closes one tenth of the separation per period. Starting from the same two-unit gap, the expected separation after four periods is about 1.31 units, compared with 0.82 when both respond. One participantβs adjustment is enough to stabilize the gap here. Switching off both responses would let the gap wander as each receives independent steps.
Show R code
gap_h <-0:8gaps <-rbind(data.frame(h = gap_h, gap =2* .8^gap_h, case ="Both respond"),data.frame(h = gap_h, gap =2* .9^gap_h, case ="Only Mouse responds"))ggplot(gaps, aes(h, gap, colour = case, linetype = case)) +geom_line(linewidth = .95) +geom_point(size =1.8) +scale_colour_manual(values =c("#176b72", "#994518")) +scale_x_continuous(breaks = gap_h) +expand_limits(y =0) +labs(x ="Periods ahead", y ="Expected gap (location units)",colour =NULL, linetype =NULL) +theme(legend.position ="bottom")
FigureΒ 2: Conditional mean separation from the same starting gap under two sets of adjustment coefficients. Both scenarios use the same zero expected future innovations.
Closing the gap allows both levels to keep moving. Add the same unit to both starting locations and keep the same future steps. Every future location shifts up by one, and the future separation follows exactly the old path. Thus a common displacement can be permanent even when deviations from the relationship are temporary.
Estimate the relation and use it to forecast
The system trace test selected rank one for the walkers. Fit that rank and normalize the coefficient on Mouse to one. The estimated gap is . The loadings below give the contribution of one positive unit of this estimated gap to the next change holding the lagged changes fixed.
Show R code
walk_vecm <-cajorls(jo_walk, r =1)gap_weights <-drop(walk_vecm$beta)loadings <-coef(walk_vecm$rlm)["ect1", ]knitr::kable(data.frame(Equation =c("Change in Mouse", "Change in Harry"),Generating =c(-.10, .10), Estimated =as.numeric(loadings)),digits =3, caption ="Adjustment coefficients for a gap normalized on Mouse.")
Adjustment coefficients for a gap normalized on Mouse.
Equation
Generating
Estimated
Change in Mouse
-0.1
-0.153
Change in Harry
0.1
0.072
Mouseβs fitted change falls by about 0.153 units and Harryβs rises by about 0.072 units per positive gap unit. The population weights and loadings used to simulate the data differ from these finite-sample estimates. In Module 10 the conditional scalar equation could also include current . Here each equation forecasts with information available one period earlier. Current movements in the other variable are part of the joint outcome to forecast.
Predict the walkersβ locations from the last observed positions. vec2var() expresses the fitted rank-one system in levels, preserving the estimated long-run restriction. The forecast of the fitted gap is the same linear combination of the two level forecasts and the fitted constant. Row zero records the observed starting point.
Show R code
walk_levels <-vec2var(jo_walk, r =1)paths <-predict(walk_levels, n.ahead =4)$fcstloc <-rbind(tail(MH, 1), cbind(Mouse = paths$Mouse[, "fcst"],Harry = paths$Harry[, "fcst"]))gap_path <-drop(cbind(loc, 1) %*% gap_weights)knitr::kable(data.frame(Period =c(0L, 1L, 4L), loc[c(1, 2, 5), , drop =FALSE],Fitted_gap = gap_path[c(1, 2, 5)]),row.names =FALSE, digits =3,caption ="Observed locations at the origin and rank-one VECM point forecasts. The last column evaluates the fitted equilibrium gap.")
Observed locations at the origin and rank-one VECM point forecasts. The last column evaluates the fitted equilibrium gap.
Period
Mouse
Harry
Fitted_gap
0
3.816
3.492
-0.396
1
3.861
3.441
-0.304
4
3.982
3.396
-0.140
The fitted gap starts at β0.396 and moves toward zero, reaching β0.140 at horizon four. The levels are free to move while that happens. Finite-horizon level IRFs and FEVDs remain meaningful for this system. Some level responses can persist and long-horizon forecast uncertainty can keep growing with the common stochastic trend. Shock attribution still needs an identification assumption.
Return to the Granger question
Where could Mouseβs history help predict Harry? A short-run route would enter through lagged changes in Mouseβs position. A second route runs through yesterdayβs level in the equilibrium gap. Our generating system has no lagged changes at all, yet increasing yesterdayβs Mouse location by one at fixed Harry location increases Harryβs expected next change by 0.10. Testing the lagged changes alone misses that route. When we turned off Harryβs loading, we closed his gap route. In that generating system there was no short-run route left. The general system test must account for both.
13.6 Choose the evidence and write the conclusion β Core
Read the question first. βDoes it matter?β might ask about a signed response, a share of risk, the information in a predictor, or a persistent relationship. Each requires different evidence.
An economist asks
Choose this exhibit
Include in your answer
Where is four quarters after one shock relative to its baseline?
Signed IRF at horizon four
Named shock, normalization, identification, direction and response units.
Which shocks account for uncertainty in the four-quarter forecast of ?
FEVD row for that target and horizon
Identification, share, total forecast-error variance when comparing magnitudes.
Does past wage growth help predict next quarterβs unemployment change?
Directional joint lag test in the unemployment equation
Excluded lags, retained histories, decision and residual diagnostic.
Can we justify preserving a consumptionβincome gap when forecasting?
Individual integration evidence and system rank table
Sample, lag and deterministic specification, selected rank and sensitivity.
When the fitted gap is positive, who tends to close it?
Normalized relation and one adjustment coefficient per equation
Gap sign, each loadingβs sign and units, other predictors held fixed.
Try these on paper.
An analyst says the shock accounts for 30.2% of the four-quarter variance in the generating example, so it raised in the fourth quarter of a particular year. Which additional exhibit would answer the direction question? What additional information would a historical attribution require?
In the Canadian briefing, how can two analysts report the same four-quarter total variance but own-shock shares of 26.0% and 63.9%? Explain one result that survives reordering.
A headline says that lowering real wages would reduce unemployment because wage lags help predict unemployment changes. Rewrite it as a defensible two-sentence report.
Read the first and last rows of the consumptionβincome rank table. Which model would you start with if drift is economically plausible? Which result deserves mention even if you choose that model?
Mouse is one unit behind Harry in the generating system. Give the predicted sign of each change, then explain whether the two locations must return to where they started.
A VECM has zero coefficients on all lagged changes of in the equation. Which remaining term must you inspect before concluding that βs history adds no one-step predictive information?
Check your reasoning
The IRF supplies a signed response to a specified shock. Attributing a historical realization also requires recovered, identified shocks over the relevant dates.
The factorization changes the innovations called βown.β The total variance stays about 0.1805 squared percentage points. The reduced-form lag test is also invariant to reordering the same model.
Given the other histories, the joint test rejects excluding the two wage lags from the unemployment-change equation (nominal ). Residual diagnostics qualify the inference and the model does not identify an intervention.
The drift-allowing specification supports a changes VAR as a starting point. Restricting the constant to the relation selects one gap, so the deterministic specification matters.
A gap of β1 adds +0.10 to Mouseβs next change and β0.10 to Harryβs. New shocks can shift both levels permanently while the separation stays stationary.
Check whether enters the lagged levels contribution to through the fitted equilibrium relationship and its loading.
Deeper Dive β Deriving the variance shares
Hold the model parameters fixed. At every date , assume and , where is the information available just before that date. Iterated expectations then give zero cross-date covariance conditional on for future innovations. Write the reduced innovations as , with standardized orthogonal shocks and . A stable levels VAR has reduced moving-average matrices , with . The identified standardized responses are . In the Module 11 generator , where the structural disturbances have diagonal covariance .
At forecast origin the observed history and deterministic forecast terms are known. Subtract the conditional forecast from . Only innovations dated after remain:
For , a shock arriving at carries weight and a new shock at carries weight . Cross-date covariances vanish. Within a date, orthogonality removes the cross-shock covariance terms. Consequently the forecast-error covariance and the share for shock in target are
The shares sum to one across the shocks for any target with positive variance at a fixed horizon. Holding and the reduced dynamics fixed leaves unchanged under another admissible factorization. A rotation can change individual columns of and their contributions. A correlated collection of raw reduced innovations need not yield this additive allocation.
The cumulative IRF sums signed weights for a single disturbance across response dates. Squaring that sum introduces cross-products, while the FEVD numerator sums squared weights for orthogonal surprises arriving on different dates. A shock scaled to one percentage point for a published IRF must be translated back to its stochastic variance scale before using the curve for a variance share. Plug-in FEVD tables hold estimates fixed. Sampling uncertainty about parameters and disagreement about identifying restrictions require additional analysis.
Deeper Dive β From levels lags to a VECM
Start from the reduced-form VAR() with intercept and subtract from each side. For , replace by . This gives Collecting terms for any gives Here gathers the deterministic terms under the chosen specification. The here are short-run reduced-form difference coefficients. Module 11 used a structural levels lag matrix in its simultaneous system. The VECM rearrangement itself is algebra. Cointegration is the restriction that has intermediate rank and that its long-run combinations are stationary under the maintained I(1) conditions.
At rank , write . The columns of span the cointegrating space. The rows of describe how each variable adjusts to its gaps. A constant restricted to the relationship enters with those same loadings. In the simple rank-one case, the gap could be as in Module 10. Its scalar loading becomes one rowβs loading in the system. The bold denotes loadings here and denotes an ordinary reduced-form intercept.
In the known system ordered Mouse, Harry, Karen, take and . Their product maps yesterdayβs locations into todayβs expected changes. Harryβs row, Mouseβs column equals , which makes the predictive channel visible. The rank is one, leaving common stochastic trends under the regular I(1) representation. With only Mouse and Harry, there is one gap and one common trend. Multiplying a rank-one gap by and its loadings by leaves their product intact. At higher rank, changes of basis within the cointegrating space give multiple equivalent representations.
Two estimates of the same walkersβ gap
EngleβGranger supplies a simple two-step route. First estimate Mouse on Harry with a constant and verify the fitted residual using cointegration critical values. Then place yesterdayβs fitted residual in both change equations beside the lagged changes. This lagged gap is constructed from the systemβs own history. Johansen estimates the equilibrium space using the joint dynamics. Compare the normalizations before reading the loadings side by side.
Show R code
eg_walk <-eg_test(walk$Mouse, walk$Harry, p_adf =4)dMH <-diff(MH)n_delta <-nrow(dMH)t_index <-2:n_deltalag_gap <- eg_walk$residuals[t_index]two_step <-lm(dMH[t_index, , drop =FALSE] ~0+ lag_gap + dMH[t_index -1L, , drop =FALSE])eg_levels <-coef(eg_walk$levels)methods <-data.frame(Method =c("Generating", "Engle-Granger", "Johansen"),"Harry weight"=c(-1, -unname(eg_levels["x"]), gap_weights[2]),"Gap constant"=c(0, -unname(eg_levels["(Intercept)"]), gap_weights[3]),"Mouse loading"=c(-.1, coef(two_step)["lag_gap", "Mouse"], loadings[1]),"Harry loading"=c(.1, coef(two_step)["lag_gap", "Harry"], loadings[2]),check.names =FALSE)knitr::kable(methods, digits =3, row.names =FALSE,caption ="Same simulated sample. Each gap has unit weight on Mouse and each change equation includes the same lagged changes.")
Same simulated sample. Each gap has unit weight on Mouse and each change equation includes the same lagged changes.
Method
Harry weight
Gap constant
Mouse loading
Harry loading
Generating
-1.000
0.000
-0.100
0.100
Engle-Granger
-0.563
-1.206
-0.162
0.039
Johansen
-0.934
-0.949
-0.153
0.072
The EngleβGranger residual statistic of β4.49 rejects no cointegration against the matching 5% critical value in this experiment. Its fitted long-run slope is about 0.563, compared with the Johansen estimate of 0.934 and the generating value of one. Finding evidence for a stable gap and estimating its weights precisely are separate accomplishments, especially with one finite realization of the common trend. Both fits imply that a positive gap slows Mouse and moves Harry forward, conditional on the lagged changes in that fit.
Technical Note β How the tests are constructed
Joint predictive exclusion
Write the predictorβs lag coefficients in the equation of a stationary VAR() as . Its history adds no one-step linear predictive content conditional on the retained histories under On common rows, let and be the restricted and unrestricted residual sums of squares, the number of restrictions, the number of estimation rows and the number of unrestricted coefficients including deterministic terms. The familiar statistic is The reference calculation uses . In a dynamic regression with lagged dependent variables, the justification is generally asymptotic under the relevant stability, innovation and variance assumptions. A larger system-wide claim can stack restrictions across several response equations using a Wald test and their joint covariance. Integrated levels can invalidate the routine reference distribution. Remaining innovation dependence, heteroskedasticity, misspecified lag dynamics, and specification searches can also affect nominal inference.
In a correctly specified VECM written with the gap at , full one-step exclusion of from the equation requires These are restrictions on the levels and lagged-change channels. When , . A restriction on the whole loading row of asks whether adjusts to any gap. A restriction on asks about the contribution of one named variable through the long-run space. The two questions can give different answers. Inference on long-run restrictions must respect estimation of the rank and cointegrating space.
Residual testing and Johansen statistics
With an intercept-only bivariate levels regression, define . The residual-ADF regression is There is no extra intercept in this residual regression. Under no cointegration the fitted gap has a unit root. The test uses the -ratio for against a residual-based cointegration reference value that matches the number of variables and deterministic case. The course helper uses the bivariate, intercept-only, 5% MacKinnon calibration. The lag controls dependence in this auxiliary regression. It counts a different object from a Johansen levels lag order.
For Johansen, remove the allowed short-run dynamics and corresponding deterministic terms from the changes and lagged levels, with any restricted deterministic term included on the long-run side. The procedure measures how well combinations of lagged levels predict combinations of changes beyond those controls. Let be the ordered squared partial canonical correlations for the stochastic rank problem, using the appropriate deterministic specification. These are distinct from the companion roots used for stability checks. With usable dynamic observations, the two statistics are The trace statistic tests rank at most against a higher rank. The maximum-eigenvalue statistic compares rank with rank . Each requires its own nonstandard critical values for the deterministic case. Larger statistics are evidence against the stated rank null. Rank selection is sensitive to small samples, breaks, lags, and drift. Economic knowledge can inform those choices before inspecting the results.
In ca.jo(), spec = "transitory" places the levels term at as above. K = p supplies lags in levels and hence lagged changes. type = "trace" requests the trace statistic and type = "eigen" the companion maximum-eigenvalue procedure. Use cajorls() after selecting an intermediate rank to recover normalized relations and adjustment equations. For a chosen recursive ordering, fevd(vec2var(...)) computes finite-horizon shares for the level targets. For example, with Mouse first, the second recursively identified shock accounts for about 5.7% of the four-step forecast-error variance of Mouseβs location in our fitted rank-one system.