climpred.classes.PerfectModelEnsemble.verify¶
- PerfectModelEnsemble.verify(metric=None, comparison=None, dim=None, reference=None, **metric_kwargs)[source]¶
Verify initialized predictions against a configuration of other ensemble members.
Note
The configuration of the other ensemble members is based off of the
comparison
keyword argument.- Parameters
metric (str,
Metric
) – Metric to apply in the comparison. See metrics.comparison (str,
Comparison
) – How to compare the initialized prediction ensemble with itself, see comparisons.dim (str, list of str) – Dimension(s) over which to apply
metric
.dim
is passed on to xskillscore.{metric} and includes xskillscore’smember_dim
.dim
should containmember
whencomparison
is probabilistic but should not containmember
whencomparison=e2c
. Defaults toNone
meaning that all dimensions other thanlead
are reduced.reference (str, list of str) – Type of reference forecasts with which to verify. One or more of [‘uninitialized’, ‘persistence’, ‘climatology’].
**metric_kwargs (optional) – Arguments passed to
metric
.
- Returns
Dataset with dimension skill reduced by dim containing initialized and reference skill(s) if specified.
Example
Root mean square error (
rmse
) comparing every member with the ensemble mean forecast (m2e
) for all leads reducing dimensionsinit
andmember
:>>> PerfectModelEnsemble.verify(metric='rmse', comparison='m2e', ... dim=['init','member']) <xarray.Dataset> Dimensions: (lead: 20) Coordinates: * lead (lead) int64 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Data variables: tos (lead) float32 0.1028 0.1249 0.1443 0.1707 ... 0.2113 0.2452 0.2297
Pearson’s Anomaly Correlation (‘acc’) comparing every member to every other member (
m2m
) reducing dimensionsmember
andinit
while also calculating reference skill for thepersistence
,climatology
anduninitialized
forecast.>>> PerfectModelEnsemble.verify(metric='acc', comparison='m2m', ... dim=['init', 'member'], ... reference=['persistence', 'climatology' ,'uninitialized']) <xarray.Dataset> Dimensions: (lead: 20, skill: 4) Coordinates: * lead (lead) int64 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 * skill (skill) <U13 'initialized' 'persistence' ... 'uninitialized' Data variables: tos (skill, lead) float64 0.7941 0.7489 0.5623 ... 0.1327 0.4547 0.3253