2
$\begingroup$

I'm a newbie in Time Series Analyses. I'm using ARIMA to make a prediction about my monthly data. So sorry that I cannot post my data here, you can just dump the data to use for example.

I use auto.arima() to build my model and forecast to predict. Both functions are loaded from forecast library. From my understanding, before building the model, we have to remove the trend and seasonal effect from our data, right? So, my question is: do we have to add them back to the predicted value? If we do, then how? Or the predicted values are already counted for trend and season?

Could you please show me an example with plots about this? Thank you so much for your help.

EDIT

I'm adding some plots to this post.

My Data

Here is how my data look like

Deomposition

Then, I decompose it. From this graph, I can see that it has a seasonal effect, no trend, and large remainder. Is it bad, the remainder?

Then, I remove the seasonal effect using seasadj() function, put the adjusted data into the auto.arima(), and make prediction. Then, here is what I got:

Prediction with adjusted data

After reading your answer, I try putting my original data to the auto.arima(), and I got this prediction:

Prediction with original data

So, is everything good? Did I do anything wrong? And I think I should take the second prediction so that I don't have to put the seasonal effect back in? Am I right?

$\endgroup$
4
$\begingroup$
  1. No, you do not need to remove trend and/or seasonality before fitting an ARIMA model.

    These models can handle certain types of trends and certain types of seasonality by themselves, or by including external regressors (the xreg argument, where you could include more complicated related effects like moving holidays, or non-polynomial trends, breaks in the trend, etc).

    Including these regressors is intuitively similar to "removing trend and seasonality first, then ARIMA" (regression-with-ARIMA-errors model), but is done efficiently in one fitting step.

  2. Yes, if you have removed trend and seasonality before fitting an ARIMA model, you will need to "add them back in" to get a forecast of your original series; that is, you need a forecast of the trend and seasonality to add back to your forecast of the rest. In some cases, the "forecast" of the seasonality is known exactly (e.g. the future dates of a moving holiday), which makes it easier.

    If you have removed trend or seasonality by some process which does not define dynamics for these components (e.g. the X11 procedure for seasonality adjustment), then there is no canonical way to do this; you would need to estimate a new model to forecast these components.

Edit: Here's a simple R example for a classic series (AirPassengers) which has both trend and seasonality of a kind which can be reasonably well-captured by a standard (seasonal) ARIMA model, without additional regressors:

library(forecast)

mod <- auto.arima(AirPassengers)
fc <- forecast(mod, h=12)

plot(fc)

forecast

$\endgroup$
  • $\begingroup$ Thanks for your help. So, I just put my data directly in the auto.arima() function and it will do the job for me? Could you provide me an example with code about using data directly or a link to a post to refer? $\endgroup$ – Triet Doan Jan 25 '17 at 12:46
  • $\begingroup$ @AnhTriet It will do what it says on the box: find the best model out of the stated universe of models with respect to the stated criterion. If your data is such that it is not in this universe (or close to), then I wouldn't say the "job" is done. I added an example where it works well. $\endgroup$ – Chris Haug Jan 25 '17 at 13:44
  • $\begingroup$ Thanks for your example. I've just added some plots of my data. Could you please give me some comment about it? :) $\endgroup$ – Triet Doan Jan 25 '17 at 22:57

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.