Growth risk
Practicum · Session 08
The growth-risk replication
Obtain the fingerprinted CSV using the session README in the replication package. Set MATLAB’s Current Folder to the repository root. These blocks run in order in one MATLAB session. The first command writes only the session’s own generated output files; it does not alter the CSV.
% Fit the three conditional-growth quantiles and both uncertainty-shock variants.
result = run_session(8);
% The first predictor origin must be 1960 Q2, encoded as 4*1960+1.
assert(result.originPeriods(1) == 4*1960+1);
% The last dependent variable is GDP growth in 2020 Q1.
assert(result.targetPeriods(end) == 4*2020);
% Report the actual three quantile objectives and their numerical lower bounds.
disp(cellfun(@(fit) [fit.objective,fit.dualObjective,fit.gap], ...
result.quantile,'UniformOutput',false));Each row of result.beta refers to one predictor: intercept, current GDP, unemployment, real equity prices, sentiment, lagged unemployment, and lagged real equity prices. Its columns are the 0.1, 0.5 and 0.9 quantiles. The covariance of these estimated coefficients is not reported: a primal-dual numerical certificate is not a sampling standard error.
Check the optimizer
% Read the median regression with its original design and dual weights.
medianFit = result.quantile{2};
% Recompute the check loss directly from the stored structural regression residuals.
primal = sum(abs(medianFit.residuals))/2;
% Recompute the dual lower bound from the observed growth targets.
dual = result.target' * medianFit.dualWeights;
% The gap must agree with the solver's independent reported certificate.
assert(abs((primal-dual)-medianFit.gap) < 1e-10);
% Independent quantile estimation did not cross in this particular sample.
assert(result.crossingCount == 0);An unchanged objective can coexist with noticeably changing coefficients when regressors are poorly scaled or the minimum is not unique. This is why the replication reports fitted-value differences as well as coefficient differences in its optional classroom comparison.
Check the identifying restriction
% Recover the covariance and the restricted scalar-shock directions.
Sigma = result.var.Sigma;
% Each direction must produce a unit-variance scalar innovation.
shockVariances = diag(result.restrictedDirections' * Sigma * ...
result.restrictedDirections);
% This diagonal check does not claim that the three alternative shocks are independent.
assert(max(abs(shockVariances-1)) < 1e-10);
% The first array slot is impact, not one quarter ahead.
impact = result.restrictedResponses(:,:,1);
% GDP, unemployment and investment have zero responses on impact by construction.
assert(max(abs(impact(1:3,:)),[],'all') < 1e-8);
% Read the long-form response table, with units stored beside each response.
disp(result.summary(1:5,:));The remaining responses are conditional on the quantile specification, the VAR, and the within-quarter restrictions. A later confidence-band exercise must re-estimate the quantile stage as well as the VAR.
Worked exercises
Exercises
1. The forecast origin
A quarterly predictor sample runs from 1960 Q1 through 2019 Q4. The regression includes information at t and t-1 and predicts growth at t+1. Determine the first and last origins, targets, and sample size. Explain which GDP level is needed outside the predictor sample.
Hint: Count inclusive quarters after removing the first predictor row.
2. A quantile certificate
For y=(1,2,3,4,9)', fit an intercept-only median. Compute its objective. Construct feasible dual weights and show that their objective equals the primal objective. Why does this establish a global, rather than local, minimum?
Hint: At the median, nonzero residuals have dual weights \pm1/2.
3. A normalized distribution innovation
Let \Sigma=\begin{pmatrix}4&1\\1&1\end{pmatrix} and \gamma=(1,0). Calculate the unit-variance width shock’s impact vector. Then impose zero impact on the second variable. Compute the projected direction, its variance, and the restricted impact vector.
Hint: For the restriction use D=(0,1) before renormalizing.
4. The covariance denominator
The VAR has 239 input rows, seven variables, three lags and an intercept. Compute the unbiased residual covariance divisor. The source instead uses 240 as its initial row count. Derive how correcting that divisor changes a response normalized to a one-standard-deviation width innovation.
Hint: Multiplying \Sigma by c multiplies the normalized response by \sqrt c, not by c.
The forecast origin
There are 4(2019-1960)+4=240 predictor quarters. To use both t and t-1, the first origin is 1960 Q2. The last remains 2019 Q4, giving 239 observations. Adding one quarter to each origin produces targets from 1960 Q3 to 2020 Q1. Growth at the last target is 100[\log GDP_{2020Q1}-\log GDP_{2019Q4}], so the first-quarter 2020 GDP level is needed even though it is never a current predictor.
The count can be checked directly from the target calendar: 4(2020-1960)+(1-3)+1=239. Plotting the origins as if they were target dates would shift the fitted growth series back by one quarter.
A quantile certificate
The sample median is b=3, with residuals (-2,-1,0,1,6)'. At \tau=1/2, the objective is
P=\tfrac12(2+1+0+1+6)=5.
Take a=(-1/2,-1/2,0,1/2,1/2)'. Every weight is in the allowed box and \mathbf1'a=0, which is the dual equality constraint for an intercept. The dual objective is
D=y'a=-\tfrac12-1+0+2+\tfrac92=5.
Weak duality gives D\leq P^*\leq P for the unknown optimal primal value P^*. Since both bounds equal five, P^*=5. No differentiability or local curvature argument is needed. The automated test repeats this calculation and checks the returned dual weights and objective gap.
A normalized distribution innovation
First, \gamma\Sigma\gamma'=4, so the unrestricted impact vector is \Sigma\gamma'/2=(2,1/2)'. The scalar shock u_1/2 has variance one. Its second-variable impact is not zero because the reduced-form innovations have covariance one.
For D=(0,1), D\Sigma D'=1 and \gamma\Sigma D'=1. Hence
\alpha=(1,0)-1\cdot1^{-1}(0,1)=(1,-1).
Its variance is \alpha\Sigma\alpha'=4-1-1+1=3, while \Sigma\alpha'=(3,0)'. The normalized restricted impact is therefore (\sqrt3,0)'. The zero is exact under the restriction, not a small estimated coefficient. Renormalization matters: using the old standard deviation two would no longer produce a unit-variance shock.
The covariance denominator
Three lags leave 239-3=236 residual observations. There are 1+7\times3=22 regressors in each equation. The unbiased divisor is 236-22=214. The classroom expression instead gives 240-3-21-1=215. For the same residual cross product, \widehat\Sigma_{preferred}=(215/214)\widehat\Sigma_{source}.
For any fixed \gamma, replacing \Sigma by c\Sigma yields
\frac{c\Sigma\gamma'}{\sqrt{\gamma c\Sigma\gamma'}} =\sqrt c\frac{\Sigma\gamma'}{\sqrt{\gamma\Sigma\gamma'}}.
The preferred response is larger by \sqrt{215/214}, approximately 1.002334. The projected direction is unchanged because the scalar covariance factor cancels from its regression projection. The benchmark removes this known scale change before comparing the two implementations.