VARResult.historical_decomposition#
- VARResult.historical_decomposition()[source]#
Attribute each observation to the shocks that produced it.
- Return type:
- Returns:
An array of shape
(nobs, k, k)whose entry[t, i, j]is shockj’s cumulative contribution to variableiat timet. Summing overjrecovers the stochastic component of the path, not the observed series: the deterministic terms and the influence of pre-sample initial conditions are excluded by construction, since neither is attributable to any shock. Add the deterministic path back before comparing againstendog.
Note
Costs
O(nobs^2)moving-average terms, because the contribution attsums over every shock up tot. Fine for macro samples; noticeable past a few thousand observations.