serr_sf {scoringfunctions}R Documentation

Squared error scoring function

Description

The function serr_sf computes the squared error scoring function when yy materializes and xx is the predictive mean functional.

The squared error scoring function is defined in Table 1 in Gneiting (2011).

Usage

serr_sf(x, y)

Arguments

x

Predictive mean functional (prediction). It can be a vector of length nn (must have the same length as yy).

y

Realization (true value) of process. It can be a vector of length nn (must have the same length as xx).

Details

The squared error scoring function is defined by:

S(x,y):=(xy)2S(x, y) := (x - y)^2

Domain of function:

xRx \in \R

yRy \in \R

Range of function:

S(x,y)0,x,yRS(x, y) \geq 0, \forall x, y \in \R

Value

Vector of squared errors.

Note

For details on the squared error scoring function, see Savage 1971, Gneiting (2011).

The mean functional is the mean EF[Y]E_F[Y] of the probability distribution FF of yy (Gneiting 2011).

The squared error scoring function is negatively oriented (i.e. the smaller, the better).

The squared error scoring function is strictly consistent for the mean functional relative to the family F\mathbb{F} of potential probability distributions FF for the future yy for which the second moment exists and is finite (Savage 1971, Gneiting 2011).

References

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

Savage LJ (1971) Elicitation of personal probabilities and expectations. Journal of the American Statistical Association 66(337):783–810. doi:10.1080/01621459.1971.10482346.

Examples

# Compute the squarer error scoring function.

df <- data.frame(
    y = rep(x = 0, times = 5),
    x = -2:2
)

df$squared_error <- serr_sf(x = df$x, y = df$y)

print(df)

[Package scoringfunctions version 0.0.6 Index]