For forecast x, realization y and level tau in (0, 1) the score is
\(S(x, y) = (1\{x \ge y\} - \tau)(x - y)\), the generalized
piecewise-linear scoring function of order tau with identity g
(Gneiting 2011). Negatively oriented; the tau-quantile of the
predictive distribution is the optimal point forecast. Equivalent
to the Koenker-Bassett check function
\(\rho_\tau(u) = u(\tau - 1\{u < 0\})\) with \(u = y - x\).
Arguments
- y
Realizations.
- y_hat
Forecasts (scalar or vector of the same length).
- tau
Quantile level in (0, 1).
Value
List with estimate (mean score), scores,
n, tau, method.
References
Gneiting, T. (2011), Making and evaluating point
forecasts, Journal of the American Statistical Association
106(494), 746-762; arXiv:0912.0902, sec. 3.3 and Theorem 9;
Koenker, R. and Bassett, G. (1978), Regression quantiles,
Econometrica 46(1), 33-50.
Examples
set.seed(10)
y <- rnorm(500)
c(median = Qrf(y, 0, tau = 0.5)$estimate, off = Qrf(y, 1, tau = 0.5)$estimate) # the median scores best
#> median off
#> 0.4149253 0.5839804