View source: R/variance_functions.R
mae | R Documentation |
mae
is a function that allows the calculation of the
mean absolute error (MAE) for a vector of numbers.
mae(x, expected)
x |
numeric vector. |
expected |
expectation, given the model, for each value of x. |
Based on the assumed underlying model, the estimated MAE given the
observed data in x
.
Other Model Error Functions:
rmsd()
# Examples set.seed(1234) x <- rnorm(100) mean(x) mae(x, mean(x)) # Observed Data (Red Porgy data set) data(RedPorgy) x <- na.exclude(RedPorgy[, 1]) mae(x = x, expected = mean(x))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.