reconcilethief_restrict: Reconcile temporal hierarchical forecasts

Description Usage Arguments Value See Also

View source: R/utils.R

Description

A wrapper for reconcilethief that takes forecasts of time series at all levels of temporal aggregation and combines them using the temporal hierarchical approach of Athanasopoulos et al (2016). Non-negative optimisation constraints are used when forecasts must not be negative

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
reconcilethief_restrict(
  forecasts,
  comb = c("struc", "mse", "ols", "bu", "shr", "sam"),
  mse = NULL,
  residuals = NULL,
  returnall = TRUE,
  aggregatelist = NULL,
  max_agg = NULL,
  nonnegative = FALSE
)

Arguments

forecasts

List of forecasts. Each element must be a time series of forecasts, or a forecast object. The number of forecasts should be equal to k times the seasonal period for each series, where k is the same across all series.

comb

Combination method of temporal hierarchies, taking one of the following values:

"struc"

Structural scaling - weights from temporal hierarchy

"mse"

Variance scaling - weights from in-sample MSE

"ols"

Unscaled OLS combination weights

"bu"

Bottom-up combination – i.e., all aggregate forecasts are ignored.

"shr"

GLS using a shrinkage (to block diagonal) estimate of residuals

"sam"

GLS using sample covariance matrix of residuals

mse

A vector of one-step MSE values corresponding to each of the forecast series.

residuals

List of residuals corresponding to each of the forecast models. Each element must be a time series of residuals. If forecast contains a list of forecast objects, then the residuals will be extracted automatically and this argument is not needed. However, it will be used if not NULL.

returnall

If TRUE, a list of time series corresponding to the first argument is returned, but now reconciled. Otherwise, only the most disaggregated series is returned.

aggregatelist

(optional) User-selected list of forecast aggregates to consider

max_agg

(optional) integer specifying the maximum number of temporal aggregation levels to use when reconciling, via the structural scaling method. Useful if higher levels of aggregation are unlikely to have 'seen' recent changes in series dynamics and will likely then result in poor forecasts as a result. Default is NULL, meaning that all levels of aggregation are used

nonnegative

logical If TRUE, forecaststs are constrained using non-negative optimisation to ensure negative forecasts are eliminated. Default is FALSE

Value

List of reconciled forecasts in the same format as forecast. If returnall==FALSE, only the most disaggregated series is returned.

See Also

thief, tsaggregates


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