Closed Libardo1 closed 2 years ago
@Libardo1 The error is actually for the creation of naiveMod
. The naive
function in fact produces a class forecast
object whereas the parameter for FUN
needs to be a model object. To handle this kind of scenario, we have the FCFUN
argument where our custom function generates the forecast
class object directly. So try
stlmMod <- cvts(myts, FUN = stlm, windowSize = 36, maxHorizon = 250)
naiveMod <- cvts(myts, FCFUN = naive, windowSize = 36, maxHorizon = 250)
accuracy(naiveMod)
accuracy(stlmMod)
Thanks for your package. I am trying to use it with ggplot2::economics but is not working for me.
myts <- ts(economics$unemploy , start = c(1967,7), frequency = 12, deltat = 1) plot(myts) stl_rw <- stlf(myts, forecastfunction = rwf)
Then stlmMod <- cvts(myts, FUN = stlm, windowSize = 36, maxHorizon = 250) naiveMod <- cvts(myts, FUN = naive, windowSize = 36, maxHorizon = 250) accuracy(stlmMod) I receive this error message Error in { : task 1 failed - "Please select a longer horizon when the forecasts are first computed"
I change maxHrizon from 12 to 250 and the error is the same.
I would apreciate any hint to solved it.