Compute the mean absolute error
Computes the average absolute deviation of a sample estimate from the parameter value. Accepts estimate and parameter values, as well as estimate values which are in deviation form.
MAE(estimate, parameter = NULL, type = "MAE", percent = FALSE, unname = FALSE)
estimate |
a |
parameter |
a |
type |
type of deviation to compute. Can be |
percent |
logical; change returned result to percentage by multiplying by 100? Default is FALSE |
unname |
logical; apply |
returns a numeric vector indicating the overall mean absolute error in the estimates
Phil Chalmers rphilip.chalmers@gmail.com
Chalmers, R. P., & Adkins, M. C. (2020). Writing Effective and Reliable Monte Carlo Simulations
with the SimDesign Package. The Quantitative Methods for Psychology, 16
(4), 248-280.
doi: 10.20982/tqmp.16.4.p248
Sigal, M. J., & Chalmers, R. P. (2016). Play it again: Teaching statistics with Monte
Carlo simulation. Journal of Statistics Education, 24
(3), 136-156.
doi: 10.1080/10691898.2016.1246953
RMSE
pop <- 1 samp <- rnorm(100, 1, sd = 0.5) MAE(samp, pop) dev <- samp - pop MAE(dev) MAE(samp, pop, type = 'NMAE') MAE(samp, pop, type = 'SMAE') # matrix input mat <- cbind(M1=rnorm(100, 2, sd = 0.5), M2 = rnorm(100, 2, sd = 1)) MAE(mat, parameter = 2) # same, but with data.frame df <- data.frame(M1=rnorm(100, 2, sd = 0.5), M2 = rnorm(100, 2, sd = 1)) MAE(df, parameter = c(2,2)) # parameters of the same size parameters <- 1:10 estimates <- parameters + rnorm(10) MAE(estimates, parameters)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.