ae_median_quantile: Absolute Error of the Median (Quantile-based Version)

Description Usage Arguments Value Examples

View source: R/absolute_error.R

Description

Absolute error of the median calculated as

abs(true_value - median_prediction)

Usage

1
ae_median_quantile(true_values, predictions, quantiles = NULL, verbose = TRUE)

Arguments

true_values

A vector with the true observed values of size n

predictions

numeric vector with predictions, corresponding to the quantiles in a second vector, 'quantiles'.

quantiles

numeric vector that denotes the quantile for the values in 'predictions'. Only those predictions where 'quantiles == 0.5' will be kept. If 'quantiles' is 'NULL', then all 'predictions' and 'true_values' will be used (this is then the same as 'absolute_error()')

verbose

logical, return a warning is something unexpected happens

Value

vector with the scoring values

Examples

1
2
3
true_values <- rnorm(30, mean = 1:30)
predicted_values <- rnorm(30, mean = 1:30)
ae_median_quantile(true_values, predicted_values, quantiles = 0.5)

nikosbosse/scoringutils2 documentation built on Jan. 8, 2021, 12:12 p.m.