GOF_mean_absolute_error function

Calculates mean absolute error (MAE).

Calculates mean absolute error (MAE).

Calculates mean absolute error (MAE) between modeled (simulated) and observed values. Error is defined as modeled minus observed.

GOF_mean_absolute_error(mod, obs, 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.
  • 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.

Returns

Value of calculated mean absolute error (MAE).

Details

The absolute value of each modeled-observed pair error is calculated, then the mean of those values taken. Values returned are in units of input data.

Examples

GOF_mean_absolute_error(mod = example_mod$streamflow_cfs, obs = example_obs$streamflow_cfs)
  • Maintainer: Colin Penn
  • License: CC0
  • Last published: 2024-08-28