# Auto.Arima and Arima Output Differences

I am studying a time series using ARIMA. Initially, I used the function auto.arima from the package forecast to identify the best possible fit, however I successively moved to Arima (from the same package) because I am interested in the data trends, i.e. if I record a drift. Therefore, what I did was to find the best ARIMA order according to auto.arima and use it in Arima to get the drift.

However, while I was reviewing the results, I noticed some differences between the parameters recorded with auto.arima and with Arima. Below you find a MWE of my code (I just started to use R coming from Matlab, so I think you will notice the code is not very elegant)

#INITIALIZE
rm(list=ls())
require(xlsx)
require(forecast)
graphics.off()
cat("\014")

Fit2 <- matrix(data = NA, nrow = 3, ncol = 1)
Fit3 <- vector(mode ="logical", length = 1)

#ENTER THE DATA
Test <- c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.000207039, 0.000322061, 0.000247249, 9.46701E-05, 0, 0, 4.16858E-05, 3.24844E-05, 0, 4.27707E-05, 3.59383E-05, 1.53737E-05, 1.33383E-05, 0, 1.04153E-05, 1.87117E-05, 1.69627E-05, 7.75212E-06, 0)

print((auto.arima(Test ,seasonal = FALSE, allowdrift = TRUE)))
Fit2[1:3,1] <- arimaorder(auto.arima(Test ,seasonal = FALSE, allowdrift = TRUE))
Fit3[1] <- Arima(Test , order = Fit2[1:3,1], seasonal = FALSE, include.drift = TRUE)
print(Fit3[1]) #Arima(Test , order = Fit2[1:3,1], seasonal = FALSE))


I see my experimental dataset is poor in the first half, so it may not be a wise move to use such a high order ARIMA, however I trusted what auto.arima suggested me. Is this a mistake? If not, why do I record this difference between outputs coming from auto.arima and Arima? I am particularly surprised because I thought Arima and auto.arima worked with the same algorithm.

• Yes, they work on same algos. In-fact Auto.Arima takes few set of values for (p,d,q) and fit the order which gives least AIC/BIC. I have taken your data and replicated the situation and yes parameter values are different.I have taken another data-set. Test <- c(0,0....,2,3,5,5,7,9,12,56,67,34,78,99,124,156,190,290,300,310,320,546, 1000, 2300, 4500) and applied auto.arima and arima with order suggested by auto.arima . I get same values in output. Your data seems very different, all the values are almost 0. Tried few things but unable to figure out explanation of your question. – Arpit Sisodia May 27 '17 at 10:55