BG1: Forecast combination by the Bates-Granger method.

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/BG1.R

Description

This function generates forecast combination results using Bates-Granger (BG) method, without considering the correlations between candiate forecasts.

Usage

1
BG1(X, y, Xnew, ynew = NULL, n0 = 5, rhos = c(1,0.9))

Arguments

X

Matrix of candidate forecasts for observed series.

y

Observed series.

Xnew

Matrix of candidate forecasts for unobserved series.

ynew

(Optional) True values of unobserved series, usually supplied for testing forecast accurary. If ynew is given, a forecast from Xnew can use previous observations in ynew as in any real forecasting scenarios.

n0

Number of “burn-in” observations for BG.

rhos

A vector of discount parameters.

Details

This function generates forecasts from the BG method.

Value

A matrix with combined forecasts (both fitted values from X and prediction from Xnew)

Author(s)

Wei Qian, Craig A. Rolling, Gang Cheng and Yuhong Yang
Maintainer: Wei Qian <weiqian@udel.edu>

References

Qian, W., Rolling, C. A., Cheng, G., and Yang, Y. (2021), “Combining Forecasts for Universally Optimal Performance”, International Journal of Forecasting, to appear.

See Also

AIafter.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
library(AIafter)
data(rgdp)


# observed series and its candidate forecasts
neval <- 20
n <- nrow(rgdp)
y <- rgdp[1:(n-neval),1]
X <- rgdp[1:(n-neval),-1]
# candidate forecasts for unobserved series
Xnew <- rgdp[(n-neval+1):n,-1]

# generate forecasts by BG (both fitted and predicted values)
fcst <- BG1(X,y,Xnew)

# true values of unobserved series
ynew <- rgdp[(n-neval+1):n,1]
# generate forecasts by BG (usually used for evaluation of forecast accuracy)
fcst <- BG1(X,y,Xnew,ynew)

weiqian1/AIafter documentation built on Dec. 23, 2021, 5:10 p.m.