I'm trying to wrap my head around the VECM model by doing some simple examples. In this exercise I'm taking the log prices of 2 assets, A and B. These prices are clearly not stationary, for example asset A
:
(For the rest of the explanation I'm using the statsmodels
library, but my questions are about the fundamentals behind the model, not about the use of the library itself.)
Now, as I said I have a dataframe with 2 columns of log-price data, one for asset A
and one for asset B
.
I can check for the cointegration rank of my data. First of all, if I calculate the cointegration rank for 1 lagged difference I get a rank of 2. From what I understand this implies that the data (vector
Xt
, or the log-prices themselves) is already stationary and the model isn't informative and hence we should studyXt
directly (Analysis of Financial Time Series, Tsay, section 8.6). How is this possible in this case if both my series are log-prices and hence hardly stationary (I(0))? Now, if I select 2 lagged differences I get the expected rank of one, which basically means there is 1 cointegration relationship between the 2 seriesAnd here comes my second question, how come that the lag matters when calculating the cointegrating rank? Any resources where I could see this? My understanding is that
alpha
andbeta
arek x m
(k = number of assets, m = cointegrating factors) so I don't see where the lag comes here, also because for a cointegrating relationship one would look at the log-prices at the samet
from statsmodels.tsa.vector_ar.vecm import select_coint_rank, VECM select_coint_rank(df_vecm, det_order=0, k_ar_diff=1) #-----> rank = 2 select_coint_rank(df_vecm, det_order=0, k_ar_diff=2) #-----> rank = 1
In this example, I'm running a VECM model with
cointegration rank = 1
and 2 lagged differences. According to these results thealphas
of the model are not significantly different from 0. If I'm not mistaken, thealphas
are basically the speed of adjustment of the long-term (cointegration) relationship. Does this mean that according to these results there isn't such a long-run relationship and these 2 variables are not cointegrated?vecmodel = VECM(df_vecm, coint_rank=1, k_ar_diff=2) vecfit = vecmodel.fit()
My cointegrating vector $\beta$ is
[1, 2.02]
. I guess since the cointegration rank of my matrix is 1 and there is one cointegrating relationship, it's normal that the first element of $\beta$ is1
and common in all the VECM models?
Here are the VECM results: