1
$\begingroup$

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

$\endgroup$
2
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ Very helpful. Also I think I could use HoltWinters() function and then predict 1 day-ahead (48 observations) and calculate the MAPE to compare with the ARIMA. Thanks! $\endgroup$ – Iciar Aug 10 '18 at 18:50
1
$\begingroup$

The Taylor paper uses double seasonal Holt Winters models, which are implemented in the dshw() function in the forecast package. The help file provides an example applying dshw() to the taylor data set:

library(forecast)
fcast <- dshw(taylor)
autoplot(fcast)

enter image description here

$\endgroup$
  • $\begingroup$ Great. The Taylor paper also uses a training set of 8 weeks and a testing set of 4 weeks, and the calculates the MAPE for h=1,...48 periods ahead. How can I make the code in R to obtain the same results of that paper? I was reading your book, otexts.org/fpp2/forecasting-on-training-and-test-sets.html and trying to do something similar, but I'm not sure $\endgroup$ – Iciar Aug 11 '18 at 9:19

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.