cultivars.multivariate.structural.sign_restrictions#

Sign-restriction identification: a set of models, reported as a set.

Declaring only the directions of responses – a supply shock raises output and lowers prices – rules out rotations without pinning one down. Any impact matrix consistent with the innovation covariance is \(B = L Q\) for the Cholesky factor \(L\) and an orthogonal \(Q\), and the declaration keeps the \(Q\) for which

\[\operatorname{sign}\!\big(e_i' \Psi_h L Q e_j\big) = s_{ij} \qquad \text{for every declared } (i, j, s_{ij}) \text{ and every } h \in \mathcal{H},\]

a region of the orthogonal group with positive measure, so what the data and the declaration jointly deliver is a set of structural models. SignRestrictedSVAR collects that set by drawing Haar-distributed rotations – the QR of a Gaussian matrix with the sign of \(R\)’s diagonal folded into \(Q\), without which the draw is not uniform – and keeping those that satisfy every declared sign at every declared lead, flipping a restricted column wholesale when its negative passes and never relabelling columns to rescue a draw. NarrativeSignRestrictedSVAR applies the same draws to a second filter, the declared history: a named shock had a named sign in a named period, or was the most or the overwhelming contributor to a named variable’s surprise there, each checked through the candidate’s own recovered shocks \(B^{-1} u_{t^\ast}\). SignRestrictedSVARResult holds the accepted rotations themselves, and its quantile surfaces are labelled as summaries of the set rather than as the impulse responses of any single model, which no rotation traces.

Two commitments shape the surface. First, the set is the object and the prior is named. The accepted rotations carry the Haar measure over the admissible region – a uniform prior over rotations that nobody declared and that concentrates mass where the responses are flat in angle, the Baumeister-Hamilton critique – and every quantile is pointwise, so the median band is not a model, the Fry-Pagan critique; the result returns the draws so that any other functional of the set can be computed, and the exact endpoints free of both critiques are one import away in set_identification. Second, the set reflects identification uncertainty only. Rotations are drawn at the reduced-form point estimate and narrative events are checked against its residuals, and both summaries say so; reduced-form parameter uncertainty, and the Antolín-Díaz and Rubio-Ramírez importance weights that propagate narrative information into it, belong to the posterior-draw version that arrives with the sampling backend.

Layout. Both models are _IdentificationModel subclasses from _internals. The sign pattern is compiled by _validate_sign_patterns and the events by _validate_narrative_events, both in _core; the factor comes from _lower_cholesky; the draw-and-accept loops are _accepted_rotations and _narrative_rotations in _core, over the _haar_rotation sampler there, which is kept below the model layer for the same reason the Kalman recursions are. Quantile levels pass through _validate_quantiles, and the summaries render through the shared _SIGN_QUANTILE_NOTE, _UNIT_SHOCK_NOTE and _NARRATIVE_NOTE.

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.

Rubio-Ramírez, J. F., Waggoner, D. F., & Zha, T. (2010). Structural vector autoregressions: Theory of identification and algorithms for inference. Review of Economic Studies, 77(2), 665-696.

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.

Antolín-Díaz, J., & Rubio-Ramírez, J. F. (2018). Narrative sign restrictions for SVARs. American Economic Review, 108(10), 2802-2829.

Mezzadri, F. (2007). How to generate random matrices from the classical compact groups. Notices of the American Mathematical Society, 54(5), 592-604.

Example

A demand shock declared to raise both variables. The accepted set is a set of complete models – every impact matrix factorizes the innovation covariance – and the pointwise median band is traced by none of them: at each lead the median comes from a different rotation.

>>> 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=300, seed=0).identify()
>>> sset.n_accepted, sset.shock_names
(300, ('demand', 'unrestricted1'))
>>> bool(np.allclose(np.einsum("nij,nkj->nik", sset.impacts, sset.impacts), res.sigma_u))
True
>>> draws = sset.irf_draws(8)[:, :, 0, 0]
>>> median = sset.irf(8)[1, :, 0, 0]
>>> nearest = np.abs(draws - median).argmin(axis=0)
>>> len(set(nearest.tolist())) > 1
True

Classes#

NarrativeSignRestrictedSVAR

Sign restrictions sharpened by declared history, Antolín-Díaz and Rubio-Ramírez (2018).

SignRestrictedSVAR

Set identification by declared response signs, Uhlig (2005) via RWZ draws.

SignRestrictedSVARResult

The accepted set of a sign-restricted identification.