GOF_rmse {HyMETT}R Documentation

Calculate root-mean-square error with options to normalize

Description

Calculate root-mean-square error (RMSE) between modeled (simulated) and observed values. Error is defined as modeled minus observed.

Usage

GOF_rmse(
  mod,
  obs,
  normalize = c("none", "mean", "range", "stdev", "iqr", "iqr-1", "iqr-2", "iqr-3",
    "iqr-4", "iqr-5", "iqr-6", "iqr-7", "iqr-8", "iqr-9", NULL),
  na.rm = TRUE
)

Arguments

mod

'numeric' vector. Modeled or simulated values. Must be same length as obs.

obs

'numeric' vector. Observed or comparison values. Must be same length as mod.

normalize

'character' value. Option to normalize the root-mean-square error (NRMSE) by several normalizing options. Default is 'none'(no normalizing). RMSE is returned.
'mean'. RMSE is normalized by the mean of obs.
'range'. RMSE is normalized by the range (max - min) of obs.
'stdev'. RMSE is normalized by the standard deviation of obs.
'iqr-#'. RMSE is normalized by the inter-quartile range of obs, with distribution type (see stats::quantile function) indicated by integer number (for example "iqr-8"). If no type specified, default type is iqr-7, the quantile function default.

na.rm

'boolean' TRUE or FALSE. Should NA values be removed before computing. If any NA values are present in mod or obs, the ith position from each will be removed before calculating. If NA values are present and na.rm = FALSE, then function will return NA. Default is TRUE.

Value

'numeric' value of computed root-mean-square error (RMSE) or normalized root-mean-square error (NRMSE)

Examples

# RMSE
GOF_rmse(mod = example_mod$streamflow_cfs, obs = example_obs$streamflow_cfs)
# NRMSE
GOF_rmse(
  mod = example_mod$streamflow_cfs, obs = example_obs$streamflow_cfs, normalize = 'stdev'
)


[Package HyMETT version 1.1.2 Index]