mean absolute error

mae(observed_y, predicted_y)

Arguments

observed_y

A numeric vector of observed ys.

predicted_y

A numeric vector of predictions of y.

Value

A double vector of length 1

Examples

set.seed(1)
obs_y <- rnorm(4)
pred_y <- rnorm(4)
mae(observed_y = obs_y, predicted_y = pred_y)
#> [1] 0.2587554