climpred.metrics._crps#
- climpred.metrics._crps(forecast: Dataset, verif: Dataset, dim: str | List[str] | None = None, **metric_kwargs: Any) Dataset | DataArray[source]#
Continuous Ranked Probability Score (CRPS).
The CRPS can also be considered as the probabilistic Mean Absolute Error (
mae). It compares the empirical distribution of an ensemble forecast to a scalar observation. Smaller scores indicate better skill.\[CRPS = \int_{-\infty}^{\infty} (F(f) - H(f - o))^{2} df,\]where \(F(f)\) is the cumulative distribution function (CDF) of the forecast (since the verification data are not assigned a probability), and H() is the Heaviside step function where the value is 1 if the argument is positive (i.e., the forecast overestimates verification data) or zero (i.e., the forecast equals verification data) and is 0 otherwise (i.e., the forecast is less than verification data).
Note
The CRPS is expressed in the same unit as the observed variable. It generalizes the Mean Absolute Error (MAE), and reduces to the MAE if the forecast is determinstic.
- Parameters:
forecast – Forecast with
memberdim.verif – Verification data without
memberdim.dim – Dimension to apply metric over. Expects at least
member. Other dimensions are passed toxskillscoreand averaged.metric_kwargs – optional, see
xskillscore.crps_ensemble()
Notes
minimum
0.0
maximum
∞
perfect
0.0
orientation
negative
References
Matheson and Winkler [1976]
See also
Example
>>> HindcastEnsemble.verify( ... metric="crps", comparison="m2o", dim="member", alignment="same_inits" ... ) <xarray.Dataset> Size: 9kB Dimensions: (lead: 10, init: 52) Coordinates: * lead (lead) int32 40B 1 2 3 4 5 6 7 8 9 10 valid_time (lead, init) object 4kB 1955-01-01 00:00:00 ... 2015-01-01 00... init (init) object 416B 1954-01-01 00:00:00 ... 2005-01-01 00:00:00 skill <U11 44B 'initialized' Data variables: SST (lead, init) float64 4kB 0.1722 0.1202 ... 0.05428 0.1638 Attributes: prediction_skill_software: climpred https://climpred.readthedocs.io/ skill_calculated_by_function: HindcastEnsemble.verify() number_of_members: 10 alignment: same_inits metric: crps comparison: m2o dim: member reference: []