Learn R Programming

scoringfunctions (version 1.1)

huberquantile_if: Huber quantile identification function

Description

The function huberquantile_if computes the Huber quantile identification function at a specific level \(p\) and parameters \(a\) and \(b\), when \(y\) materialises and \(x\) is the predictive Huber functional at level \(p\).

The Huber quantile identification function is defined by eq. (3.5) in Taggart (2022).

Usage

huberquantile_if(x, y, p, a, b)

Value

Vector of values of the Huber quantile identification function.

Arguments

x

Predictive Huber functional (prediction) 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\)).

a

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

b

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

Details

The Huber quantile identification function is defined by:

$$V(x, y, a) := |\textbf{1} \lbrace x \geq y \rbrace - p| \kappa_{a,b}(x - y)$$

where \(\kappa_{a,b}(t)\) is the capping function defined by:

$$\kappa_{a,b}(t) := \max \lbrace \min \lbrace t,b \rbrace, -a \rbrace$$

Domain of function:

$$x \in \mathbb{R}$$

$$y \in \mathbb{R}$$

$$0 < p < 1$$

$$a > 0$$

$$b > 0$$

References

Taggart RJ (2022) Point forecasting and forecast evaluation with generalized Huber loss. Electronic Journal of Statistics 16:201--231. tools:::Rd_expr_doi("10.1214/21-EJS1957").

Examples

Run this code
# Compute the Huber quantile identification function.

set.seed(12345)

n <- 10

df <- data.frame(
    x = runif(n, -2, 2),
    y = runif(n, -2, 2),
    p = runif(n, 0, 1),
    a = runif(n, 0, 1),
    b = runif(n, 0, 1)
)

df$huberquantile_if <- huberquantile_if(x = df$x, y = df$y, p = df$p, a = df$a,
    b = df$b)

print(df)

Run the code above in your browser using DataLab