rps_probs: Ranked Probability Score

View source: R/rps.R

rps_probsR Documentation

Ranked Probability Score

Description

Computes the Ranked Probability Score (RPS) for a given vector or matrix of probabilities.

Usage

rps_probs(y, x)

Arguments

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 y; see details) of probabilities

Details

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.

References

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")}.

Examples

# 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)

scoringRules documentation built on Sept. 18, 2024, 5:09 p.m.