comb_Ridge: Ridge Regression Forecast Combination

View source: R/comb_Ridge.R

comb_RidgeR Documentation

Ridge Regression Forecast Combination

Description

Computes forecast combination weights using Ridge Regression (OLS) regression.

Usage

comb_Ridge(x, custom_error = NULL)

Arguments

x

An object of class 'foreccomb'. Contains training set (actual values + matrix of model forecasts) and optionally a test set.

Details

The function integrates the Ridge Regression forecast combination implementation of the ForecastCombinations package into ForecastComb.

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

Value

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

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 combination method to the training set.

Intercept

Returns the intercept of the linear regression.

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.

See Also

Forecast_comb, foreccomb, plot.ForecastComb::foreccomb_res, summary.ForecastComb::foreccomb_res, accuracy

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<-ForecastComb::foreccomb(train_o, train_p, test_o, test_p)
ahead::comb_Ridge(data)


Techtonique/ahead documentation built on Nov. 24, 2024, 10:33 a.m.