3
$\begingroup$

I'm trying to fit a seasonal arima model with the following very simple timeseries which has also a linear trend:

time_series = ts(c(6, 18, 30, 80, 65, 40, 67, 47, 57, 82, 67, 82, 66, 78, 90, 140, 125, 100, 127, 107, 117, 142, 127, 142, 126, 138, 150, 200 ,185, 160, 187, 167 ,177, 202 ,187, 202, 186, 198, 210, 260 ,245 ,220, 247, 227 ,237, 262, 247, 262), frequency=12).

In order to catch the seasonality, I set the parameter D=1 in the auto.arima function.

The output model is:

ARIMA(0,0,0)(0,1,0)[12] with drift         

Coefficients:
drift  
 60  

sigma^2 estimated as 448046:  log likelihood=-284.8
AIC=571.6   AICc=571.72   BIC=573.19

So the forecast model should be y_t -y_{t-12} = drift and it should be right. But, when I do the forecast I obtain the following values:

       Point Forecast     Lo 80    Hi 80     Lo 95    Hi 95
 Jan 5            906  48.17781 1763.822 -405.9258 2217.926
 Feb 5            918  60.17781 1775.822 -393.9258 2229.926
 Mar 5            930  72.17781 1787.822 -381.9258 2241.926
 Apr 5            980 122.17781 1837.822 -331.9258 2291.926
 May 5            965 107.17781 1822.822 -346.9258 2276.926
 Jun 5            940  82.17781 1797.822 -371.9258 2251.926

which is too high:

forecast

It seems that the forecasting model is y_t -y_{t-12} = drift * 12 and it is wrong.

Could you give me some hints in order to understand what is happening? I am using the forecast package version 8.4 on R 3.5.1.

$\endgroup$
  • 1
    $\begingroup$ This looks badly broken. I'll ping Rob Hyndman and ask him to take a look. $\endgroup$ – Stephan Kolassa Jul 12 '18 at 18:38
  • $\begingroup$ In the meantime: I do not believe this should be closed as off-topic. I believe that this question is not purely about the forecast package, but will require some statistical understanding to answer. Please do not close. $\endgroup$ – Stephan Kolassa Jul 12 '18 at 18:39
  • $\begingroup$ I agree with @StephenKolassa this requires statistical analysis and should not be closed. $\endgroup$ – forecaster Jul 12 '18 at 23:31
3
$\begingroup$

The problem here is that the model is "perfect" in that $y_t - y_{t-12}=60$ without error for all $t$. So an ARIMA model will have zero residuals. The stats::arima() function won't fit such a model without return an error. forecast::auto.arima() tries to be more helpful and returns the model with zero residuals. Unfortunately, there was a bug which occurred only when $y_t-y_{t-m}=c$ in which case the "estimated" constant was $cm$ rather than $c$. I've fixed it on github.

$\endgroup$
  • $\begingroup$ @Guido: If you found this answer helpful, then please consider upvoting and/or accepting it. $\endgroup$ – Stephan Kolassa Jul 13 '18 at 6:55

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.