Solved – Seasonality not taken account of in `auto.arima()`

arimaforecastingrseasonalitytime series

I am having basically the same issue than in this thread, except one thing:

The difference, in my case, is that my data is measured weekly and not daily, so the argument of a too high seasonality (> 350) does not hold for my data, since the seasonality in my case is 52 (52 weeks in a year).

And yet, when I use auto.arima(), R returns the ARIMA model (p,d,q) = (2,1,1) and (P,D,Q) = (0,0,0), while the seasonal pattern in my data is blatant… How could you explain that R completely dismisses the seasonality in my data?

Since I'm still in a learning phase, I am using the data set cmort available in the astsa library, so everyone here can use the same data as me.

And I have done cmort <- ts(cmort,frequency=52) to be sure that the seasonality in my data is taken account of, but it didn't change anything.

Best Answer

(First off, cmort is already a ts object with frequency 52, so you don't need to coerce it.)

I'd say seasonality is visible, not that it is blatant:

library(forecast)
library(astsa)
seasonplot(cmort)

seasonplot

Per the help page (?auto.arima), auto.arima() decides whether or not to take seasonal differences by using a OCSB test. It's quite possible that this test simply got it wrong in this instance; it's a statistical test, after all. You can force a seasonal model by setting D=1, although auto.arima() runs for quite some time with forced seasonality. (Note that the information criteria are not comparable between the original and the differenced series.)

Auto-fitted model:

> auto.arima(cmort)
Series: cmort 
ARIMA(2,1,1)                    

Coefficients:
         ar1     ar2      ma1
      0.0957  0.2515  -0.6435
s.e.  0.4302  0.2444   0.4155

sigma^2 estimated as 33.72:  log likelihood=-1609.89
AIC=3227.77   AICc=3227.85   BIC=3244.68

Model with forced seasonality:

> auto.arima(cmort,D=1)
Series: cmort 
ARIMA(0,0,0)(1,1,0)[52] with drift         

Coefficients:
         sar1    drift
      -0.5737  -0.0257
s.e.   0.0378   0.0041

sigma^2 estimated as 47.7:  log likelihood=-1537.6
AIC=3081.21   AICc=3081.26   BIC=3093.57
Related Question