Title: | Out-of-Sample Predictability in Predictive Regressions with Many Predictor Candidates |
---|---|
Description: | Consider a linear predictive regression setting with a potentially large set of candidate predictors. This work is concerned with detecting the presence of out of sample predictability based on out of sample mean squared error comparisons given in Gonzalo and Pitarakis (2023) <doi:10.1016/j.ijforecast.2023.10.005>. |
Authors: | Rong Peng [aut, cre] |
Maintainer: | Rong Peng <[email protected]> |
License: | GPL |
Version: | 0.1.0 |
Built: | 2024-12-08 07:01:05 UTC |
Source: | CRAN |
Consider a linear predictive regression setting with a potentially large set of candidate predictors. This work is concerned with detecting the presence of out of sample predictability based on out of sample MSE comparisons. For details of the test, please refer to Gonzalo and Pitarakis (2023).
DMBAR_Test(ehat0, ehatj, mu0, pvcutoffkp)
DMBAR_Test(ehat0, ehatj, mu0, pvcutoffkp)
ehat0 |
n by 1 vector of out of sample forecast errors from benchmark model with only intercept. |
ehatj |
n by j vector of out of sample forecast errors from models (j=1,...,p) estimated with one predictor (j) per time. |
mu0 |
sample split parameter (must be different from 0.5). |
pvcutoffkp |
pvalue cutoff used to decide whether the global null is rejected when identifying the key player conditional on rejecting the global null. |
A list of Test statistic, pvalue and key player across 4 alternative formulations of the test statistics (lrvar under 0 vs 1; power enhanced vs non-power enhanced (notation: 0, 1, 0adj, 1adj).
Gonzalo, J., & Pitarakis, J. Y. (2023). Out-of-sample predictability in predictive regressions with many predictor candidates. International Journal of Forecasting, 1166-1178.
ehat0<- rnorm(15); ehatj<- rnorm(15); temp <- DMBAR_Test(ehat0,ehatj,mu0=0.4,pvcutoffkp=0.1);
ehat0<- rnorm(15); ehatj<- rnorm(15); temp <- DMBAR_Test(ehat0,ehatj,mu0=0.4,pvcutoffkp=0.1);
Consider the following LS-fitted Model with intercept: y_(t+h) = beta_0 + x_(jt) * beta + u_(t+h) which is used to generate out-of-sample forecasts of y, h-steps ahead (h=1,2,3,. . . ). Notes: (1) first estimation window is (1,...,k0) and last window is (1,....,n-h) for k0 = round(n*pi0). First forecast is yhat(k0+h|k0) and last forecast is yhat(n|n-h). There are a total of (n-h-k0+1) forecasts and corresponding forecast errors. (2) this fast version of the recursive least squares algorithm uses the Sherman-Morrison matrix formula to avoid matrix inversions at each recursion. (3) x_(jt) is the j^th predictor in x (j^th column).
recursive_hstep_fast(y, x, pi0, h)
recursive_hstep_fast(y, x, pi0, h)
y |
an outcome series, which should be numeric and one dimensional. |
x |
a predictor matrix (intercept would be added automatically). |
pi0 |
Fraction of the sample, which should be within 0 and 1. |
h |
Number of steps ahead to predict, which should be a positive integer. |
recursive_hstep_fast is the fast version that avoids the recursive calculation of inverse of the matrix using Sherman-Morrison formula.
Series of residuals estimated
x<- rnorm(15); y<- x+rnorm(15); temp1 <- recursive_hstep_fast(y,x,pi0=0.5,h=1);
x<- rnorm(15); y<- x+rnorm(15); temp1 <- recursive_hstep_fast(y,x,pi0=0.5,h=1);