Description Usage Arguments Details Value Author(s) References See Also Examples
This function generates forecast combination results using the AFTER algorithm (Yang, 2004).
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 AFTER. |
This function generates forecasts from the AFTER algorithm. For detailed updating scheme, see Yang (2004).
It returns a list that contains combined forecasts (both fitted values from X
and prediction from Xnew
):
fcst |
a forecast matrix, with first column being forecasts from L1-AFTER and second column from L2-AFTER. |
L1Wt |
weight matrix used for L1-AFTER. |
L2Wt |
weight matrix used for L2-AFTER. |
Wei Qian, Craig A. Rolling, Gang Cheng and Yuhong Yang
Maintainer: Wei Qian <weiqian@udel.edu>
Yang, Y. (2004), “Combining Forecasting Procedures: Some Theoretical Results,” Econometric Theory, 20, 175-222.
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 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 AFTER (both fitted and predicted values)
fcst <- AFTER1(X,y,Xnew)
# true values of unobserved series
ynew <- rgdp[(n-neval+1):n,1]
# generate forecasts by AFTER (usually used for evaluation of forecast accuracy)
fcst <- AFTER1(X,y,Xnew,ynew)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.