earthkit.meteo.score.mean_error

earthkit.meteo.score.mean_error(fcst, obs, over, weights=None)

Calculates the mean error between a forecast and observations.

Warning

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

The mean error is defined as:

\[e = \frac{\sum_{i=1}^N (f_i - o_i) w_i}{\sum_{i=1}^N w_i}\]

where:

  • \(f_i\) is the forecast,

  • \(o_i\) are the observations,

  • \(w_i\) are the weights,

  • \(e\) is the mean error.

See also

This function leverages the scores.continuous.additive_bias function.

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

  • obs (xarray object) – The observations xarray.

  • over (str or list of str) – The dimension(s) over which to aggregate.

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

Returns:

  • xarray object – The mean error between the forecast and observations.

  • The function returns an object of the same type as the input arguments.

Return type:

T