climpred.metrics._rps¶
- climpred.metrics._rps(forecast, verif, dim=None, **metric_kwargs)[source]¶
Ranked Probability Score.
Note
install xskillscore from source to use most recent xs.rps function. xs=0.0.18 is erroneously limited to [0,1].
- Parameters
forecast (xr.object) – Raw forecasts with
member
dimension.verif (xr.object) – Verification data without
member
dim.dim (list or str) – Dimensions to aggregate. Requires to contain member.
category_edges (array_like) – Category bin edges used to compute the CDFs. Bins must span the limits of forecast and verification. Passed via metric_kwargs.
- Details:
minimum
0.0
maximum
∞
perfect
0.0
orientation
negative
See also
Example
>>> category_edges = np.array([-.5, 0., .5, 1.]) >>> HindcastEnsemble.verify(metric='rps', comparison='m2o', dim=['member', 'init'], ... alignment='same_verifs', category_edges=category_edges) <xarray.Dataset> Dimensions: (lead: 10) Coordinates: * lead (lead) int32 1 2 3 4 5 6 7 8 9 10 observations_category_edge <U67 '[-np.inf, -0.5), [-0.5, 0.0), [0.0, 0.5... forecasts_category_edge <U67 '[-np.inf, -0.5), [-0.5, 0.0), [0.0, 0.5... skill <U11 'initialized' Data variables: SST (lead) float64 0.115 0.1123 ... 0.1687 0.1875
>>> category_edges = np.array([9.5, 10., 10.5, 11.]) >>> PerfectModelEnsemble.verify(metric='rps', comparison='m2c', ... dim=['member','init'], category_edges=category_edges) <xarray.Dataset> Dimensions: (lead: 20) Coordinates: * lead (lead) int64 1 2 3 4 5 6 7 ... 15 16 17 18 19 20 observations_category_edge <U71 '[-np.inf, 9.5), [9.5, 10.0), [10.0, 10.... forecasts_category_edge <U71 '[-np.inf, 9.5), [9.5, 10.0), [10.0, 10.... Data variables: tos (lead) float64 0.08951 0.1615 ... 0.1399 0.2274