VECMX#
- class cultivars.multivariate.reduced_form.error_correction.VECMX(endog, exog, *, order, rank, cointegration_trend='constant', contemporaneous=True, names=None, exog_names=None)[source]
Bases:
_ExogenousVectorErrorCorrectionModel[VECMXResult]Conditional vector error-correction model with weakly exogenous I(1) regressors.
The partial system of Pesaran, Shin and Smith: the modelled block
ygets equations, the exogenous blockxis carried through the cointegrating space, the lagged differences and, by default, a contemporaneous difference, but is never modelled. The rank may reachk_y, and the inheritedrank_test()reads it against the conditional null distribution, whose critical values are materially larger than the closed-system ones. This is the unit specification aGVARlinks, and the only unit kind whose weak-exogeneity assumption that assembler can test.- Variables:
_endog – The validated
(nobs, k_y)modelled panel._names – Modelled variable labels.
_order – Lags of the levels system.
_trend – The unrestricted deterministic terms, mapped from the Johansen case.
_prior – The base slot for a shrinkage prior, unused by this family.
_rank – The cointegrating rank.
_trend_case – The Johansen case as given.
_exog – The validated
(nobs, k_x)exogenous block._exog_names – Exogenous labels.
_contemporaneous – Whether the current exogenous difference enters.
See also
VECMXResult– the recordfit()returns.VECM– the closed model, the case where the exogenous block is empty.VARX– the conditional model in levels.
References
Pesaran, M. H., Shin, Y., & Smith, R. J. (2000). Structural analysis of vector error correction models with exogenous I(1) variables. Journal of Econometrics, 97(2), 293-343.
Example
>>> import numpy as np >>> rng = np.random.default_rng(0) >>> x = np.cumsum(rng.standard_normal((300, 1)), axis=0) >>> other = np.cumsum(rng.standard_normal(300)) >>> y = np.column_stack([x[:, 0] + rng.standard_normal(300), other]) >>> model = VECMX(y, x, order=2, rank=1) >>> model.rank_test(simulations=2000).selected_rank() 1 >>> res = model.fit() >>> res.k_exog, res.rank, (res.normalized_beta().ravel().round(1) + 0.0) (1, 1, array([ 1., 0., -1.]))