Functions to calculate different performance metrics.
In the case of get_bias: Calculate the bias b, i.e. the average difference between predicted y and observed z values:
Usage
get_bias(predicted, observed, ...)
root_mean_squared(predicted, observed, ...)
mean_absolute_error(predicted, observed, ...)
Functions
root_mean_squared()
: Calculate the square root of the average squared difference between prediction and observation:mean_absolute_error()
: Calculate the average of the absolute differences between prediction and observation:
Examples
predicted = c(21.5, 22.2, 19.1)
observed = c(20, 20, 20)
get_bias(predicted, observed)
#> [1] 0.04666667
get_bias(predicted, observed, relative = FALSE)
#> [1] 0.9333333
root_mean_squared(predicted, observed)
#> [1] 0.08113774
root_mean_squared(predicted, observed, relative = FALSE)
#> [1] 1.622755
mean_absolute_error(predicted, observed)
#> [1] 0.07666667
mean_absolute_error(predicted, observed, relative = FALSE)
#> [1] 1.533333