xarray.Dataset.climepi.variance_decomposition#
- Dataset.climepi.variance_decomposition(data_var=None, fraction=False, internal_variability_method=None, deg=3, lam=None)[source]#
Decompose variance contributions from different climate uncertainty sources.
Partitions the variance of a data variable at each time point into contributions from internal variability, model uncertainty and scenario uncertainty.
- Parameters:
data_var (
strorlistofstr, optional) – Name of the data variable(s) to decompose.fraction (
bool, optional) – Whether to calculate the variance contributions as fractions of the total variance at each time, rather than the raw variances. Default isFalse.internal_variability_method (
str, optional) – Whether to characterize internal variability by computing ensemble statistics directly at each time point (‘direct’) or by estimating 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.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 variance decomposition of the selected data variable(s) along a new ‘source’ dimension.