statsmodels.tsa.vector_ar.vecm.coint_johansen#

statsmodels.tsa.vector_ar.vecm.coint_johansen(endog, det_order, k_ar_diff)[source]#

Johansen cointegration test of the cointegration rank of a VECM

Parameters:
endogarray_like (nobs_tot x neqs)

Data to test

det_order{-1, 0, 1}
  • -1 - no deterministic terms

  • 0 - constant term

  • 1 - linear trend

k_ar_diffint, nonnegative

Number of lagged differences in the model.

Returns:
resultJohansenTestResult

An object containing the test’s results. The most important attributes of the result class are:

  • trace_stat and trace_stat_crit_vals

  • max_eig_stat and max_eig_stat_crit_vals

Notes

The implementation might change to make more use of the existing VECM framework.

The eigenvalues and eigenvectors are computed from a QR decomposition and a singular value decomposition using the algorithm of [2], which avoids forming the moment matrices. This requires one matrix with the lagged differences, the levels and the differences of endog, so the memory use is larger than if only the moment matrices were stored. A LinAlgError is raised if these columns are linearly dependent, for example if endog contains a duplicated series.

References

[1]

Lütkepohl, H. 2005. New Introduction to Multiple Time Series Analysis. Springer.

[2]

Doornik, J. A. and O’Brien, R. J. 2002. Numerically stable cointegration analysis. Computational Statistics & Data Analysis, 40(1), 185-193.