SignRestrictedSVARResult#

class cultivars.multivariate.structural.sign_restrictions.SignRestrictedSVARResult(*, source, impacts, shock_names, horizons, restriction, requested, attempts)[source]#

The accepted set of a sign-restricted identification.

Not a point estimate wearing bands. Every accepted impact matrix \(B_n = L Q_n\) is a complete structural model: \(Q_n\) is orthogonal, so \(B_n B_n' = \Sigma_u\) holds for each, and every declared sign holds at every declared lead. The object holds all of them. The quantile surfaces are summaries of that set, computed pointwise across rotations, and the summary says what that means rather than letting the median band read as a model.

Note

The rotations are drawn uniformly (Haar) over the orthogonal group and kept or discarded, so the accepted set carries the uniform prior over rotations whether or not anyone meant to impose one – the Baumeister-Hamilton critique. A pointwise quantile can come from a different rotation at each horizon, so no single structural model traces a band – the Fry-Pagan critique. The exact endpoints of the set, free of both, are SetIdentifiedSVAR’s business; the bands here typically cover well under half of the exact range.

Variables:
  • source – The reduced-form result the rotations factorize.

  • impacts – (n_accepted, k, k) accepted impact matrices.

  • shock_names – One label per column; restricted shocks first, in the order they were declared.

  • horizons – The leads at which the sign restrictions were imposed.

  • restriction – The declared signs, as a sentence.

  • requested – Accepted draws asked for.

  • attempts – Rotations actually drawn.

See also

References

Uhlig, H. (2005). What are the effects of monetary policy on output? Results from an agnostic identification procedure. Journal of Monetary Economics, 52(2), 381-419.

Fry, R., & Pagan, A. (2011). Sign restrictions in structural vector autoregressions: A critical review. Journal of Economic Literature, 49(4), 938-960.

Baumeister, C., & Hamilton, J. D. (2015). Sign restrictions, structural vector autoregressions, and useful prior information. Econometrica, 83(5), 1963-1999.

Example

A demand shock declared to raise both variables on impact. Every accepted impact matrix factorizes the innovation covariance and satisfies the signs; the acceptance rate reads how binding they are:

>>> import numpy as np
>>> from cultivars.multivariate.reduced_form.vector_autoregression import VAR
>>> rng = np.random.default_rng(0)
>>> B = np.array([[1.0, 0.5], [0.3, 1.0]])
>>> A = np.array([[0.5, 0.1], [0.0, 0.4]])
>>> eps = rng.standard_normal((402, 2))
>>> y = np.zeros((402, 2))
>>> for t in range(1, 402):
...     y[t] = A @ y[t - 1] + B @ eps[t]
>>> res = VAR(y, order=1, names=("gdp", "infl")).fit()
>>> signs = {"demand": {"gdp": "+", "infl": "+"}}
>>> sset = SignRestrictedSVAR(res, signs, draws=500, seed=0).identify()
>>> sset.shock_names, sset.horizons, sset.n_accepted, sset.attempts
(('demand', 'unrestricted1'), (0,), 500, 671)
>>> sset.impacts.shape, round(sset.acceptance_rate, 3)
((500, 2, 2), 0.745)
>>> bool(np.allclose(np.einsum("nij,nkj->nik", sset.impacts, sset.impacts), res.sigma_u))
True
>>> bool(np.all(sset.impacts[:, :, 0] > 0.0))
True
>>> sset.irf(0)[[0, 2], 0, :, 0].round(3).tolist()
[[0.383, 0.413], [1.102, 1.024]]

Attributes#

source

The closed reduced-form result the rotations factorize.

impacts

The (n_accepted, k, k) accepted impact matrices.

shock_names

declared shocks first, then unrestricted1 ....

horizons

Leads at which the traditional signs were imposed.

restriction

The declaration, stated as a sentence, with the narrative caveat when it applies.

requested

Accepted rotations asked for.

attempts

Rotations drawn, accepted or not.

acceptance_rate

Accepted rotations per draw, a direct read on how binding the signs are.

k_endog

Number of variables.

n_accepted

Accepted rotations in the set.

names

Variable labels, from the reduced form.

Methods#

fevd([horizon, quantiles])

Pointwise quantiles of the variance decomposition across the set.

irf([horizon, quantiles, cumulative])

Pointwise quantiles of the impulse responses across the accepted set.

irf_draws([horizon, cumulative])

Structural impulse responses for every accepted rotation.

summary()

The estimation summary, renderable as text, HTML, or a dataframe.