earthkit.meteo.score.mean_squared_error¶
- earthkit.meteo.score.mean_squared_error(fcst, obs, over, weights=None, is_angular=False)¶
Calculates the mean squared error between a forecast and observations.
Warning
Experimental API. This function may change or be removed without notice.
The mean squared error is defined as:
\[e = \frac{\sum_{i=1}^N (f_i - o_i)^2 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 squared error.
See also
This function leverages the scores.continuous.mse function.
- Parameters:
fcst (
xarray object) – The forecast xarray.obs (
xarray object) – The observations xarray.over (
strorlistofstr) – The dimension(s) over which to aggregate.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:
xarray object– The mean squared error between the forecast and observations.The function returns an objectofthe same type as the input arguments.
- Return type:
T