Statistics and Algorithms / Vector Autoregressions / Historical Decomposition |
HISTORY decomposes the historical values of a set of time series into a base projection and the accumulated effects of current and past innovations. You can see, for instance, whether movements in variable x in 2009 were likely the result of innovations in variable z a year earlier.
The historical decomposition is based upon the following partition of the moving average representation
\begin{equation} {\bf{y}}_{T + j} = \sum\limits_{s = 0}^{j - 1} {\Psi _s {\bf{u}}_{T + j - s} } + \left[ {{\bf{\hat y}}_{T + j} + \sum\limits_{s = j}^\infty {\Psi _s {\bf{u}}_{T + j - s} } } \right] \end{equation}
The first sum represents that part of \({\bf{y}}_{T + j} \) due to innovations in periods \(T+1\) to \(T+j\). The second is the forecast of \({\bf{y}}_{T + j} \) based on information available at time \(T\).
If \(\mathbf{u}\) has \(N\) components, the historical decomposition of \({\bf{y}}_{T + j} \) has \(N+1\) parts (each itself, the size of \(\bf{y}\))
•The forecast of \({\bf{y}}_{T + j} \) based upon information at time \(T\) (the term in brackets).
•For each of the \(N\) components of \({\bf{u}}\), the part of the first term that is due to the time path of that component.
Presenting Results
HISTORY generates a lot of series: \(N(N+1)\) of them for a standard VAR. Graphs are the simplest way to present these. HISTORY.RPF creates a separate page of graphs for each variable, with each page having a separate graph for the shocks to each of the other variables. Each of these subgraphs has the actual data (black line), the forecast (blue) and the sum of the forecast and the effect of the residuals to that variable (green). This, for instance, shows the effect of the interest rate shocks on Canadian GDP in the middle right. Because the green line largely tracks the black, we can see that much of the gap between actual and forecast can be attributed to interest rate shocks. However, because (unlike the decomposition of variance) these are a mix of positive and negative contributions, it's possible for more than one series to explain "much" of the gap if another series goes in the opposite direction. For instance, here both the LOGCANGDP own shocks and the CAN3MTHPCP shocks end up with similar effects, counteracted mainly by opposite effects by LOGCANM1 shocks.
The historical decomposition is a special case of a counterfactual simulation. The actual data can be recreated by adding the base forecast to the sum of contributions of all the components. If we omit some of those components, we’re seeing what data would have been generated if some (linear combinations) of the residuals had been zero rather than what was actually observed.
The tool for doing more general counterfactual simulations is FORECAST with the option PATHS. With the PATHS option, FORECAST takes as input an additional VECT[SERIES] which has the paths of shocks to add in during the forecast period. Note that these have to be non-orthogonal shocks. If the restrictions on the residuals are in a transformed space (like orthogonalized shocks), these have to be transformed back into the space for non-orthogonal shocks. If \({\bf{u}}_t \) are the VAR residuals and \({\bf{v}}_t \) are the structural residuals, then \({\bf{u}}_t = {\bf{Fv}}_t \) and \({\bf{v}}_t = {\bf{F}}^{ - 1} {\bf{u}}_t \). The general procedure is:
1.Transform the VAR residuals into structural residuals.
2.Make the desired changes (zeroing, for instance) to those.
3.Transform back into the space for equation shocks.
4.Use FORECAST(PATHS) inputting the VECT[SERIES] of shocks computed in 3.
It's possible to combine several of these steps into a single matrix calculation. For instance, suppose that we use the “B” model in CVMODEL.RPF, which defines two “real shocks” (the first two of six), and we want to generate the path of GDP with all shocks other than those two zeroed out; this is one possible way to estimate potential (Canadian) GDP, which is the second endogenous variable. That can be done with the following (after the first CVMODEL in that example):
compute supplymask=||1.0,1.0,0.0,0.0,0.0,0.0||
compute supplyonly=bfactor*%diag(supplymask)*inv(bfactor)
dec vect[series] supplyshocks(6)
do t=hstart,hend
compute %pt(supplyshocks,t,supplyonly*%xt(varresids,t))
end do t
forecast(paths,from=hstart,to=hend,model=canmodel,$
results=withshocks)
# supplyshocks
set potgdp = withshocks(2)
The matrix SUPPLYONLY maps the original residuals to the set of non-orthogonal shocks which shut down the final four structural residuals—as you read it from right to left, INV(BFACTOR) converts to structural residuals, %DIAG(SUPPLYMASK) zeroes out the last four elements, and BFACTOR converts back to non-orthogonal shock space.
Copyright © 2025 Thomas A. Doan