Description Usage Arguments Details Value Author(s) References See Also Examples
This function uses linear regression (LR) to find the optimal combination of all forecasts.
1 |
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 |
n0 |
Number of “burn-in” observations for LR. |
This function generates forecasts from LR, without constraint on weights.
A vector with combined forecasts (both fitted values from X
and prediction from Xnew
).
Wei Qian, Craig A. Rolling, Gang Cheng and Yuhong Yang
Maintainer: Wei Qian <weiqian@udel.edu>
Qian, W., Rolling, C. A., Cheng, G., and Yang, Y. (2021), “Combining Forecasts for Universally Optimal Performance”, International Journal of Forecasting, to appear.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 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 LR (both fitted and predicted values)
fcst <- LinReg1(X,y,Xnew)
# true values of unobserved series
ynew <- rgdp[(n-neval+1):n,1]
# generate forecasts by LR (usually used for evaluation of forecast accuracy)
fcst <- LinReg1(X,y,Xnew,ynew)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.