SignRestrictedSVARResult.irf_draws#

SignRestrictedSVARResult.irf_draws(horizon=20, *, cumulative=False)[source]#

Structural impulse responses for every accepted rotation.

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

  • cumulative (bool) – Return running sums.

Return type:

NDArray[double]

Returns:

An array of shape (n_accepted, horizon + 1, k, k); entry [n, h, i, j] is variable i’s response at lead h to one standard deviation of shock j under rotation n.

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