title: Determine best Arima model based on AIC
body: <p>I'm trying to fit Arima model and see which order is the best based on AIC
  i Have the following for statement, my question is how to show the order of the model because it just gives me AIC values and can't determine which model,,
  mid.ts is time series created by xts
  the data is as follows:</p>
  
  <pre><code> mid.ts= 
                deltao
     Jan 1751  -41.23
      Jan 1754 -41.10
      Jan 1756  -40.25
      Jan 1759  -43.61
      Jan 1761  -41.54
      Jan 1764  -39.79
      Jan 1766   -39.63
      Jan 1769  -40.74
      Jan 1771  -42.63
      Jan 1774  -39.47
      Jan 1776  -40.30
      Jan 1778  -40.30
      Jan 1781  -41.56
  
  library(forecast)
  
  for(d in 0:1){
      for(p in 0:9){
        for(q in 0:9){
  
   fit=Arima(mid.ts,order=c(p,d,q))
    print(AIC(fit))
  
        }
      }
    }
  </code></pre>