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., for the Double Seasonal Holt-Winters using dshw
in R
, but I get different MAPE values.
This is my code for 2 periods-ahead, based on https://otexts.org/fpp2/forecasting-on-training-and-test-sets.html and https://robjhyndman.com/hyndsight/rolling-forecasts/ by Rob J. Hyndman:
library("forecast")
train <- msts(taylor[1:2688], seasonal.periods=c(48,336), ts.frequency=48)
test <- msts(taylor[2689:4032], seasonal.periods=c(48,336), ts.frequency=48, start=57)
fit <- dshw(train, armethod=FALSE)
h=2
n <- length(test) - h + 1
fc <- ts(numeric(n), start=2688+h)
for(i in 1:n)
{
x <- msts(taylor[1:2688+i-1], seasonal.periods=c(48,336), ts.frequency=48)
refit <- dshw(x, model=fit, armethod=FALSE)
fc[i] <- forecast(refit, h=h)$mean[h]
}
mape <- mean(abs(taylor[(2688+h):4032]-fc)/taylor[(2688+h):4032])*100)
Can I do this for h=1,...48 in a for
loop and plot the mape values I get or this is not the way to do it?
The MAPE results should be the dots shown in next figure:
dshw
in the training set) because I am not completely sure what I obtain doing this $\endgroup$ – Iciar Aug 11 '18 at 11:26