hubermean_if: Huber mean identification function

View source: R/hubermean_if.R

hubermean_ifR Documentation

Huber mean identification function

Description

The function hubermean_if computes the Huber mean identification function with parameter a, when y materialises and x is the predictive Huber mean.

The Huber mean identification function is defined by eq. (3.5) in Taggart (2022), for \alpha = 1/2 and b = a.

Usage

hubermean_if(x, y, a)

Arguments

x

Predictive Huber mean (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).

a

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

Details

The Huber mean identification function is defined by:

V(x, y, a) := (1/2) \kappa_{a, a}(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}

a > 0

Range of function:

-a/2 \leq V(x, y, a) \leq a/2, \forall x, y \in \mathbb{R}, a > 0

Value

Vector of values of the Huber mean identification function.

Note

For the definition of Huber mean, see Taggart (2022).

Eq. (3.5) in Taggart (2022) defines the general Huber quantile identification function V(x, y, \alpha, a, b) := |\textbf{1} \lbrace x \geq y \rbrace - \alpha| \kappa_{a,b}(x - y), implemented in huberquantile_if. The Huber mean identification function is its specialisation to \alpha = 1/2 and b = a, so that huberquantile_if(x, y, 1/2, a, a) and hubermean_if(x, y, a) agree.

The Huber mean identification function is a strict \mathbb{F}-identification function for the Huber mean functional (Taggart 2022).

\mathbb{F} is the family of probability distributions F for which \textnormal{E}_F[Y] exists and is finite (Taggart 2022).

References

Taggart RJ (2022) Point forecasting and forecast evaluation with generalized Huber loss. Electronic Journal of Statistics 16(1):201–231. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1214/21-EJS1957")}.

See Also

huber_sf, huber_rs

Examples

# Compute the Huber mean identification function.

df <- data.frame(
    x = c(-3, -2, -1, 0, 1, 2, 3),
    y = c(0, 0, 0, 0, 0, 0, 0),
    a = c(2.7, 2.5, 0.6, 0.7, 0.9, 1.2, 5)
)

df$hubermean_if <- hubermean_if(x = df$x, y = df$y, a = df$a)

print(df)

scoringfunctions documentation built on Aug. 30, 2026, 5:07 p.m.