Learn R Programming

SimDesign (version 0.3)

MAE: Compute the mean absolute error

Description

Computes the average absolute deviation of a sample estimate from the population value. Accepts observed and population values, as well as observed values which are in deviation form.

Usage

MAE(observed, population = NULL, type = "MAE")

Arguments

observed
a numeric vector of parameter estimates, where the length is equal to the number of replications
population
a numeric scalar indicating the fixed population value. If NULL, then it will be assumed that the observed input is in a deviation form (therefore mean(abs(observed)) will be returned)
type
type of deviation to compute. Can be 'MAE' (default) for the mean absolute error, or 'NMSE' for the normalized MAE (MAE / (max(observed) - min(observed)))

Value

  • returns a single number indicating the overall mean absolute error in the estimates

See Also

RMSE

Examples

Run this code
pop <- 1
samp <- rnorm(100, 1, sd = 0.5)
MAE(samp, pop)

dev <- samp - pop
MAE(dev)
MAE(samp, pop, type = 'NMAE')

Run the code above in your browser using DataLab