ellisp / forecastHybrid

Convenient functions for ensemble forecasts in R combining approaches from the {forecast} package
GNU General Public License v3.0
79 stars 23 forks source link

nnetar not working with some multi-level prediction intervals #54

Closed ellisp closed 7 years ago

ellisp commented 7 years ago

Spotted this error in the README while working on the branch, and I don't see what I might have done to it.

test_that("forecast nnetar prediction intervals with different levels work", {
   hm2 <- hybridModel(wineind, models = "anst", weights = "equal")
   expect_error(forecast(hm2, h = 48), NA)
   expect_error(forecast(hm2, h = 48, level = c(70, 80, 90, 95)), NA)
})

The first forecast in the above works, the second doesn't:

Error: forecast(hm2, h = 48, level = c(70, 80, 90, 95)) threw an error.
subscript out of bounds

I think there's an easy fix but I wanted to merge in first.

ellisp commented 7 years ago

ok, the nnetar forecast part of forecast.hybridModel was just missing , level = level). I've included the fix in my thetadev pull request.