MarkovSwitchingSVAR.identify#
- MarkovSwitchingSVAR.identify()[source]#
Identify every regime under one declaration and package the answers.
- Return type:
- Returns:
The per-regime structural result. When no identifications were supplied, each regime is factorized recursively under the same ordering – the restriction pattern held fixed while the parameters switch.
- Raises:
SpecificationError – If a declared ordering is not a permutation of
names.NumericalError – If a regime’s innovation covariance is not positive definite.
Example
>>> import numpy as np >>> rng = np.random.default_rng(0) >>> s = np.repeat([0, 1, 0, 1], 100) >>> y = np.array([[-1.0, -0.5], [1.5, 1.0]])[s] + 0.4 * rng.standard_normal((400, 2)) >>> res = MarkovSwitchingVAR(y, order=1, n_regimes=2, names=("a", "b")).fit(seed=0) >>> svar = MarkovSwitchingSVAR(res, order=("b", "a")).identify() >>> svar.shock_names, [float(svar.impact(m)[1, 1]) for m in range(2)] (('b', 'a'), [0.0, 0.0]) >>> MarkovSwitchingSVAR(res, order=("b", "c")).identify() Traceback (most recent call last): cultivars.exceptions.SpecificationError: order must be a permutation of the variable ...