relerr_sf {scoringfunctions} | R Documentation |
Relative error scoring function (MAE-PROP scoring function)
Description
The function relerr_sf computes the relative error scoring function when
materializes and
is the predictive
functional.
The relative error scoring function is defined in Table 1 in Gneiting (2011).
The relative error scoring function is referred to as MAE-PROP scoring function in eq. (13) in Patton (2011).
Usage
relerr_sf(x, y)
Arguments
x |
Predictive |
y |
Realization (true value) of process. It can be a vector of length
|
Details
The relative error scoring function is defined by:
Domain of function:
Range of function:
Value
Vector of relative errors.
Note
For details on the relative error scoring function, see Gneiting (2011).
The -median functional,
is the
median of a probability distribution whose density is proportional to
, where
is the density of the probability distribution
of
(Gneiting 2011).
The relative error scoring function is negatively oriented (i.e. the smaller, the better).
The relative error scoring function is strictly consistent for the
functional relative to the family
of potential probability distributions (whose densities are
proportional to
, where
is the density of the
probability distribution
for the future
) (see Theorems 5 and 9
in 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.
Patton AJ (2011) Volatility forecast comparison using imperfect volatility proxies. Journal of Econometrics 160(1):246–256. doi:10.1016/j.jeconom.2010.03.034.
Examples
# Compute the relative error scoring function.
df <- data.frame(
y = rep(x = 2, times = 3),
x = 1:3
)
df$relative_error <- relerr_sf(x = df$x, y = df$y)
print(df)