title: Passing different forecasting method to hierarchical time series forecast in R?
body: <p>I have a hierarchical time series, the bottom level series of which all exhibit intermittent demand. It seems advantageous to use Hyndman's HTS package for optimal combination within the hierarchy. It also seems advantageous to use Kourentzes' MAPA package for multiple aggregation prediction of the intermittent demand. In essence, I want to do something like:</p>
  
  <p><code>forecast(my_hts, method='comb', fmethod='MAPA')</code> </p>
  
  <p>However, it is unclear to me if / how I can combine the two, since <code>forecast.gts()</code> only accepts <code>fmethod=c("ets", "arima", "rw").</code> </p>
  
  <p>Is there a clever way to pass different forecasting methods to <code>forecast.gts()</code> without having to tear up the code?</p>
  
  <p>Example to clarify what I mean:</p>
  
  <pre><code>library(hts)
  library(MAPA)
  set.seed(1)
  
  #note intermittent demand of bottom level time series
  x &lt;- ts(rpois(365, lambda=0.05), frequency=365, start=2014)
  y &lt;- ts(rpois(365, lambda=0.07), frequency=365, start=2014)
  
  #it's easy to make a MAPA forecast for the top-level time series
  #but this isn't an optimal hierarchical forecast
  mapasimple(x+y)
  
  #it's also easy to make this a HTS and make an optimal hierarchical forecast
  #but now I cannot use MAPA
  z &lt;- hts(data.frame(x,y)))
  z_arima &lt;- forecast(z, fmethod="arima")
  z_rw &lt;- forecast(z, fmethod="rw")
  z_ets &lt;- forecast(z, fmethod="ets")
  
  #z_MAPA &lt;- ?
  </code></pre>