# auto.arima and Arima (forecast package)

I am facing a strange issue with the auto.arima() function. On a dataset named data, I run the following code

auto.arima(data,d=0,D=1,xreg=1:length(data),max.p=3,max.q=3,max.order=10,
seasonal=TRUE,stepwise=FALSE,approximation=FALSE,ic=("aic"),parallel=TRUE)


The outcome is

   Series: data
ARIMA(1,0,3)(2,1,2)[12]

Coefficients:
ar1      ma1      ma2     ma3    sar1     sar2     sma1    sma2  1:length(data)
0.6939  -0.6417  -0.2391  0.4350  0.6197  -0.5055  -1.3211  0.6027   5e-04
s.e.  0.1349   0.1654   0.1169  0.1502  0.3040   0.1762   0.3907  0.4269   3e-04

sigma^2 estimated as 0.001792:  log likelihood=143.69
AIC=-267.38   AICc=-264.79   BIC=-241.73


Then I try to fit this model using the Arima function:

 Arima(data,order=c(1,0,3),seasonal=list(order=c(2,1,2),period=12),
xreg=1:length(data),method="ML")


but I get the following error message:

 Error in optim(init[mask], armafn, method = optim.method, hessian = TRUE,  :
non-finite finite-difference value [1]


Does someone understand why this appears ?

• (1) According to the error, at some point of the optimization procedure the likelihood function was evaluated to a non-finite or not-a-number value (probably because the procedure entered a non-feasible region of parameters). (2) auto.arima may be solving the minimization of the conditional sum of squares instead of the maximization of the likelihood function. I think the former is the default for series with more than 100 observations. Try using method="CSS" instead of method="ML" and see if you then get the same results. – javlacalle Oct 29 '14 at 10:16
• Well I took the time to dive into the code behind auto.arima and it seems that your idea was the good one except that the default method is actually CSS-ML. When I adapt this option and re-run the code, I get the same model. Thanks for the support. – Ludo Oct 29 '14 at 10:22
• Ludo, Can you post your dataset? – Tom Reilly Nov 5 '14 at 7:44
• @TomReilly: Thanks but the problem is solved thanks to the previous comment made by javlacalle. – Ludo Nov 5 '14 at 10:06
• So is this error not truly problematic as long as you stay away from the parameter values that caused it? – BallpointBen Apr 27 '18 at 17:42