bmedian_sf {scoringfunctions}R Documentation

β\beta-median scoring function

Description

The function bmedian_sf computes the β\beta-median scoring function when yy materializes and xx is the predictive med(β)(F)\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 med(β)(F)\textnormal{med}^{(\beta)}(F) functional (prediction). It can be a vector of length nn (must have the same length as yy).

y

Realization (true value) of process. It can be a vector of length nn (must have the same length as xx).

b

It can be a vector of length nn (must have the same length as yy).

Details

The β\beta-median scoring function is defined by:

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

Domain of function:

x>0x > 0

y>0y > 0

b0b \neq 0

Range of function:

S(x,y,b)0,x,y>0,b0S(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, med(β)(F)\textnormal{med}^{(\beta)}(F) is the median of a probability distribution whose density is proportional to yβf(y)y^\beta f(y), where ff is the density of the probability distribution FF of yy (Gneiting 2011).

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

The β\beta-median scoring function is strictly consistent for the med(β)(F)\textnormal{med}^{(\beta)}(F) functional relative to the family F\mathbb{F} of potential probability distributions (whose densities are proportional to yβf(y)y^{\beta} f(y), where ff is the density of the probability distribution FF for the future yy) (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. 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)

[Package scoringfunctions version 0.0.6 Index]