qs | R Documentation |
This function calculates the Quantile Score (QS) given observations of an univariate variable, probabilities and corresponding quantiles of a predictive distribution.
qs(y, q, p, na.action = na.omit, aggregate = FALSE, ...)
y |
vector of observations |
q |
vector of quantile values (depending on |
p |
vector of probabilities in (0,1) |
na.action |
function to handle the NA's. Default: |
aggregate |
logical or function for aggregating the single scores, e.g. |
... |
further arguments passed to the |
For a vector y
of length n, the i-th entry of y
belongs to the i-th entry
of q
and p
. For given probabilities p
the quantile values are obtained by
q
=F^-1(p
) for a predictive distribution F.
A lower QS indicates a better forecast.
Vector of score value(s).
David Jobst
Gneiting, T. (2011). Making and Evaluating Point Forecasts. Journal of the American Statistical Association, 106(494), 746-762.
# simulated data
n <- 30
y <- rnorm(n)
p <- runif(n)
q <- qnorm(p)
# qs calculation
qs(y = y, q = q, p = p)
qs(y = y, q = q, p = p, aggregate = mean)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.