| spa_test | R Documentation |
Tests the null hypothesis that a benchmark forecasting method has unconditional superior predictive ability over all competing alternatives, using Hansen's (2005) stationary bootstrap approach.
spa_test(Y, level, B = 5000L, q = 0.25)
Y |
An |
level |
Significance level (e.g., 0.05). |
B |
Integer; number of bootstrap replications. Default |
q |
Numeric in |
Let d_{j,t} = -Y_{j,t}, so that positive values mean competitor
j beats the benchmark. The SPA test statistic is:
T^{SPA} = \max\left(\max_{1 \le j \le J}
\frac{\sqrt{n}\, \bar{d}_j}{\hat{\omega}_j}, 0\right)
where \bar{d}_j is the sample mean of d_{j,t} and
\hat{\omega}_j^2 is its Newey-West long-run variance.
The null hypothesis is rejected when the benchmark is not superior to all competitors, i.e., some competitor significantly outperforms it.
The bootstrap distribution uses Hansen's (2005) consistent recentring:
competitors with \sqrt{n}\, \bar{d}_j / \hat{\omega}_j <
-\sqrt{2 \log \log n} are treated as clearly inferior and recentred at
zero instead of \bar{d}_j, so they do not inflate the critical value.
A list with class "spa_test" containing:
statistic |
The SPA test statistic (consistent). |
pvalue |
Bootstrap p-value. |
reject |
Logical; whether the null is rejected. |
level |
Significance level used. |
d_bar |
Sample mean of loss differentials for each competitor. |
n |
Number of observations. |
J |
Number of competitors. |
B |
Number of bootstrap replications. |
Hansen, P.R. (2005). A Test for Superior Predictive Ability. Journal of Business & Economic Statistics, 23(4), 365-380.
White, H. (2000). A Reality Check for Data Snooping. Econometrica, 68(5), 1097-1126.
sim <- do_sim(J = 3, n = 250, a = 1, c = 0, rho_u = 0.4)
spa_test(sim$Y, level = 0.05, B = 500)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.