SignRestrictedSVARResult.irf_draws#
- SignRestrictedSVARResult.irf_draws(horizon=20, *, cumulative=False)[source]#
Structural impulse responses for every accepted rotation.
- Parameters:
- Return type:
- Returns:
An array of shape
(n_accepted, horizon + 1, k, k); entry[n, h, i, j]is variablei’s response at leadhto one standard deviation of shockjunder rotationn.
Example
>>> import numpy as np >>> from cultivars.multivariate.reduced_form.vector_autoregression import VAR >>> rng = np.random.default_rng(0) >>> res = VAR(rng.standard_normal((121, 2)), order=1, names=("gdp", "infl")).fit() >>> sset = SignRestrictedSVAR(res, {"d": {"gdp": "+"}}, draws=20, seed=0).identify() >>> draws = sset.irf_draws(3) >>> draws.shape, bool(np.allclose(draws[:, 0], sset.impacts)) ((20, 4, 2, 2), True) >>> running = sset.irf_draws(3, cumulative=True) >>> bool(np.allclose(running, np.cumsum(draws, axis=1))) True