2
$\begingroup$

I need to forecast using HoltWinters with regression parameters using R. But I found there is not any option of xreg in HoltWinters function in R. I thought to use auto.arima with xreg option but my HoltWinters is performing better than auto.arima without any regression parameters.

Can you please suggest me how to incorporate xreg in HoltWinters function in R?

$\endgroup$
  • 1
    $\begingroup$ Including external regressors in exponential smoothing-type models is nontrivial. You would have to look up the newest works of Rob J. Hyndman and colleagues, they might be developing something in that direction, but I doubt there are any software implementations as of now. $\endgroup$ – Richard Hardy Jun 27 '16 at 11:34
  • $\begingroup$ See robjhyndman.com/hyndsight/ets-regressors $\endgroup$ – Rob Hyndman Jun 27 '16 at 17:54
5
$\begingroup$

As Richard Hardy comments, exponential smoothing methods like Holt-Winters typically do not allow for external regressors.

On the one hand, extending the state space framework in which forecast::ets() is fitted to incorporate external regressors should be straightforward. You may want to look at Forecasting with Exponential Smoothing - The State Space Approach by Hyndman, Koehler, Ord & Snyder. However, I do not know of any implementation, so you would need to code this up by yourself.

On the other hand, you could take inspiration from the way forecast::auto.arima() actually models external regressors. Contrary to first impressions, this is not an ARIMAX model, but a regression with ARIMA errors.

This suggests a way forward: you could simply regress your time series against your regressors (using, say, lm()), and then run your favorite exponential smoothing model fitting algorithm (stats::HoltWinters() or forecast::ets()) on the residuals from this original regression. This would do something different from a true state space model, but it might be worth looking at.

(And if your Holt-Winters model gives you better results than auto.arima() with regressors, you may want to investigate your model and/or data a bit more. Perhaps your regressors are in reality not all that relevant. Or you have something else in your data that it hard to handle for auto.arima(), e.g., , missing data, long seasonal cycles or something similar.)

$\endgroup$
  • $\begingroup$ Thanks a lot. I will try exponential smoothing model fitting algorithm on the residuals and also will investigate my data $\endgroup$ – Python123 Jun 27 '16 at 17:54
  • $\begingroup$ It has been 3.5 years now since this post, do you have any new information on the subject? Do you still think this is feasible? Any implementations in R? $\endgroup$ – user2974951 Jul 7 '19 at 10:45
  • $\begingroup$ @user2974951: no, nothing new I am aware of. I would write the same answer again today. $\endgroup$ – Stephan Kolassa Jul 7 '19 at 13:36

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.