Skip to contents

Normalized RMSE (NRMSE) divides rmse() by the sample standard deviation of observations.

Usage

nrmse(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{NRMSE}= \frac{\sqrt{n^{-1}\sum_{i=1}^{n}(obs_i-pred_i)^2}} {\sqrt{(n-1)^{-1}\sum_{i=1}^{n}(obs_i-\bar{obs})^2}}.$$

NRMSE is unitless and zero is ideal. Smaller values indicate less error relative to the observed variation. A value of one means RMSE equals one observed sample standard deviation. This package uses this normalization to remain consistent with its diagram statistics. It returns NA with a warning when fewer than two valid pairs remain or the observations have zero variance. Missing-value handling follows bias().

References

Taylor, K. E. (2001). Summarizing multiple aspects of model performance in a single diagram. Journal of Geophysical Research, 106, 7183-7192. doi:10.1029/2000JD900719

Examples

nrmse(1:3, c(1, 3, 2))
#> [1] 0.8164966