Combines multiple model definitions (passed via ...) to produce a model combination definition using some combination function (cmbn_fn). Currently distributional forecasts are only supported for models producing normally distributed forecasts.

combination_model(..., cmbn_fn = combination_ensemble, cmbn_args = list())

Arguments

...

Model definitions used in the combination.

cmbn_fn

A function used to produce the combination.

cmbn_args

Additional arguments passed to cmbn_fn.

Details

A combination model can also be produced using mathematical operations.

Examples

if (requireNamespace("fable", quietly = TRUE)) { library(fable) library(tsibble) library(tsibbledata) # cmbn1 and cmbn2 are equivalent and equally weighted. aus_production %>% model( cmbn1 = combination_model(SNAIVE(Beer), TSLM(Beer ~ trend() + season())), cmbn2 = (SNAIVE(Beer) + TSLM(Beer ~ trend() + season()))/2 ) # An inverse variance weighted ensemble. aus_production %>% model( cmbn1 = combination_model( SNAIVE(Beer), TSLM(Beer ~ trend() + season()), cmbn_args = list(weights = "inv_var") ) ) }
#> Warning: 1 error encountered for cmbn1 #> [1] .data contains implicit gaps in time. You should check your data and convert implicit gaps into explicit missing values using `tsibble::fill_gaps()` if required.
#> Warning: 1 error encountered for cmbn2 #> [1] .data contains implicit gaps in time. You should check your data and convert implicit gaps into explicit missing values using `tsibble::fill_gaps()` if required.
#> Warning: 1 error encountered for cmbn1 #> [1] .data contains implicit gaps in time. You should check your data and convert implicit gaps into explicit missing values using `tsibble::fill_gaps()` if required.
#> # A mable: 1 x 1 #> cmbn1 #> <model> #> 1 <NULL model>