Learn R Programming

scoringutils (version 1.2.2)

ae_median_sample: Absolute Error of the Median (Sample-based Version)

Description

Absolute error of the median calculated as

$$% \textrm{abs}(\textrm{true\_value} - \textrm{median\_prediction}) $$

Usage

ae_median_sample(true_values, predictions)

Value

vector with the scoring values

Arguments

true_values

A vector with the true observed values of size n

predictions

nxN matrix of predictive samples, n (number of rows) being the number of data points and N (number of columns) the number of Monte Carlo samples. Alternatively, predictions can just be a vector of size n.

See Also

ae_median_quantile(), abs_error()

Examples

Run this code
true_values <- rnorm(30, mean = 1:30)
predicted_values <- rnorm(30, mean = 1:30)
ae_median_sample(true_values, predicted_values)

Run the code above in your browser using DataLab