Learn R Programming

GeomComb (version 1.0)

comb_EIG3: Trimmed Eigenvector Forecast Combination

Description

Computes forecast combination weights according to the trimmed eigenvector approach by Hsiao and Wan (2014) and produces forecasts for the test set, if provided.

Usage

comb_EIG3(x, ntop_pred = NULL, criterion = "RMSE")

Arguments

x
An object of class foreccomb. Contains training set (actual values + matrix of model forecasts) and optionally a test set.
ntop_pred
Specifies the number of retained predictors. If NULL (default), the inbuilt optimization algorithm selects this number.
criterion
If ntop_pred is not specified, a selection criterion is required for the optimization algorithm: one of "MAE", "MAPE", or "RMSE". If ntop_pred is selected by the user, criterion should be set to NULL (default).

Value

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

Details

The underlying methodology of the trimmed eigenvector approach by Hsiao and Wan (2014) is the same as their standard eigenvector approach. The only difference is that the trimmed eigenvector approach pre-selects the models that serve as input for the forecast combination, only a subset of the available forecast models is retained, while the models with the worst performance are discarded.

The number of retained forecast models is controlled via ntop_pred. The user can choose whether to select this number, or leave the selection to the inbuilt optimization algorithm (in that case ntop_pred = NULL). If the optimization algorithm should select the best number of retained models, the user must select the optimization criterion: MAE, MAPE, or RMSE. After this trimming step, the weights and the combined forecast are computed in the same way as in the standard eigenvector approach.

The trimmed eigenvector approach takes note of the eigenvector approaches' property to treat $y$ and $f$ symmetrically, which bears the risk that the (non-trimmed) eigenvector approaches' performance could be severely impaired by one or a few models that produce forecasts much worse than the average.

References

Hsiao, C., and Wan, S. K. (2014). Is There An Optimal Forecast Combination? Journal of Econometrics, 178(2), 294--309.

See Also

comb_EIG1 foreccomb, plot.foreccomb_res, summary.foreccomb_res, 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,]

## Number of retained models selected by the user:
data<-foreccomb(train_o, train_p, test_o, test_p)
comb_EIG3(data, ntop_pred = 2, criterion = NULL)

## Number of retained models selected by algorithm:
data<-foreccomb(train_o, train_p, test_o, test_p)
comb_EIG3(data, ntop_pred = NULL, criterion = "RMSE")

Run the code above in your browser using DataLab