Solved – Holt-Winters function hw() in R

forecastingpredictionr

I would like to use the hw method from the R forecast package to predict electricity consumption. I tried to use it on the taylor dataset available in the package. I'm trying to get the same results reported in the paper Taylor, J.W. (2003) Short-term electricity demand forecasting using double seasonal exponential smoothing. Journal of the Operational Research Society, 54, 799-805., but when I use function ts() with frequency $= 48$ (daily seasonality, half-hourly data) I get the error

"Error in ets(x, "MAM", alpha = alpha, beta = beta, gamma = gamma, phi = phi,  : 
  Frequency too high" 

I found that function ets() can just deal with maximum frequency $= 24$, but I would like to know how to solve this, which other function can I use or how can I get the results shown in Taylor 2003.

enter image description here

Best Answer

The author of ets() discusses why it limits seasonality to length 24 here.

You can try using ARIMA instead, per Hyndman. I believe you want to model two different seasonal cycles-- hourly, with seasonal length of 48, and day of week, with seasonal length of 7. Combining those and having one seasonal cycle of 336 probably won't work well, per Hyndman.

To get ets() to work, you could split your data into AM/PM. That will reduce each to 24 periods.