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:
- Return type:
- Returns:
An array of shape
(horizon + 1, n_series, s); entry[h, i, j]is the response of panel seriesiat leadhto one standard deviation of identified shockj, 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