Learn R Programming

scoringutils (version 0.1.7.2)

abs_error: Absolute Error

Description

Caclulate absolute error as

$$ abs(true_value - prediction) $$

Usage

abs_error(true_values, predictions)

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`.

Value

vector with the absolute error

Examples

Run this code
# NOT RUN {
true_values <- rnorm(30, mean = 1:30)
predicted_values <- rnorm(30, mean = 1:30)
abs_error(true_values, predicted_values)
# }

Run the code above in your browser using DataLab