xarray.Dataset.climepi.ensemble_stats#
- Dataset.climepi.ensemble_stats(data_var=None, uncertainty_level=90, internal_variability_method=None, deg=3, lam=None)[source]#
Compute a range of ensemble statistics for a data variable.
- Parameters:
data_var (
HashableorlistofHashable, optional) – Name(s) of the data variable(s) to compute the ensemble statistics for. If not provided, all non-bounds data variables will be used.uncertainty_level (
float, optional) – Uncertainty level (percentage) for computing ensemble percentiles. Default is 90.internal_variability_method (
str, optional) – Whether to compute statistics directly at each time point (‘direct’) or to estimate them using a polynomial (‘polyfit’) or spline (‘splinefit’) fit to the time series, assuming the variance is constant in time. By default, the ‘direct’ method is used if multiple realizations are available (i.e., the dataset has a non-singleton ‘realization’ dimension), and the ‘polyfit’ method is used if only a single realization is available. Note that if the ‘splinefit’ method is used and the dataset has a non-singleton ‘realization’ dimension, then the spline fit is applied to the mean of the realizations at each time point.deg (
int, optional) – Degree of the polynomial to fit to the time series if using the ‘polyfit’ method (ignored if using other methods). Default is 3.lam (
float, optional) – Smoothing parameter passed toscipy.interpolate.make_smoothing_spline()if using the ‘splinefit’ method (ignored if using other methods). Default isNone.
- Returns:
xarray.Dataset– A new dataset containing the computed ensemble statistics for the selected data variable(s).