Solved – Statsmodels VECM – Predicting out-of-sample

After fitting a VECM model, I would like to study its out-of-sample behavior but haven't been able to find a way to do it.

More precisely, given X_train and X_test, I computed

from statsmodels.tsa.vector_ar.vecm import VECM model = VECM(endog = X_train, k_ar_diff = 1, coint_rank = 2, deterministic = 'co') res = model.fit() X_pred = res.predict(X_test) 

However, predict does not seem to be built for this. Is there any way around this?

from statsmodels.tsa.vector_ar.vecm import VECM model = VECM(endog = X_train, k_ar_diff = 1, coint_rank = 2, deterministic = 'co') res = model.fit() X_pred = res.predict(steps=10) 

e.g. set steps=10 if your want predict 10 periods

Similar Posts:

Rate this post

Leave a Comment