VARXResult.historical_decomposition#

VARXResult.historical_decomposition()[source]#

Attribute each observation to the shocks that produced it.

Return type:

NDArray[double]

Returns:

An array of shape (nobs, k, k) whose entry [t, i, j] is shock j’s cumulative contribution to variable i at time t. Summing over j recovers 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 against endog.

Note

Costs O(nobs^2) moving-average terms, because the contribution at t sums over every shock up to t. Fine for macro samples; noticeable past a few thousand observations.