Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

baggedModel

Forecasting using a bagged model


Description

The bagged model forecasting method.

Usage

baggedModel(y, bootstrapped_series = bld.mbb.bootstrap(y, 100), fn = ets, ...)

baggedETS(y, bootstrapped_series = bld.mbb.bootstrap(y, 100), ...)

Arguments

y

A numeric vector or time series of class ts.

bootstrapped_series

bootstrapped versions of y.

fn

the forecast function to use. Default is ets.

...

Other arguments passed to the forecast function.

Details

This function implements the bagged model forecasting method described in Bergmeir et al. By default, the ets function is applied to all bootstrapped series. Base models other than ets can be given by the parameter fn. Using the default parameters, the function bld.mbb.bootstrap is used to calculate the bootstrapped series with the Box-Cox and Loess-based decomposition (BLD) bootstrap. The function forecast.baggedModel can then be used to calculate forecasts.

baggedETS is a wrapper for baggedModel, setting fn to "ets". This function is included for backwards compatibility only, and may be deprecated in the future.

Value

Returns an object of class "baggedModel".

The function print is used to obtain and print a summary of the results.

models

A list containing the fitted ensemble models.

method

The function for producing a forecastable model.

y

The original time series.

bootstrapped_series

The bootstrapped series.

modelargs

The arguments passed through to fn.

fitted

Fitted values (one-step forecasts). The mean of the fitted values is calculated over the ensemble.

residuals

Original values minus fitted values.

Author(s)

Christoph Bergmeir, Fotios Petropoulos

References

Bergmeir, C., R. J. Hyndman, and J. M. Benitez (2016). Bagging Exponential Smoothing Methods using STL Decomposition and Box-Cox Transformation. International Journal of Forecasting 32, 303-312.

Examples

fit <- baggedModel(WWWusage)
fcast <- forecast(fit)
plot(fcast)

forecast

Forecasting Functions for Time Series and Linear Models

v8.14
GPL-3
Authors
Rob Hyndman [aut, cre, cph] (<https://orcid.org/0000-0002-2140-5352>), George Athanasopoulos [aut], Christoph Bergmeir [aut] (<https://orcid.org/0000-0002-3665-9021>), Gabriel Caceres [aut], Leanne Chhay [aut], Mitchell O'Hara-Wild [aut] (<https://orcid.org/0000-0001-6729-7695>), Fotios Petropoulos [aut] (<https://orcid.org/0000-0003-3039-4955>), Slava Razbash [aut], Earo Wang [aut], Farah Yasmeen [aut] (<https://orcid.org/0000-0002-1479-5401>), R Core Team [ctb, cph], Ross Ihaka [ctb, cph], Daniel Reid [ctb], David Shaub [ctb], Yuan Tang [ctb] (<https://orcid.org/0000-0001-5243-233X>), Zhenyu Zhou [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.