abs_error: Absolute Error

View source: R/metrics_point_forecasts.R

abs_errorR Documentation

Absolute Error

Description

Calculate 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

See Also

ae_median_sample(), ae_median_quantile()

Examples

true_values <- rnorm(30, mean = 1:30)
predicted_values <- rnorm(30, mean = 1:30)
abs_error(true_values, predicted_values)

scoringutils documentation built on May 14, 2022, 1:06 a.m.