Generic function for forecasting
future values of a time series from an ADE-class
model or a
DETS-class
model.
forecast(object, h)# S4 method for ADE
forecast(object, h)
# S4 method for DETS
forecast(object, h)
predictive model object. A ADE-class
or a DETS-class
ensemble object;
steps to forecast
predict
for the predict method; update_weights
for updating the weights of a model after forecasting; update_base_models
for updating the base models of an ensemble.
# NOT RUN {
specs <- model_specs(
learner = c("bm_svr", "bm_glm", "bm_mars"),
learner_pars = NULL
)
data("water_consumption")
dataset <- embed_timeseries(water_consumption, 5)
train <- dataset[1:500, ]
model <- DETS(target ~., train, specs)
model2 <- ADE(target ~., train, specs, lambda = 30)
next_vals_dets <- forecast(model, h = 2)
next_vals_ade <- forecast(model2, h = 2)
# }
Run the code above in your browser using DataLab