I have some series that are cointegrated, so I know that I should fit a vector error correction model (VECM). Nevertheless I found no guidance in finding the optimal lag length, say
I am using the "vars" package in R. In order to check cointegration I used
ca.jo(..,K=cointegrationLength) and then used
cajoorls(...,K=lagLength) to fit the VECM.
I do not understand:
- the right interaction between
Kin both functions;
- an "optimal" criterion to choose the lag lengths.