lqquantile_sf: L_q-quantile scoring function

View source: R/lqquantile_sf.R

lqquantile_sfR Documentation

L_q-quantile scoring function

Description

The function lqquantile_sf computes the L_q-quantile scoring function at a specific level p, when y materialises and x is the predictive L_q-quantile at level p.

The L_q-quantile scoring function is defined by Chen (1996).

Usage

lqquantile_sf(x, y, p, q)

Arguments

x

Predictive L_q-quantile at level p. 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).

p

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

q

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

Details

The L_q-quantile scoring function is defined by:

S(x, y, p, q) := |\textbf{1} \lbrace x \geq y \rbrace - p| |x - y|^q

or equivalently,

S(x, y, p, q) := p |\max \lbrace -(x - y), 0 \rbrace|^q + (1 - p) |\max \lbrace x - y, 0 \rbrace|^q

Domain of function:

x \in \mathbb{R}

y \in \mathbb{R}

0 < p < 1

q \geq 2

Range of function:

S(x, y, p, q) \geq 0, \forall x, y \in \mathbb{R}, p \in (0, 1), q \geq 2

Value

Vector of L_q-quantile losses.

Note

For the definition of L_q-quantiles, see Chen (1996). In particular, L_q-quantiles at level p are the solution of the equation \textnormal{E}_F[V(x, Y, p, q)] = 0, where

V(x, y, p, q) := q (\textbf{1} \lbrace x \geq y \rbrace - p) |x - y|^{q - 1}

The L_q-quantile scoring function is negatively oriented (i.e. the smaller, the better).

The L_q-quantile scoring function is strictly \mathbb{F}-consistent for the L_q-quantile functional at level p. \mathbb{F} is the family of probability distributions F for which \textnormal{E}_F[Y^q] exists and is finite (Chen 2016; Bellini 2014).

References

Bellini F, Klar B, Muller A, Gianin ER (2014) Generalized quantiles as risk measures. Insurance: Mathematics and Economics 54:41–48. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.insmatheco.2013.10.015")}.

Chen Z (1996) Conditional L_p-quantiles and their application to the testing of symmetry in non-parametric regression. Statistics and Probability Letters 29(2):107–115. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/0167-7152(95)00163-8")}.

Examples

# Compute the Lq-quantile scoring function at level p.

df <- data.frame(
    y = rep(x = 0, times = 6),
    x = c(2, 2, -2, -2, 0, 0),
    p = rep(x = c(0.05, 0.95), times = 3),
    q = c(2, 3, 2, 3, 2, 3)
)

df$lqquantile_penalty <- lqquantile_sf(x = df$x, y = df$y, p = df$p, q = df$q)

print(df)

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