earthkit.meteo.score.xarray.abs_error

earthkit.meteo.score.xarray.abs_error(fcst, obs, agg_method=None, agg_dim=None, agg_weights=None, is_angular=False)

Calculates the absolute error between a forecast and observations.

Warning

Experimental API. This function may change or be removed without notice.

The absolute error is defined as:

\[e_i = |f_i - o_i|\]

where:

  • \(f_i\) is the forecast,

  • \(o_i\) are the observations,

  • \(e_i\) is the absolute error.

See also

This function leverages the scores.continuous.mae function.

Parameters:
  • fcst (xarray object) – The forecast xarray.

  • obs (xarray object) – The observations xarray.

  • agg_method (str, optional) – The aggregation method to apply over agg_dim. Default is None, which means no aggregation.

  • agg_dim (str or list of str, optional) – The dimension(s) over which to aggregate. Default is None.

  • agg_weights (xarray object, optional) – Weights to apply during aggregation. Default is None.

  • is_angular (bool, optional) – Whether the data represents angular quantities in degrees. Default is False.

Returns:

The error between the forecast and observations, possibly aggregated.

Return type:

xarray object