# VAR lag selection heavily depends on maximum lag investigated

I am fitting an Error Correction Model with two monthly price time series. In Stata I am using the varsoc command to determine the number of lags that are appropriate.

varsoc variable1 variable2


If I run varsoc with the default 4 maxlags, the suggested lag length using AIC/FPE is 3. However, if I run varsoc with maxlag(12) option, 12 lags are suggested. If I use maxlag(20), 13 lags are suggested.

1. Why is varsoc so sensitive to the number of maxlag?
2. If this is the case, how should I decide which maxlag to use? Running varsoc on the time series seperately yields 8 lags (if a larger maxlag is chosen).
• Regarding the close vote, I don't think this question belongs to Stack Overflow because the issue seems to be statistical rather than programming-specific. Regarding error correction model, it seems to be vector error correction model (VECM) rather than single-equation error correction model (ECM); if this is so, I suggest editing the post accordingly. – Richard Hardy Dec 17 '15 at 16:58
• Low, let me know if something is still unclear. Otherwise, consider accepting the answer. – Richard Hardy Feb 10 '17 at 11:03

The function varsoc considers full (unrestricted) VAR or VECM models with lags 1 through maxlag. It may happen that the user sets maxlag to a relatively low number such that the best model in AIC or FPE sense is excluded. This seems to be happening for maxlag(4) and maxlag(12). However, I suspect the AIC- or FPE-suggested lag order would not grow infinitely. It might just be the case that a VAR(13) model fits the data relatively better than a VAR(3) or VAR(12), even after penalizing the number of parameters in the model. You should also not be surprised that a VAR(3) is selected rather than a VAR(4) when you set maxlag(4). AIC and FPE need not decrease monotonically until the "optimal" lag and increase monotonically after that.