rps_probs | R Documentation |
Computes the Ranked Probability Score (RPS) for a given vector or matrix of probabilities.
rps_probs(y, x)
y |
vector of realizations, taking integer values between 1 and K. For the RPS, outcomes have an ordinal interpretation only (see details). |
x |
vector or matrix (depending on |
The RPS interprets the outcome variable as ordinal. That is, different outcome values can be ranked (e.g., y=1
is smaller than y=2
), but their numerical difference has no meaningful interpretation.
For simplicity, the outcome y
is coded as an integer here, with y = 1
indicating the smallest possible realization and y = K
indicating the largest possible realization.
If y
is a vector of length n >= 2, x
should be given as a matrix
with n rows and K columns. If y
has length 1, then x
may be a vector of length K.
Original proposal of the RPS
Epstein, E.S. (1969): ‘A Scoring System for Probability Forecasts of Ranked Categories’, Journal of Applied Meteorology and Climatology 8, 985-987.
Application example (see esp. Section 4 for comments on the RPS' ordinal interpretation)
Krueger, F. and L. Pavlova (2024): 'Quantifying Subjective Uncertainty in Survey Expectations', International Journal of Forecasting 40, 796-810, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.ijforecast.2023.06.001")}.
# Example with three outcome categories (a single observation)
p <- c(.3, .2, .5)
y <- 2
rps_probs(y, p)
# Example with three outcome categories (n = 2 observations)
p <- matrix(c(.2, .4, .4, .3, .6, .1), nrow = 2, byrow = TRUE)
y <- c(2, 3)
rps_probs(y, p)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.