ensemble_base: Fit a series of univariate models and return a weighted...

Description Usage Arguments Details Value

View source: R/ensemble_base.R

Description

This function fits six simple univariate forecast models to the series and calculates weights that minimise the mean absolute scaled error of a weighted ensemble forecast

Usage

1
2
3
4
5
6
7
8
ensemble_base(
  y,
  frequency,
  lambda = NULL,
  k = 1,
  bottom_series = FALSE,
  discrete = FALSE
)

Arguments

y

A ts object containing the series to forecast

frequency

The seasonal frequency of y

lambda

numeric. The Box Cox power transformation parameter for all series. Must be between -1 and 2 inclusive. If y contains zeros, lambda will be set to max(c(0.7, lambda)) to ensure stability of forecasts

k

integer specifying the length of the forecast horizon in multiples of frequency

bottom_series

logical. If TRUE, the two auto.arima models will be ignored to ensure bottom level series forecasts are not overconfident

discrete

logical Is the series in y discrete? If TRUE, use a copula-based method relying on the Probability Integral Transform to map the series to an approximate Gaussian distribution prior to modelling. Forecasts are then back-transformed to the estimated discrete distribution that best fits y. Default is FALSE

Details

A total of seven simple univariate models are tested on the series. These include stlf with an AR model for the seasonally-adjusted series, ets, auto.arima, auto.arima with fourier terms K = 4 regressors, rwf with drift, naive and snaive. The mean absolute scaled error (MASE) of the in-sample series is calculated for each series, and a weighted mean is optimised to minimise in-sample MASE using the "L-BFGS-B" algorithm in optim.

Value

A list object containing the ensemble forecast and the ensemble residuals


nicholasjclark/mvforecast documentation built on Dec. 22, 2021, 2:11 a.m.