Skip to contents

Relative absolute error (RAE) compares total absolute error with total absolute error from predicting the observed mean.

Usage

rae(obs, pred, na.rm = TRUE)

Arguments

obs

Numeric observation vector.

pred

Numeric prediction vector paired with obs.

na.rm

Logical; remove incomplete pairs?

Value

One numeric value.

Details

$$\mathrm{RAE}=\frac{\sum_{i=1}^n|obs_i-pred_i|} {\sum_{i=1}^n|obs_i-\bar{obs}|}.$$

RAE is non-negative and zero is ideal. One equals the observed-mean absolute-error benchmark; values above one are worse. It returns NA with a warning for constant observations, whose benchmark denominator is zero. Missing-value handling follows bias().

References

Hyndman and Koehler (2006). See mdae().

See also