# Do I have to add the seasonal effect and trend back to ARIMA forecast?

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?

## EDIT

I'm adding some plots to this post.

Here is how my data look like

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:

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

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?

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)


• 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? – Triet Doan Jan 25 '17 at 12:46
• @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. – Chris Haug Jan 25 '17 at 13:44
• Thanks for your example. I've just added some plots of my data. Could you please give me some comment about it? :) – Triet Doan Jan 25 '17 at 22:57