I am trying to fit a time series using the function auto.arima and I face some strange results.
As a first try, I use the command
auto.arima(data,d=0,D=1,max.p=2,max.q=2,max.P=2,max.Q=2,max.order=8, xreg=xreg_past,trace=TRUE,ic="aic")
The model I get is an ARIMA(2,0,2)(0,1,1)[12] with an AIC equal to -300.14.
But since I know that this command will make use of the stepwise selection algorithm, I want to make a try with the tests of all possible models using the option stepwise=FALSE.
I thus try the command
auto.arima(data,d=0,D=1,max.p=2,max.q=2,max.P=2,max.Q=2,max.order=8, xreg=xreg_past,stepwise=FALSE,trace=TRUE,ic="aic")
And now, the model I get is an ARIMA(0,0,2)(2,1,0)[12] with an AIC equal to -293.14. Since my second attempt takes all the models into account, this result is strange as the previous model had a lower AIC. Furthermore, If I take a look in the trace of the last function call, I see that the ARIMA(2,0,2)(0,1,1)[12] model has now an AIC of -245.13 which explains why it has been rejected. Why did the AIC value change ?
At least, if I use the simple command
arima(data, order=c(2,0,2), seasonal= list(order=c(2,1,2), period=12), xreg=xreg_past)
I get an AIC value of -319.15, which is better that the two models provided before.
I think I am missing something important but I am not able to see what. Can somebody help me ?
Thanks in advance,
Regards,
Ludo