climpred.classes.HindcastEnsemble.verify

HindcastEnsemble.verify(reference=None, metric=None, comparison=None, dim=None, alignment=None, **metric_kwargs)[source]

Verifies the initialized ensemble against observations.

Note

This will automatically verify against all shared variables between the initialized ensemble and observations/verification data.

Parameters
  • reference (str, list of str) – Type of reference forecasts to also verify against the observations. Choose one or more of [‘uninitialized’, ‘persistence’, ‘climatology’]. Defaults to None.

  • metric (str, Metric) – Metric to apply for verification. see metrics.

  • comparison (str, Comparison) – How to compare to the observations/verification data. See comparisons.

  • dim (str, list of str) – Dimension(s) to apply metric over. 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=e2o. Defaults to None meaning that all dimensions other than lead are reduced.

  • alignment (str) –

    which inits or verification times should be aligned?

    • ’maximize’: maximize the degrees of freedom by slicing hind and verif to a common time frame at each lead.

    • ’same_inits’: slice to a common init frame prior to computing metric. This philosophy follows the thought that each lead should be based on the same set of initializations.

    • ’same_verif’: slice to a common/consistent verification time frame prior to computing metric. This philosophy follows the thought that each lead should be based on the same set of verification dates.

  • **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 verification (m2o) over the same verification time (same_verifs) for all leads reducing dimensions init and member:

>>> HindcastEnsemble.verify(metric='rmse', comparison='m2o',
...     alignment='same_verifs', dim=['init','member'])
<xarray.Dataset>
Dimensions:  (lead: 10)
Coordinates:
  * lead     (lead) int32 1 2 3 4 5 6 7 8 9 10
    skill    <U11 'initialized'
Data variables:
    SST      (lead) float64 0.08516 0.09492 0.1041 ... 0.1525 0.1697 0.1785

Pearson’s Anomaly Correlation (‘acc’) comparing the ensemble mean with the verification (e2o) over the same initializations (same_inits) for all leads reducing dimension init while also calculating reference skill for the persistence, climatology and uninitialized forecast.

>>> HindcastEnsemble.verify(metric='acc', comparison='e2o',
...     alignment='same_inits', dim='init',
...     reference=['persistence', 'climatology' ,'uninitialized'])
<xarray.Dataset>
Dimensions:  (skill: 4, lead: 10)
Coordinates:
  * lead     (lead) int32 1 2 3 4 5 6 7 8 9 10
  * skill    (skill) <U13 'initialized' 'persistence' ... 'uninitialized'
Data variables:
    SST      (skill, lead) float64 0.9023 0.8807 0.8955 ... 0.9078 0.9128 0.9159