X1 , X2 , X3 and X4 are time series which are stationary at level. I want to establish long term relation between them. I am planning to use it as forecasting model for my work. I want to create this model in terms of equation. I have tested all of them for KPSS test and got p=0.01 for all of them. After reading few articles, I decided to go with VECM instead of VAR (Though I was not 100% sure). I implemented that code in R and got below result. Could someone please help me to interpret this result? How can I put below result in equation or do I need to perform another operation to achieve equation. Please let me know if my approach is wrong.
mysample <- cbind(X1,X2,X3,X4) myvecm <- ca.jo(mysample, ecdet = "const", type="eigen", K=2, spec="longrun") myvecm ##################################################### # Johansen-Procedure Unit Root / Cointegration Test # ##################################################### The value of the test statistic is: 1.4814 6.8852 10.1941 19.0711 summary(myvecm) ###################### # Johansen-Procedure # ###################### Test type: maximal eigenvalue statistic (lambda max) , without linear trend and constant in cointegration Eigenvalues (lambda): [1] 6.219413e-02 3.374104e-02 2.291576e-02 4.975326e-03 5.899570e-18 Values of teststatistic and critical values of test: test 10pct 5pct 1pct r <= 3 | 1.48 7.52 9.24 12.97 r <= 2 | 6.89 13.75 15.67 20.20 r <= 1 | 10.19 19.77 22.00 26.81 r = 0 | 19.07 25.56 28.14 33.24 Eigenvectors, normalised to first column: (These are the cointegration relations) X1.l2 X2.l2 X3.l2 X4.l2 constant X1.l2 1.0000000 1.00000000 1.000000e+00 1.0000000 1.00000 X2.l2 -13.4606755 0.05012407 -4.229465e-01 0.2062215 168.98883 X3.l2 14.6636224 -0.25491299 -6.044102e-03 -3.1153455 29.80024 X4.l2 -0.7271033 0.52004658 -1.627988e-01 2.2019219 -192.13799 constant -1118.6413405 -905.29920115 -2.449373e+02 90.7496618 -1410.17106 Weights W: (This is the loading matrix) X1.l2 X2.l2 X3.l2 X4.l2 constant X1.d 0.002180911 -0.02802099 -0.02246478 0.0003522903 -3.141235e-18 X2.d 0.007417964 -0.02497527 0.03282100 0.0017254493 -3.120297e-17 X3.d 0.001519561 -0.02698047 0.03497633 0.0023286731 -1.246647e-17 X4.d 0.000565004 -0.05822246 0.06111445 0.0001316755 -1.841759e-17
Best Answer
The Johansen procedure which you performed is used to decide how many cointegrating relationships you have. To perform it, first you need to choose appropriate number of lags, which can be done by using function VARselect
from package vars. You should also choose whether constant, or trend terms are estimated besides cointegration relationship or not. This decision is usually made based on data or/and model.
After that, the main result of Johansen procedure is the table of test statistics:
test 10pct 5pct 1pct r <= 3 | 1.48 7.52 9.24 12.97 r <= 2 | 6.89 13.75 15.67 20.20 r <= 1 | 10.19 19.77 22.00 26.81 r = 0 | 19.07 25.56 28.14 33.24
It should be read from the bottom to the top. The last row has the hypothesis that there are no cointegrating relationships, and in your case this hypothesis is not rejected. This means that there are no cointegrating relationships in your data and it is not possible to use VEC model with this data, and you should use VAR on the first differences, since all of your time series has unit root.
If you are really sure that there is a long term relationship in your data, then check that you are using the correct number of lags and appropriate dummy variables (constant, trend, seasonal dummies, etc) and then rerun the Johansen procedure again.
As I said the table should be read from bottom to the top. You start at the last row and if the hypothesis is rejected (the test statistic is larger than critical values), then you move one row up, until the test statistic is not rejected. The number of row counting from the bottom, for which the hypothesis is accepted is the number of cointegrating relationships minus one, i.e. the last row means zero, the second last one, etc.
If you only want to use the model for forecasting, then you can convert the resulting VEC model to VAR using function vec2var
, where you supply as arguments the output of ca.jo
and the number of cointegration relationships. You can then forecast from the resulting model with the function predict
, using the argument n.ahead
to indicate how many steps you want to forecast.