VECM (statsmodels.tsa.vector_ar.vecm.VECM)

Skip to first unread message

Federico Maglione

Jul 19, 2022, 8:31:54 AM7/19/22
to pystatsmodels
Dear all,

I'm writing to the community as I've been having some issues in estimating a Vector Error Correction Mechanism (VECM).

In particular, I'm trying to move a code from Matlab to Python. My issue is mainly in the syntax I need to use to estimate my model. In particular, I'm not able to code the two following steps:

- first, my model is a constrained VECM, that is once the autoregressive part is estimated, I would like to estimate only some specific lags (i.e. t-1, t-4, t-12), possibly not for all the variables entering the cointegration vector.

I see the parameter k_ar_diff which seems to me must be an integer. If I input k_ar_diff = 12, all the lag from 1 to 12 are estimated. I would need something like k_ar_diff = [1, 4, 12].

Is there a way to do it?

- secondly, as I also add exogenous variables, I would also like to constrain the estimation of the loadings of those onto the endogenous variables. I try to explain it better: Say that the endogenous variables are [Y1 Y2 Y3], and the exogenous variables are [X1 X2 X3]. Maybe X2 affects Y1 and Y3 only and hence I would like to constrain the loading on Y2 to be equal to zero.

Can also this be done in some way?

Thank you very much for your help and support.

Best regards,

Jul 19, 2022, 4:02:01 PM7/19/22
Constraints for Vecm are not implemented. 

I’m on vacation and cannot check the details.

Afair, there are different iterated algorithm for constraints on the difference equation and the equations for the cointegrating vectors.
Dropping lags would require a VAR model that can drop lags. If all equations drop the same lags, then ols for difference equations would still be valid

You received this message because you are subscribed to the Google Groups "pystatsmodels" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
Reply all
Reply to author
0 new messages