ShortRunSVAR.identify#

ShortRunSVAR.identify()[source]#

Estimate the free coefficients by maximum likelihood.

The likelihood is evaluated at the result’s reported innovation covariance, so a just-identified structure reproduces exactly the matrix every other scheme factors and the whole result surface stays internally consistent. Each impact column is signed so its largest entry is positive.

Return type:

SVARResult

Returns:

The complete structural result, with the over-identification likelihood-ratio test in its diagnostics when restrictions exceed the exactly identifying count.

Raises:

NumericalError – If a just-identified structure cannot reproduce the innovation covariance, which is the rank condition failing at this pattern – the restrictions are arranged so that some free coefficient is not pinned down.

Example

The default B-model – uncorrelated structural shocks loading one per equation – is over-identified by k(k-1)/2 zeros, and on correlated innovations the test rejects it:

>>> 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.0], [0.5, 1.0]])
>>> y = np.zeros((402, 2))
>>> for t in range(1, 402):
...     y[t] = 0.4 * y[t - 1] + B @ rng.standard_normal(2)
>>> res = VAR(y, order=1, names=("r", "x")).fit()
>>> diagonal = ShortRunSVAR(res, b=[[np.nan, 0.0], [0.0, np.nan]]).identify()
>>> report = dict(diagonal.diagnostics)
>>> report["Over-ID restrictions"], float(report["Over-ID p-value"]) < 0.01
('1', True)
>>> bool(np.allclose(diagonal.impact, np.diag(np.sqrt(np.diag(res.sigma_u)))))
True
>>> diagonal.restriction[:41]
'AB model with 4 fixed cells in the contem'