Learn R Programming

scoringfunctions (version 1.1)

linex_sf: LINEX scoring function

Description

The function linex_sf computes the LINEX scoring function with parameter \(a\) when \(y\) materialises and \(x\) is the predictive \(-(1/a) \log{\textnormal{E}_F[\textnormal{e}^{-a Y}]}\) moment generating functional.

The LINEX scoring function is defined by Varian (1975).

Usage

linex_sf(x, y, a)

Value

Vector of LINEX losses.

Arguments

x

Predictive \(-(1/a) \log{\textnormal{E}_F[\textnormal{e}^{-a Y}]}\) moment generating functional (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 LINEX scoring function is defined by:

$$S(x, y, a) := \textnormal{e}^{a (x - y)} - a (x - y) - 1$$

Domain of function:

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

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

$$a \neq 0$$

Range of function:

$$S(x, y, a) \geq 0, \forall x, y \in \mathbb{R}, a \neq 0$$

References

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").

Varian HR (1975) A Bayesian approach to real estate assessment. In: Fienberg SE, Zellner A(eds) Studies in Bayesian Econometrics and Statistics in Honor of Leonard J. Savage. Amsterdam: North-Holland, pp 195--208.

Zellner A (1986) Bayesian estimation and prediction using asymmetric loss functions. Journal of the American Statistical Association 81(394):446--451. tools:::Rd_expr_doi("10.1080/01621459.1986.10478289").

Examples

Run this code
# Compute the LINEX scoring function.

df <- data.frame(
    y = rep(x = 2, times = 3),
    x = 1:3,
    a = c(-1, 1, 2)
)

df$linex_loss <- linex_sf(x = df$x, y = df$y, a = df$a)

print(df)

Run the code above in your browser using DataLab