In package rugarch,
I want to list out the AIC of several garch models in R. But I don't know how to to :(, So I use the loop for to get the infocriteria of them. my code below:
for(i in 1:5)
{
for(j in 1:5)
{
garch11.spec=ugarchspec(variance.model=list(garchOrder=c(i,j)))
garch11.fit=ugarchfit(spec=garch11.spec, data=google_rets)
print(infocriteria(garch11.fit))
}
}
After running 2 models, an error occupts:
Error in itestm[1, 1] <- itest$AIC : replacement has length zero
In addition: Warning messages:
1: In .sgarchfit(spec = spec, data = data, out.sample = out.sample, :
ugarchfit-->warning: solver failer to converge.
2: In log(log(nObs)) : NaNs produced
How can I solve the error?
Could you give me a way to get the AIC from package rugrach