srelerr_sf {scoringfunctions} | R Documentation |
Squared relative error scoring function
Description
The function srelerr_sf computes the squared relative error scoring function
when materializes and
is the predictive
functional.
The squared relative error scoring function is defined in p. 752 in Gneiting (2011).
Usage
srelerr_sf(x, y)
Arguments
x |
Predictive |
y |
Realization (true value) of process. It can be a vector of length
|
Details
The squared relative error scoring function is defined by:
Domain of function:
Range of function:
Value
Vector of squared relative errors.
Note
For details on the squared relative error scoring function, see Gneiting (2011).
The squared relative error scoring function is negatively oriented (i.e. the smaller, the better).
The squared relative error scoring function is strictly consistent for the
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 squared percentage error scoring function.
df <- data.frame(
y = rep(x = 2, times = 3),
x = 1:3
)
df$squared_relative_error <- srelerr_sf(x = df$x, y = df$y)
print(df)