I am trying to do multiple arimas with the for function.
So far my attempt is this.
for(p in 0:20){
for(q in 0:20){
for (d in 0:3) {
fit <- arima(y, order=c(p,d,q),method="ML")
acc <- accuracy(fit)
print(p);print(d);print(q)
}
}
}
I want to get all the accuracy vectors in one dataset, for every arima, with 3 extra columns with p,d,q.
Then I'd like to rescue the log-likelihood of the model and AIC
So the final output should be a dataframe that looks like this, where every line is one model.
ME RMSE MAE MPE MAPE MASE ACF1 loglikeli AIC p d q
Training set x x x x x x x x x x x x
Training set w w w w w w w w w w w w
Training set y y y y y y y y y y y y
```