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’s member_dim. dim should contain member when comparison is probabilistic but should not contain member when comparison=e2c. Defaults to None meaning that all dimensions other than lead 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 dimensions init and member:

>>> 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 dimensions member and init while also calculating reference skill for the persistence, climatology and uninitialized forecast.

>>> PerfectModelEnsemble.verify(metric='acc', comparison='m2m',
...     dim=['init', 'member'],
...     reference=['persistence', 'climatology' ,'uninitialized'])
<xarray.Dataset>
Dimensions:  (skill: 4, 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
  * skill    (skill) <U13 'initialized' 'persistence' ... 'uninitialized'
Data variables:
    tos      (skill, lead) float64 0.7941 0.7489 0.5623 ... 0.1327 0.4547 0.3253