PerturbationDSGEPosterior.impulse_responses#

PerturbationDSGEPosterior.impulse_responses(*, horizon=40, size=1.0, n_draws=200, seed=None)[source]#

Posterior draws of the responses.

Returns (states, controls) of shapes (n_draws, n_eps, horizon, n_x) and (n_draws, n_eps, horizon, n_y).

Each draw resolves the model at one kept parameter draw, so the band is the posterior of the response and not the response at the posterior mean.

At most n_kept draws are used, chosen without replacement, so the leading dimension is min(n_draws, n_kept). n_draws is not otherwise validated: zero or a negative value raises NumPy’s ValueError.

Parameters:
  • horizon (int) – Periods after the impulse.

  • size (float) – Impulse size in standard deviations.

  • n_draws (int) – Parameter draws to propagate.

  • seed (int | None) – Seed for the draw selection.

Return type:

tuple[NDArray[double], NDArray[double]]

Returns:

The state responses and the control responses, indexed by draw, shock, period, and variable.

Raises:

SpecificationError – If the horizon is not positive.