title: hierarchical forecast (hts package) R uneven groups and custom forecast
body: <p>I am going through the read me for the hts package. I am interested in trying out the custom forecast section, which requires looping through each series with a specified forecast function. The example provided shows even number of groups. I would like to know how can I run custom forecasts with uneven number of groups, and then recombining them into a gts object.</p>
  
  <pre><code>bts &lt;- ts(5 + matrix(sort(rnorm(500)), ncol=5, nrow=100))
  y &lt;- hts(bts, nodes=list(2, c(3, 2)))
  
  allts_y &lt;- aggts(y)
  allf &lt;- matrix(allts_y, nrow=100, ncol=ncol(allts_y))
  
  for(i in 1:ncol(allts_y))
    allf[,i] &lt;- forecast(auto.arima(allts_y[,i]), h=10)$mean
  allf &lt;- ts(allf, start=1)
  
  # below code is where I run into a hang-up
  g &lt;- matrix(c(rep(2, 5), rep(3, 5), rep(1:5, 2)), nrow = 2, byrow = T)
  y.f &lt;- combinef(allf, groups = g)
  </code></pre>