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 <- Arima(Test , order = Fit2[1:3,1], seasonal = FALSE, include.drift = TRUE) print(Fit3) #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
Arima? I am particularly surprised because I thought
auto.arima worked with the same algorithm.