Back to models
Param Estimator

JohansenCointegration

Test for cointegration ranks/relationships for VECM Time-Series.

Quickstart

python
from sktime.param_est.cointegration import JohansenCointegration

estimator = JohansenCointegration(det_order=1, k_ar_diff=1)

Parameters(2)

det_orderint, default=1
  • -1 - no deterministic terms

  • 0 - constant term

  • 1 - linear trend

k_ar_diffint, nonnegative, default=1
Number of lagged differences in the model. Needs multivariate version of ARLagOrderSelector, See also: statsmodels.tsa.vector_ar.vecm.select_order

Examples

>>> from sktime.datasets import load_airline
>>> from sktime.param_est.cointegration import JohansenCointegration
>>> import pandas as pd
>>> X = load_airline ()
>>> X2 = X. shift (1). bfill ()
>>> df = pd. DataFrame ({ "X": X, "X2": X2 })
>>> coint_est = JohansenCointegration ()
>>> coint_est. fit (df) JohansenCointegration(
... )
>>> print (coint_est. get_fitted_params ()["cvm" ]) [[15.0006 17.1481 21.7465] [2.7055 3.8415 6.6349]]

References

  1. [1 ] Lütkepohl, H. 2005. New Introduction to Multiple Time Series Analysis. Springer. [2 ] Statsmodels (last visited 02/11/2025): https://www.statsmodels.org/dev/generated/statsmodels.tsa.vector_ar.vecm.coint_johansen.html