View source: R/statistical_tests.R
| white_reality_check | R Documentation |
Implements White's (2000) Reality Check (WRC) for comparing forecast accuracy of multiple competing forecasts against a benchmark forecast based on mean loss differences. The test controls the family-wise error rate across all forecast comparisons simultaneously, avoiding data-snooping bias.
Hypotheses:
H0: \max_{k} E[g(u_{0,t}) - g(u_{k,t})] \leq 0 – no competing
forecast produces a strictly lower expected loss than the benchmark forecast.
H1: At least one competing forecast has strictly lower expected loss than the benchmark forecast.
white_reality_check(
loss_differences,
n_simulations = 999,
block_length = 5,
alpha = 0.05
)
loss_differences |
A |
n_simulations |
|
block_length |
|
alpha |
|
The test statistic is \hat{S}_P = \max_k \overline{d}_k, where
\overline{d}_k is the sample mean of the loss differential series for forecast
k (White, 2000, eq. 2). Bootstrap p-values are obtained via the MBB of
Kunsch (1989) by recentring each bootstrap statistic at the sample mean, following
the procedure in Corradi & Swanson (2011). This is an unstudentized test; for
a studentized version with improved power against irrelevant forecasts, see
superior_predictive_ability_test.
An object of class "htest". The printed output shows the
test statistic (maximum mean loss differential), the bootstrap p-value, and the
test name. A small p-value (below alpha) leads to rejection of H0,
indicating that at least one competing forecast is significantly more accurate
than the benchmark forecast.
White, H. (2000). A reality check for data snooping. Econometrica, 68(5), 1097–1126. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/1468-0262.00152")}
Kunsch, H. R. (1989). The jackknife and the bootstrap for general stationary observations. The Annals of Statistics, 17(3), 1217–1241. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1214/aos/1176347265")}
Davidson, R., & MacKinnon, J. G. (2000). Bootstrap tests: How many bootstraps? Econometric Reviews, 19(1), 55–68. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/07474930008800459")}
Corradi, V., & Swanson, N. R. (2011). The White Reality Check and some of its recent extensions. In Festschrift in honor of Halbert L. White.
data(metals)
# metals: 165 x 15; columns 1-14 are competing forecasts, column 15 is the benchmark
# A small offset (+0.5) is added to the lagged benchmark to avoid degenerate zero
# loss differences when forecasts equal the realized value exactly (illustration only).
P <- nrow(metals)
K_total <- ncol(metals)
K <- K_total - 1 # 14 competing forecasts
realized <- c(metals[-1, K_total], metals[P, K_total]) + 0.5
benchmark_loss <- (metals[, K_total] - realized)^2
model_loss <- (metals[, 1:K] - realized)^2
loss_diff <- benchmark_loss - model_loss
res <- white_reality_check(loss_diff, block_length = 5, n_simulations = 50)
print(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.