VECMX#

class cultivars.multivariate.reduced_form.error_correction.VECMX(endog, exog, *, order, rank, cointegration_trend='constant', contemporaneous=True, names=None, exog_names=None)[source]#

Conditional vector error-correction model with weakly exogenous I(1) regressors.

The partial system of Pesaran, Shin and Smith: the modelled block y gets equations, the exogenous block x is carried through the cointegrating space, the lagged differences and, by default, a contemporaneous difference, but is never modelled. The rank may reach k_y, and the inherited rank_test() reads it against the conditional null distribution, whose critical values are materially larger than the closed-system ones. This is the unit specification a GVAR links, 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 record fit() 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.]))

Attributes#

cointegration_trend

The Johansen case.

contemporaneous

Whether the current exogenous difference enters the short-run equation.

endog

The validated sample.

exog

The weakly exogenous block, zero-width for a closed system.

exog_names

Exogenous labels.

is_shrunk

Whether a prior contributes anything to this estimate.

k_cointegrating

every integrated variable plus any restricted term.

k_endog

Number of endogenous variables.

k_exog

Weakly exogenous integrated regressors.

n_regressors

Short-run regressors per equation.

names

Variable labels.

order

Autoregressive order.

prior

The prior on the coefficients; NoPrior when unrestricted.

rank

Cointegrating rank.

trend

Deterministic specification.

Methods#

fit()

Estimate the conditional system and return the fitted result.

lag_order_selection([max_lags])

Score every order from zero to max_lags on one common sample.

rank_test(*[, small_sample, simulations, ...])

Trace and maximum-eigenvalue tests for every candidate rank.