fable Model Wrapper
fable_model.Rd
Provides an interface for models from the fable
package.
Note the feasts::ARIMA
model requires the feast
package. If future
is being used fable
will require future.apply
in
order to not silently fail.
Arguments
- y
Numeric vector of time points to forecast
- samples
Numeric, number of samples to take.
- horizon
Numeric, the time horizon over which to predict.
- model
A
fable
model object. For models that use a formula interface time can be accessed usingtime
.
Value
A dataframe of predictions (with columns representing the time horizon and rows representing samples).
Examples
if (FALSE) {
## Used on its own
fable_model(
y = EpiSoon::example_obs_rts[1:10, ]$rt,
model = fable::ARIMA(y ~ time),
samples = 10, horizon = 7
)
forecast_rt(EpiSoon::example_obs_rts[1:10, ],
model = function(...) {
fable_model(model = fable::ARIMA(y ~ time), ...)
},
horizon = 7, samples = 10
)
}