diagnostic.functions.mean_absolute_error#

mean_absolute_error(da_mod: DataArray, da_ref: DataArray, percentile: float = None) float[source]#

Calculate the Mean Absolute Error (MAE) between model forecasts and reference data. Optionally, calculate the MAE based on a specified percentile.

Parameters:
  • da_mod (xr.DataArray) – The model forecast data to compare.

  • da_ref (xr.DataArray) – The reference data to compare against.

  • percentile (float, optional) – The percentile (0 to 1) to calculate the MAE for, using the quantile values of the data arrays. If None, calculates the MAE for the entire data without considering percentiles.

Returns:

The Mean Absolute Error (MAE) between the model and reference data, or at the specified percentile.

Return type:

float