# How to find ARMA order with AIC

I am not quite sure if I understand the concept of the AIC and the model order of a time series model correct. My understanding is that it is some kind of algorithm which looks like

1. Take the ARMA (1,1) model, estimate the parameters via Maximum Likelihood
2. With this Maximum Likelihood, calculate the AIC of the ARMA (1,1)
3. Take the ARMA (1,2), ARMA (2,1) and the ARMA (2,2), estimate the parameters via Maximum Likelihood
4. Take these ML and calculate the AIC of the ARMA (1,2), ARMA (2,1) and the ARMA (2,2)
5. compare the AIC's of these models
6. If the AIC of either the ARMA (1,2), the ARMA (2,1) or the ARMA (2,2) is smaller than the one of the ARMA (1,1) take the next higher orders and repeat the procedure
7. Then if all higher orders have a greater AIC than one of the models with lower orders stop and thus the best model is the one with the smallest AIC
8. Compare the result with the acf and see, if the result could be correct

Can somebody verify, if my thoughts are correct and if not, where I am mistaken?

There is no guarantee that any approach to checking only a subset of all possible ARMA(p,q) with say, $p\leq p_\max$ and $q\leq q_\max$ will yield the AIC-minimal model. If you truly want to get the AIC-minimal model, you will need to look at all $(p_\max+1)\times(q_\max+1)$ possible orders (don't forget pure AR(p) and MA(q) models).
• The heuristic used by theauto.arima() function of the forecast package in R, which I personally consider pretty much the gold standard in automatic ARIMA modeling, is described in Hyndman & Khandakar (2008, JSS). Note that the ACF is not used at all. – S. Kolassa - Reinstate Monica Nov 18 '17 at 19:40