1
$\begingroup$

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.

   model<-stl(tseries,"periodic")
   forecast<-forecast(model,h=10,method="arima",xreg=xreg,newxreg=newxreg)

2) use stlf directly, i.e.

forecast<-stlf(tseries,h=10,method="arima",xreg=xreg,newxreg=newxreg)

Thanks in advance

$\endgroup$
1
$\begingroup$

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".

$\endgroup$
  • $\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 '13 at 9:35

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.