radarx.retrieve.nowcast_verification.reliability#

radarx.retrieve.nowcast_verification.reliability(probability, event, *, bins=10)[source]#

Reliability diagram: observed frequency for binned forecast probability.

The pairs of forecast probability and outcome are sorted into bins equal intervals of probability, and for each the mean forecast probability and the observed relative frequency are given, the calibration-refinement view of Murphy and Winkler (1987) [1]. A reliable forecast lies on the diagonal. All dimensions are pooled. NaN pairs are left out.

Parameters:
  • probability (xarray.DataArray) – Probabilities between 0 and 1.

  • event (xarray.DataArray) – Outcome: boolean or 0 and 1; broadcast against probability.

  • bins (int, optional) – Number of probability intervals. Default 10.

Returns:

xarray.Dataset – On the dimension bin: forecast_probability (mean probability in the bin), observed_frequency and count (NaN, NaN and 0 for an empty bin); bin holds the centres of the intervals.

Raises:

ValueError – If bins is less than 1 or a probability lies outside 0 to 1.

Notes

Dask. This function computes the dask array: it counts over the whole fields. The input is loaded into memory and the result is held in memory.

See also

brier_score

References

Examples

>>> table = radarx.retrieve.reliability(prob, truth >= 35.0)