bmedian_sf: beta-median scoring function

View source: R/bmedian_sf.R

bmedian_sfR Documentation

\beta-median scoring function

Description

The function bmedian_sf computes the \beta-median scoring function when y materialises and x is the predictive \textnormal{med}^{(\beta)}(F) functional.

The \beta-median scoring function is defined in eq. (4) in Gneiting (2011).

Usage

bmedian_sf(x, y, b)

Arguments

x

Predictive \textnormal{med}^{(\beta)}(F) functional (prediction). It can be a vector of length n (must have the same length as y).

y

Realisation (true value) of process. It can be a vector of length n (must have the same length as x).

b

It can be a vector of length n (must have the same length as y).

Details

The \beta-median scoring function is defined by:

S(x, y, b) := |1 - (y/x)^b|

Domain of function:

x > 0

y > 0

b \neq 0

Range of function:

S(x, y, b) \geq 0, \forall x, y > 0, b \neq 0

Value

Vector of \beta-median losses.

Note

For details on the \beta-median scoring function, see Gneiting (2011).

The \beta-median functional, \textnormal{med}^{(\beta)}(F) is the median of a probability distribution whose density is proportional to y^\beta f(y), where f is the density of the probability distribution F of y (Gneiting 2011).

The \beta-median scoring function is negatively oriented (i.e. the smaller, the better).

The \beta-median scoring function is strictly \mathbb{F}^{(w)}-consistent for the \textnormal{med}^{(\beta)}(F) functional. \mathbb{F} is the family of probability distributions for which \textnormal{E}_F[Y] exists and is finite. \mathbb{F}^{(w)} is the subclass of probability distributions in \mathbb{F}, which are such that w(y) f(y), w(y) = y^\beta has finite integral over (0, \infty), and the probability distribution F^{(w)} with density proportional to w(y) f(y) belongs to \mathbb{F} (see Theorems 5 and 9 in Gneiting 2011)

References

Gneiting T (2011) Making and evaluating point forecasts. Journal of the American Statistical Association 106(494):746–762. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1198/jasa.2011.r10138")}.

Examples

# Compute the bmedian scoring function.

df <- data.frame(
    y = rep(x = 2, times = 3),
    x = 1:3,
    b = c(-1, 1, 2)
)

df$bmedian_error <- bmedian_sf(x = df$x, y = df$y, b = df$b)

print(df)

scoringfunctions documentation built on April 4, 2025, 12:28 a.m.