ri: Reliability Index

View source: R/ri.R

riR Documentation

Reliability Index

Description

This function calculates the Reliability Index (RI) given observations of an univariate variable and samples of a predictive distribution.

Usage

ri(y, x, bins = NULL, na.rm = FALSE)

Arguments

y

vector of observations

x

matrix of samples of a predictive distribution (depending on y; see details)

bins

numeric; if NULL the number of bins is equal to ncol(x)+1; otherwise bins must be chosen so that (ncol(x)+1)/bins is an integer; default: NULL (see details)

na.rm

logical; if TRUE NA are stripped before the rank computation proceeds; if FALSE NA are used in the rank computation; default: FALSE

Details

For a vector y of length n, x should be given as matrix with n rows, where the i-th entry of y belongs to the i-th row of x. The columns of x represent the samples of a predictive distribution.

The parameter bins specifies the number of columns for the VRH. For "large" ncol(x) it is often reasonable to reduce the resolution of the VRH by using bins so that (ncol(x)+1)/bins is an integer.

The deviation from uniformity of the VRH can be quantified by the reliability index (RI). The smaller the RI, the better the calibration of the forecast. The optimal value of the RI is 0.

Value

Vector of the score value.

Author(s)

David Jobst

References

Delle Monache, L., Hacker, J., Zhou, Y., Deng, X. and Stull, R., (2006). Probabilistic aspects of meteorological and ozone regional ensemble forecasts. Journal of Geophysical Research: Atmospheres, 111, D24307.

Examples

# simulated data
n <- 30
m <- 50
y <- rnorm(n)
x <- matrix(rnorm(n*m), ncol = m)

# ri calculation
ri(y = y, x = x)
ri(y = y, x = x, bins = 17)


jobstdavid/eppverification documentation built on May 13, 2024, 5:20 p.m.