Computes the average percent error between the input vectors.

mean_error_pct(actual, predicted, na.rm = FALSE)

Arguments

actual

A numeric vector with the actual values.

predicted

A numeric vector with the predicted values. Each element in this vector must be a prediction for the corresponding element in actual.

na.rm

A logical value indicating whether NA values should be stripped before the computation proceeds. Defaults to FALSE.

Value

Returns a double scalar with the mean percent error value.

A vector of the class lvmisc_percent.

See also

Examples

actual <- runif(10) predicted <- runif(10) mean_error_pct(actual, predicted)
#> <lvmisc_percent[1]> #> [1] -9.48812230464936%