pyPDAF.PDAF.diag_crps

pyPDAF.PDAF.diag_crps(dim_p: int, dim_ens: int, element: int, oens: np.ndarray, obs: np.ndarray) Tuple[float, float, float, float, int]

Compute the continuous ranked probability score (CRPS).

CRPS measures how well the ensemble distribution represented by oens predicts the verifying value in obs. Smaller values indicate a better probabilistic forecast. The routine also returns the Hersbach (2000) decomposition into reliability, potential CRPS, and uncertainty. An informative ensemble has low potential CRPS relative to uncertainty, while the reliability term measures miscalibration of ensemble probabilities.

This wrapper uses PDAF’s internal filter communicator for the required global reductions. Use pyPDAF.PDAF.diag_crps_nompi() when all data are already available on one process.

Parameters:
  • dim_p (int) – Size of the process-local state or observation vector.

  • dim_ens (int) – Ensemble size.

  • element (int) – Full-vector element index for which CRPS is evaluated. If element=0, PDAF computes the mean CRPS over all dim_p local entries and over all filter processes. Positive values select one element of the global vector.

  • oens (ndarray[np.float64, ndim=2]) – Ensemble values for the observed or state quantity. The array shape is (dim_p, dim_ens); columns are ensemble members.

  • obs (ndarray[np.float64, ndim=1]) – Verifying values, e.g. observations or truth. The array shape is (dim_p,).

Returns:

  • crps (float) – Continuous ranked probability score.

  • reli (float) – Reliability contribution. This term is small when the observed frequencies are consistent with the ensemble probabilities.

  • pot_crps (float) – Potential CRPS, the CRPS remaining after removing the reliability penalty.

  • uncert (float) – Uncertainty of the verifying values. This is only meaningful when averaging over multiple cases, i.e. with element=0.

  • status (int) – PDAF status flag. 0 indicates success; 100 indicates an invalid element index.

References

Hersbach, H. (2000). Decomposition of the continuous ranked probability score for ensemble prediction systems. Weather and Forecasting, 15, 559-570.