climpred.classes.PerfectModelEnsemble.verify#
- PerfectModelEnsemble.verify(metric: Optional[Union[str, Metric]] = None, comparison: Optional[Union[str, Comparison]] = None, dim: Optional[Union[str, List[str]]] = None, reference: Optional[Union[List[str], str]] = None, groupby: Optional[Union[DataArray, str]] = None, **metric_kwargs: Optional[Any]) Dataset [source]#
Verify initialized predictions against a configuration of its members.
Note
The configuration of the other ensemble members is based off of the
comparison
keyword argument.- Parameters:
metric – Metric to apply for verification, see metrics
comparison – How to compare the initialized prediction ensemble with itself, see comparisons.
dim – 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 – Type of reference forecasts with which to verify against. One or more of
["uninitialized", "persistence", "climatology"]
. Defaults toNone
meaning no reference. Forpersistence
, choose betweenset_options(PerfectModel_persistence_from_initialized_lead_0)=False
(default) usingcompute_persistence()
orset_options(PerfectModel_persistence_from_initialized_lead_0)=True
usingcompute_persistence_from_first_lead()
.groupby – group
init
before passinginitialized
toverify
.**metric_kwargs – Arguments passed to
metric
.
- Returns:
initialized
andreference
forecast skill reduced by dimensionsdim
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 Attributes: prediction_skill_software: climpred https://climpred.readthedocs.io/ skill_calculated_by_function: PerfectModelEnsemble.verify() number_of_initializations: 12 number_of_members: 10 metric: rmse comparison: m2e dim: ['init', 'member'] reference: []
Continuous Ranked Probability Score (
"crps"
) comparing every member to every other member ("m2m"
) reducing dimensionsmember
andinit
while also calculating reference skill for thepersistence
,climatology
anduninitialized
forecast.>>> PerfectModelEnsemble.verify( ... metric="crps", ... 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.0621 0.07352 0.08678 ... 0.122 0.1246 Attributes: prediction_skill_software: climpred https://climp... skill_calculated_by_function: PerfectModelEnsemble.v... number_of_initializations: 12 number_of_members: 10 metric: crps comparison: m2m dim: ['init', 'member'] reference: ['persistence', 'clima... PerfectModel_persistence_from_initialized_lead_0: False