Learn R Programming

GeomComb (version 1.0)

comb_TA: Trimmed Mean Forecast Combination

Description

Computes a ‘combined forecast’ from a pool of individual model forecasts using trimmed mean at each point in time.

Usage

comb_TA(x, trim_factor = NULL, criterion = "RMSE")

Arguments

x
An object of class foreccomb. Contains training set (actual values + matrix of model forecasts) and optionally a test set.
trim_factor
numeric. Must be between 0 (simple average) and 0.5 (median).
criterion
If trim_factor is not specified, an optimization criterion for automated trimming needs to be defined. One of "MAE", "MAPE", or "RMSE" (default).

Value

Returns an object of class foreccomb_res with the following components: with the following components:

Details

Suppose $y_t$ is the variable of interest, there are $N$ not perfectly collinear predictors, $f_t = (f_{1t}, \ldots, f_{Nt})'$. For each point in time, the order forecasts are computed:

$$\mathbf{f}_t^{ord} = (f_{(1)t}, \ldots, f_{(N)t})'$$

Using a trim factor $\lambda$ (i.e., the top/bottom $\lambda \%$ are trimmed) the combined forecast is calculated as:

$$\hat{y}_t = \frac{1}{N(1-2\lambda)} \sum_{i = \lambda N +1}^{(1-\lambda)N} f_{(i)t}$$

The trimmed mean is an interpolation between the simple average and the median. It is an appealing simple, rank-based combination method that is less sensitive to outliers than the simple average approach, and has been proposed by authors such as Armstrong (2001), Stock and Watson (2004), and Jose and Winkler (2008).

This method allows the user to select $\lambda$ (by specifying trim_factor), or to leave the selection to an optimization algorithm -- in which case the optimization criterion has to be selected (one of "MAE", "MAPE", or "RMSE").

References

Armstrong, J. S. (2001). Combining Forecasts. In: Armstrong, J. S. (Ed.), Principles of Forecasting. Springer, Boston, MA, 417--439.

Jose, V. R. R., and Winkler, R. L. (2008). Simple Robust Averages of Forecasts: Some Empirical Results. International Journal of Forecasting, 24(1), 163--169.

Stock, J. H., and Watson, M. W. (2004). Combination Forecasts of Output Growth in a Seven-Country Data Set. Journal of Forecasting, 23(6), 405--430.

See Also

foreccomb, plot.foreccomb_res, summary.foreccomb_res, comb_SA, comb_MED, accuracy

Examples

Run this code
obs <- rnorm(100)
preds <- matrix(rnorm(1000, 1), 100, 10)
train_o<-obs[1:80]
train_p<-preds[1:80,]
test_o<-obs[81:100]
test_p<-preds[81:100,]

## User-selected trim factor:
data<-foreccomb(train_o, train_p, test_o, test_p)
comb_TA(data, trim_factor=0.1)

## Algorithm-optimized trim factor:
data<-foreccomb(train_o, train_p, test_o, test_p)
comb_TA(data, criterion="RMSE")

Run the code above in your browser using DataLab