Computes the element-wise error between the input vectors.

error(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 error values.

See also

Examples

actual <- runif(10) predicted <- runif(10) error(actual, predicted)
#> [1] -0.26628213 -0.57723030 0.14013986 0.14416243 0.65008652 0.22295511 #> [7] 0.10956332 -0.53270907 -0.05392692 -0.73472413