Computes the element-wise percent error between the input vectors.

error_pct(actual, predicted)

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.

Value

Returns a double vector with the element-wise percent error values.

A vector of the class lvmisc_percent with the element-wise percent error values.

See also

Examples

actual <- runif(10) predicted <- runif(10) error_pct(actual, predicted)
#> <lvmisc_percent[10]> #> [1] 52.5607083423358% -1274.13680853546% 88.6675345076705% 17.7582313929908% #> [5] -161.977316958006% -493.004885582235% -162.658192788149% -128.528689149666% #> [9] -43.9375733013789% -421.010228069884%