earowang / hts

Hierarchical and Grouped Time Series
http://pkg.earo.me/hts
110 stars 36 forks source link

Forecast horizon ignored in stlf forecast #17

Closed JocelynBarker closed 8 years ago

JocelynBarker commented 8 years ago

When forecasts are made using the stlf method (one of the methods recommended by the author), the input forecast horizon is ignored and instead the default horizon of 2L * frequency(object$bts) is used. The problem can be reproduced using the code below.

nodes <- list(2, c(3, 2))
abc <- ts(5 + matrix(sort(rnorm(500)), ncol = 5, nrow = 100),frequency=4)
x <- hts(abc, nodes)
forecast(x, h = 4, method = "comb", algorithms = "lu",FUN = stlf)

Thank you!

robjhyndman commented 8 years ago

That problem is actually caused by the forecast package. I'll fix it over there.

robjhyndman commented 8 years ago

Now fixed

JocelynBarker commented 8 years ago

Thanks!