| cspa_test | R Documentation |
Tests the null hypothesis that a benchmark forecasting method has conditional superior predictive ability over competing alternatives, uniformly across all conditioning states. Based on Li, Liao, and Quaedvlieg (2022).
cspa_test(Y, X, level, trim = 0, prewhiten = -1L, preselect = TRUE, R = 10000L)
Y |
An |
X |
An |
level |
Significance level (e.g., 0.05). |
trim |
Trim observations where the conditioning variable exceeds this
many standard deviations from the mean. Use |
prewhiten |
Order of pre-whitening VAR for HAC estimation. Use
|
preselect |
Logical; perform adaptive inequality selection? Default
|
R |
Integer; number of bootstrap replications for critical value
computation. Default |
A list with class "cspa_test" containing:
theta |
Infimum of the upper confidence bound. Negative values lead to rejection of the null. |
pvalue |
P-value for the test. |
reject |
Logical; whether the null is rejected at the given level. |
level |
Significance level used. |
h_hat |
Estimated conditional mean functions ( |
sigma_jx |
Estimated standard deviations ( |
kp |
Critical value from adaptive inequality selection. |
Vhat |
Logical matrix indicating selected (j, x) pairs. |
X |
Conditioning variable (after trimming). |
Y |
Loss differentials (after trimming). |
K |
Number of series terms used. |
prewhiten_order |
Pre-whitening lag order actually used. |
Li, J., Liao, Z., and Quaedvlieg, R. (2022). Conditional Superior Predictive Ability. Review of Economic Studies, 89(2), 843-875.
sim <- do_sim(J = 3, n = 250, a = 1, c = 0, rho_u = 0.4)
result <- cspa_test(sim$Y, sim$X, level = 0.05, trim = 2, R = 500L)
print(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.