climpred.reference.compute_persistence¶
- climpred.reference.compute_persistence(initialized: xarray.Dataset, verif: xarray.Dataset, metric: Union[str, climpred.metrics.Metric] = 'acc', comparison: Union[str, climpred.comparisons.Comparison] = 'm2o', dim: Optional[Union[str, List[str]]] = 'init', alignment: str = 'same_verifs', **metric_kwargs: Any) xarray.Dataset [source]¶
Compute the skill of a persistence forecast from a simulation.
This function unlike
compute_persistence_from_first_lead()
is not sensitive tocomparison
. Requiresclimpred.set_options(PerfectModel_persistence_from_initialized_lead_0=False)
.- Parameters
initialized – The initialized ensemble.
verif – Verification data.
metric – Metric name to apply at each lag for the persistence computation. Default:
"pearson_r"
.alignment – which inits or verification times should be aligned?
"maximize"
: maximize the degrees of freedom by slicinginitialized
andverif
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.
dim – dimension to apply metric over.
** metric_kwargs – additional keywords to be passed to metric (see the arguments required for a given metric in Metrics).
- Returns
pers –
- Results of persistence forecast with the input metric
applied.
- Reference:
Chapter 8 (Short-Term Climate Prediction) in Van den Dool, Huug. Empirical methods in short-term climate prediction. Oxford University Press, 2007.