I am surprised how often the auto.arima function from the "forecast" package in R returns straight linear forecasts when there appears to be fairly strong seasonality in the historic data.

I've attached an example:


The data is annual and varies significantly but the forecast is completely linear.

What am I doing wrong?

  • $\begingroup$ CV is not the most appropriate form for code checking, can you be more specific on your issue, to inform other readers better? $\endgroup$ – Joe_74 Apr 21 '16 at 14:24
  • $\begingroup$ why don't you post the data in an excel format and I will try and answer your question $\endgroup$ – IrishStat Apr 21 '16 at 14:25
  • 3
    $\begingroup$ You say data is annual, then how can it have strong seasonality? $\endgroup$ – forecaster Apr 21 '16 at 14:28
  • $\begingroup$ @forecaster which is in part why I wanted to see the data. $\endgroup$ – IrishStat Apr 21 '16 at 16:15
  • $\begingroup$ swenham, I was going through my old answers and noticed this one was not accepted. Do you perhaps need further clarification? $\endgroup$ – Richard Hardy Feb 13 '17 at 15:41

If you specify the time series to have frequency=1, you are explicitly ruling out seasonal patterns in them, and also ruling out seasonal models in auto.arima. That is, SARIMA models will not be considered during the model selection process in auto.arima.

If you have seasonal data, you should specify the number of periods in a full seasonal cycle, e.g. frequency=12 for monthly data. When supplied to auto.arima, such a series would allow for SARIMA models to be considered and hence for forecasts reflecting seasonality.

(In principle, even yearly data could be seasonal if there were something special about every odd year but not even year. Then you could try specifying frequency=2.This is just an example.)


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.