forecast: Forecasting using an ensemble predictive model

Description Usage Arguments Note See Also Examples

Description

Generic function for forecasting future values of a time series from an ADE-class model or a DETS-class model.

Usage

1
2
3
4
5
6
7
forecast(object, h)

## S4 method for signature 'ADE'
forecast(object, h)

## S4 method for signature 'DETS'
forecast(object, h)

Arguments

object

predictive model object. A ADE-class or a DETS-class ensemble object;

h

steps to forecast

Note

the forecast generic in tsensembler assumes that the data is purely auto-regressive (no external variables), and that the target variable is the first column of the data provided. For a different data setup, the predict methods (predict) can be used (with successive calls with updates for multi-step forecasting).

See Also

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.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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)

vcerqueira/tsensembler documentation built on Oct. 28, 2020, 11:46 p.m.