# Holt Winters with exogenous regressors in R

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?

• 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. – Richard Hardy Jun 27 '16 at 11:34
• – Rob Hyndman Jun 27 '16 at 17:54

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

• Thanks a lot. I will try exponential smoothing model fitting algorithm on the residuals and also will investigate my data – Python123 Jun 27 '16 at 17:54
• 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? – user2974951 Jul 7 '19 at 10:45
• @user2974951: no, nothing new I am aware of. I would write the same answer again today. – Stephan Kolassa Jul 7 '19 at 13:36