Free Access Week - Data Engineering + BI
Data Engineering and BI courses are free this week!
Free Access Week - Jun 2-8

scoringfunctions (version 1.1)

huber_rs: Mean Huber score

Description

The function huber_rs computes the mean Huber score with parameter a, when \textit{y} materialises and \textit{x} is the prediction.

Mean Huber score is a realised score corresponding to the Huber scoring function huber_sf.

Usage

huber_rs(x, y, a)

Value

Value of the mean Huber score.

Arguments

x

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

y

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

a

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

Details

The mean Huber score is defined by:

S(\textit{x},\textit{y},a):=(1/n)i=1nL(xi,yi,a)

where

\textit{x}=(x1,...,xn)T

\textit{y}=(y1,...,yn)T

and

L(x,y,a):={12(xy)2,|xy|aa|xy|12a2,|xy|>a

Domain of function:

\textit{x}Rn

\textit{y}Rn

a>0

Range of function:

S(\textit{x},\textit{y},a)0,\textit{x},\textit{y}Rn,a>0

References

Fissler T, Ziegel JF (2019) Order-sensitivity and equivariance of scoring functions. Electronic Journal of Statistics 13(1):1166--1211. tools:::Rd_expr_doi("10.1214/19-EJS1552").

Gneiting T (2011) Making and evaluating point forecasts. Journal of the American Statistical Association 106(494):746--762. tools:::Rd_expr_doi("10.1198/jasa.2011.r10138").

Examples

Run this code
# Compute the Huber mean score.

set.seed(12345)

a <- 0.5

x <- 0

y <- rnorm(n = 100, mean = 0, sd = 1)

print(huber_rs(x = x, y = y, a = a))

print(huber_rs(x = rep(x = x, times = 100), y = y, a = a))

Run the code above in your browser using DataLab