I am trying to decompose and forecast a weekly time series which is believed to be affected by moving holidays (e.g. Chinese New Year, which happens in different weeks of a year). I would like create a regressor variable to reflect the holiday effect on the series. Is it correct to use the regressor variable as xreg in forecasting stl object / stlf?

Also, I would like to know the difference between the following methods, and whether they are doing the job I wanted.

1) decompose using stl, then forecast the decomposed object, i.e.


2) use stlf directly, i.e.


Thanks in advance


1 Answer 1


Either should work ok. The model for the seasonally adjusted series is a linear regression with ARIMA errors.

The only difference is that stlf() sets s.window=7 by default so the seasonal component will change slowly over time, whereas you have set it to be unchanging in the first block of code by specifying s.window="periodic".

  • $\begingroup$ Thank you for your reply. I would also know how does the regressor work. Does the regressor regress on the remainder to find out the effect (coefficient)? Is regression performed at the decomposition stage or forecast stage? Thanks again in advance Jonathan $\endgroup$
    – Jonathan
    Apr 22, 2013 at 9:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.