Learn R Programming

SimDesign (version 0.3)

RMSE: Compute the (normalized) root mean square error

Description

Computes the average deviation (root mean square error; also known as the root mean square 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

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

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 sqrt(mean(observed^2)) will be returned)
type
type of deviation to compute. Can be 'RMSE' (default) for the root mean square-error, 'NRMSE' for the normalized RMSE (RMSE / (max(observed) - min(observed))), or 'CV' for the coefficient of variation

Value

  • returns a single number indicating the overall average deviation in the estimates

See Also

MAE

Examples

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

dev <- samp - pop
RMSE(dev)

RMSE(samp, pop, type = 'NRMSE')
RMSE(dev, type = 'NRMSE')
RMSE(samp, pop, type = 'CV')

Run the code above in your browser using DataLab