rolling_combine {ForecastComb}R Documentation

Dynamic Forecast Combination

Description

Computes the dynamic version of the combined forecast for a method included in the ForecastComb package.

Usage

rolling_combine(x, comb_method, criterion = NULL)

Arguments

x

An object of class 'foreccomb'. Must contrain full training set and test set.

comb_method

The combination method that should be used.

criterion

Specifies loss criterion. Set criterion to either 'RMSE', 'MAE', or 'MAPE' for the methods comb_TA, comb_WA, comb_EIG3, and comb_EIG4, or to 'NULL' (default) for all other methods.

Details

The function rolling_combine allows to estimate a dynamic version of the other combination methods of the package in a standardized way, i.e., it allows for time-varying weights. The function builds on the idea of time series cross-validation: Taking the provided training set as starting point, the models are re-estimated at each period of the test set using a revised (increased) training set.

Like univariate dynamic forecasting, the validation approach requires a full test set – including the observed values.

The results are stored in an object of class 'foreccomb_res', for which separate plot and summary functions are provided.

Value

Returns an object of class foreccomb_res that represents the results for the best-fit forecast combination method:

Method

Returns the best-fit forecast combination method.

Models

Returns the individual input models that were used for the forecast combinations.

Weights

Returns the combination weights obtained by applying the best-fit combination method to the training set.

Fitted

Returns the fitted values of the combination method for the training set.

Accuracy_Train

Returns range of summary measures of the forecast accuracy for the training set.

Forecasts_Test

Returns forecasts produced by the combination method for the test set. Only returned if input included a forecast matrix for the test set.

Accuracy_Test

Returns range of summary measures of the forecast accuracy for the test set. Only returned if input included a forecast matrix and a vector of actual values for the test set.

Input_Data

Returns the data forwarded to the method.

Author(s)

Christoph E. Weiss

References

Bergmeir, C., Hyndman, R.J., and Koo, B. (2015). A Note on the Validity of Cross-Validation for Evaluating Time Series Prediction. Monash University, Deparment of Econometrics and Business Statistics, Working Paper No. 10/15.

Timmermann, A. (2006). Forecast Combinations. Handbook of Economic Forecasting, 1, 135–196.

See Also

foreccomb, plot.foreccomb_res, summary.foreccomb_res,

Examples

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,]

data<-foreccomb(train_o, train_p, test_o, test_p)

#Static forecast combination (for example OLS):
static_OLS <- comb_OLS(data)

#Dynamic forecast combination:
dyn_OLS <- rolling_combine(data, "comb_OLS")


[Package ForecastComb version 1.3.1 Index]