radarx.retrieve.nowcast_verification.brier_score#
- radarx.retrieve.nowcast_verification.brier_score(probability, event, *, dim=None)[source]#
Brier score of probability forecasts of an event.
The mean squared difference between the forecast probability
pand the outcomeo(1 if the event happened, else 0), Brier (1950) [1]:BS = mean (p - o)**2
0 is perfect; always forecasting the observed frequency
fgivesf (1 - f). NaN values are left out.- Parameters:
probability (
xarray.DataArray) – Probabilities between 0 and 1, e.g. fromexceedance_probability().event (
xarray.DataArray) – Outcome: boolean or 0 and 1 (NaN: missing). Broadcast againstprobability.dim (
stror sequence ofstr, optional) – Dimensions to average over. Default: all of them.
- Returns:
xarray.DataArray– The score (float32, dimensionless).- Raises:
ValueError – If a probability lies outside 0 to 1 or
dimis not a dimension.
Notes
Dask. This function computes the dask array: it averages over the whole fields. The input is loaded into memory and the result is held in memory.
See also
References
Examples
>>> bs = radarx.retrieve.brier_score(prob, truth >= 35.0)