0
$\begingroup$

I'm trying to forecast a daily time series while taking into consideration the effect of weekends and holidays using different methods in R. For arima() it was simply done by adding a dummy variable in the xreg argument. But for other methods such as : ets() tbats() stlm() theta() etc... I couldn't find how to accomplish the same thing.

Any through, guidance or advice will be greatly appreciated.

$\endgroup$
1

2 Answers 2

3
$\begingroup$

ets() can't take external regressors. See here for a discussion.

tbats() should be able t model weekends without using dummy variables. If your holidays are regular, it might be able to capture them without dummy variables.

stlm() isn't really suitable for your task. I don't know about theta().


ets() can capture only one seasonality, so it will capture weekends if a 7 day periodicity is the only seasonality present in the data, otherwise it will not work too well.

If you have your heart set on using ets() then you should filter out the holidays first. The software I work with for retail demand forecasting uses exponential smoothing models (similar to ets()) and the way we deal with moving holidays is we remove them from the data first, then apply the forecasting algorithm, the bring back the holiday effect into the final forecast.

However, you are probably better off using a more suitable method. BSTS fits a state space model similar to ets() but can handle multiple seasonalities (by using a trigonometric seasonal component similar to TBATS) and can also take into account holidays. Facebook Prophet can handle multiple seasonalities and moving holidays as well, although it doesn't use state space methods like BSTS or ets().

$\endgroup$
3
  • $\begingroup$ I read the article but since it dates back to 2012 I wanted to make sure that there is no way to add external regressors to ets() models. That's() as you said can capture the effect of weekends but it doesn't perform well with holidays especially the moving ones. Do you know of any way to capture weekends using ets() ? Is it an impossible task ? $\endgroup$
    – Taha
    Aug 30, 2018 at 14:30
  • $\begingroup$ @Taha see my edit to the answer. $\endgroup$
    – Skander H.
    Aug 30, 2018 at 17:29
  • $\begingroup$ Thanks for your help .. I think I'll to use a similar approach to what you do. $\endgroup$
    – Taha
    Aug 30, 2018 at 18:01
1
$\begingroup$

Unobserved Component Models is also from the state space family (like ETS) and can have regressors. It's available in R in the rucm package. fasster sounds intriguing too, I hadn't yet heard of that.

Also, in general you should be able to model weekends with a 7 day season frequency (I'm assuming your data is daily).

$\endgroup$
3
  • $\begingroup$ I'm familiar with the rucm package. But never heard of fasster, I'll be following it's development.. Thanks for the information. However I need to find a way to model weekends and holidays using the methods I mentioned above. $\endgroup$
    – Taha
    Aug 30, 2018 at 14:39
  • $\begingroup$ It may not be possible to do it as part of the modeling process-- your research isn't lacking. With a forecast I do for my company we ignore weekends but do need to account for days around holidays. I use ets in SAS with its PROC ESM. I have a separate statistical process that runs monthly where I determine the % difference on holiday-affected days, and whether or not its significant; then those significant adjustments are used to both a)adjust the history to normalize past holidays and b)adjust the forecast to anticipate the effect of a future holiday. $\endgroup$ Aug 30, 2018 at 14:44
  • $\begingroup$ thanks for sharing your experience .. Based on your comments and Alex's I think if I were to use ets() models I would have to model weekends and Holiday's effect separately in a way that resembles yours.. I appreciate your help. $\endgroup$
    – Taha
    Aug 30, 2018 at 17:57

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.