I'm working with a time series of 59 elements. I'm wondering why the R function, Arima, throws an NaN for the standard errors of some parameters. I'm trying to model the residuals of a log-quadratic stational model:

arimaModel = Arima(log(myTS),order=c(1,0,1),seasonal=list(order=c(0,0,1)),xreg=myModelParameters, method="ML")

\begin{array}{|c|c|} \hline Parameter & Estimate & Std. Error & T\ Value & P(>|t|) \\\hline ar1 & -5.8991e-01 & NA & NA & NA \\\hline ma1 & 1.0000e+00 & 4.4617e-02 & 22.413 & < 2.2e-16 *** \\\hline sma1 & 3.0305e-01 & NA & NA & NA \\\hline intercept & 8.2949e+00 & 3.4403e-02 & 241.108 & < 2.2e-16 *** \\\hline t & 2.1970e-02 & 1.4813e-03 & 14.831 & < 2.2e-16 *** \\\hline t^2 & -4.4673e-05 & NA & NA & NA \\\hline Q1 & -5.9911e-01 & 2.1024e-02 & -28.497 & < 2.2e-16 *** \\\hline Q2 & -4.2457e-01 & 2.9678e-02 & -14.306 & < 2.2e-16 *** \\\hline Q3 & -3.1433e-01 & 2.1135e-02 & -14.872 & < 2.2e-16 *** \\\hline \end{array}

What could I do with this? Why does this happen? I had switched the method between of the function with CSS, CSS-ML, but it's always the same...

  • $\begingroup$ i forgot to add the last line: dfmodel = 59 - 9; coeftest(arimaModel,df=dfmodel) $\endgroup$ – Callie D. Apr 30 '16 at 22:44

The inverse of the Hessian matrix evaluated at the returned solution contains negative values (the square root of negative values led to the NA values). This typically means that the optimization algorithm failed to converge or that the solution is not reliable. See what arimaModel$code returns: a zero value means that the algorithm converged, otherwise see the documentation ?optim to find out the meaning of the code.

Failure to reach a reliable solution often imply, in turn, that the model is not appropriate for the data; the data do not contain enough information to get reliable estimates for the chosen parameters. Inspecting the Hessian could give you some clue on which variables were troublesome (I think they aren't necessarily the variables with NA standard errors). Unfortunately there isn't an easy way to retrieve the Hessian employed by arima.

I would suggest you to refit the model several times removing one variable at a time in order to see which one may be troublesome. Once detected, rethink whether this variable is relevant to explain the data.

You can also try other optimization algorithms, although they most likely will arrive to the same result. The function arimain the stats package allows you to choose the optimization algorithm:

stats::arima(log(myTS),order=c(1,0,1), seasonal=list(order=c(0,0,1)), 
  xreg=myModelParameters, method="ML", optim.method="Nelder-Mead")   

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.