obsweighted_sf {scoringfunctions}R Documentation

Observation-weighted scoring function

Description

The function obsweighted_sf computes the observation-weighted scoring function when yy materializes and xx is the predictive EF[Y2]EF[Y]\dfrac{\textnormal{E}_F [Y^{2}]}{\textnormal{E}_F [Y]} functional.

The observation-weighted scoring function is defined in p. 752 in Gneiting (2011).

Usage

obsweighted_sf(x, y)

Arguments

x

Predictive EF[Y2]EF[Y]\dfrac{\textnormal{E}_F [Y^{2}]}{\textnormal{E}_F [Y]} 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 observation-weighted scoring function is defined by:

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

Domain of function:

x>0x > 0

y>0y > 0

Range of function:

S(x,y)0,x,y>0S(x, y) \geq 0, \forall x, y > 0

Value

Vector of observation-weighted errors.

Note

For details on the observation-weighted scoring function, see Gneiting (2011).

The observation-weighted scoring function is negatively oriented (i.e. the smaller, the better).

The observation-weighted scoring function is strictly consistent for the EF[Y2]EF[Y]\dfrac{\textnormal{E}_F [Y^{2}]}{\textnormal{E}_F [Y]} functional.

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.

Examples

# Compute the observation-weighted scoring function.

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

df$squared_relative_error <- obsweighted_sf(x = df$x, y = df$y)

print(df)

[Package scoringfunctions version 0.0.6 Index]