'How to determine maximum lag.length in VAR?
I am trying to estimate the Vector Autoregression model in R, playing around with the max lag length. As I was changing the length, I got mixed results. Below is the output for lag.length=16 (producing normal results), lag.length=20 (warning message: "NaNs produced") and lag.length=25 (also producing normal results).
I would greatly appreciate if somebody could explain what could be the reason of NaNs being produced on lag.length=20 but no such thing happening on 16 (smaller lag length than 20) and 25 (larger length than 20). If I am missing anything, other suggestions are also appreciated.
R output below:
#max.lag=16
varBTC <- VAR_dataBTC_ts %>%
VAR(lag.max=16,ic="AIC")
#max.lag=20
varBTC <- VAR_dataBTC_ts %>%
VAR(lag.max=20,ic="AIC")
Warning messages:
1: In log(sigma.det) : NaNs produced
2: In log(sigma.det) : NaNs produced
3: In log(sigma.det) : NaNs produced
#max.lag=25
varBTC <- VAR_dataBTC_ts %>%
VAR(lag.max=25,ic="AIC")
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
