I have a hierarchical time series, a series of the lower level of which all shows periodic demand. It seems beneficial to use the Hyndman HTS package for the optimal combination within the hierarchy. It also seems advisable to use the Kourentzes MAPA package for multiple forecasting of intermittent demand. In essence, I want to do something like:
forecast(my_hts, method='comb', fmethod='MAPA')
However, it is not clear to me whether it is possible / to combine the two, since forecast.gts()it only acceptsfmethod=c("ets", "arima", "rw").
Is there a smart way to pass different forecasting methods on forecast.gts()without having to break the code?
An example to clarify what I mean:
library(hts)
library(MAPA)
set.seed(1)
x <- ts(rpois(365, lambda=0.05), frequency=365, start=2014)
y <- ts(rpois(365, lambda=0.07), frequency=365, start=2014)
mapasimple(x+y)
z <- hts(data.frame(x,y)))
z_arima <- forecast(z, fmethod="arima")
z_rw <- forecast(z, fmethod="rw")
z_ets <- forecast(z, fmethod="ets")