FactorAugmentedSVARResult.irf#

FactorAugmentedSVARResult.irf(horizon=20, *, cumulative=False)[source]#

Responses of every panel series to the identified shocks.

The observation equation applied to the factor-space structural impulse responses, rescaled into each series’ own units.

Parameters:
  • horizon (int) – Largest lead to return.

  • cumulative (bool) – Return running sums, for differenced data and level questions.

Return type:

NDArray[double]

Returns:

An array of shape (horizon + 1, n_series, s); entry [h, i, j] is the response of panel series i at lead h to one standard deviation of identified shock j, in the series’ original units.

Example

>>> import numpy as np
>>> from cultivars.multivariate.large_dim.factor_augmented import FAVAR
>>> rng = np.random.default_rng(0)
>>> panel, policy = rng.standard_normal((120, 5)), rng.standard_normal((120, 1))
>>> res = FAVAR(panel, policy, n_factors=1, order=1).fit()
>>> svar = FactorAugmentedSVAR(res).identify()
>>> plain, running = svar.irf(4), svar.irf(4, cumulative=True)
>>> plain.shape, bool(np.allclose(running, np.cumsum(plain, axis=0)))
((5, 5, 2), True)
>>> through = np.einsum("nk,hks->hns", res.loadings, svar.factor_irf(4))
>>> bool(np.allclose(plain, through * res._scales[None, :, None]))
True