Stats

Wrappers for scipy.stats distributions.

Probability distributions

Note

These wrapper classes set some defaults and ensure proper alignment and broadcasting of all inputs, but use xarray.apply_ufunc under the hood. This means that while using kwargs for distribution parameters is supported, using positional arguments is recommended. In fact, if no positional arguments are present, automatic broadcasting will still work but the output will be a numpy array.

XrContinuousRV(dist, *args, **kwargs)

Wrapper for subclasses of rv_continuous.

XrDiscreteRV(dist, *args, **kwargs)

Wrapper for subclasses of rv_discrete.

multivariate_normal([mean, cov, dims])

An xarray aware multivariate normal random variable.

Summary statistics

circmean(da[, dims, high, low, nan_policy])

Wrap and extend scipy.stats.circmean.

circstd(da[, dims, high, low, nan_policy])

Wrap and extend scipy.stats.circstd.

circvar(da[, dims, high, low, nan_policy])

Wrap and extend scipy.stats.circvar.

gmean(da[, dims, dtype, weights])

Wrap and extend scipy.stats.gmean.

hmean(da[, dims, dtype])

Wrap and extend scipy.stats.hmean.

kurtosis(da[, dims, fisher, bias, nan_policy])

Wrap and extend scipy.stats.kurtosis.

skew(da[, dims, bias, nan_policy])

Wrap and extend scipy.stats.skew.

median_abs_deviation(da[, dims, center, ...])

Wrap and extend scipy.stats.median_abs_deviation.

Other statistical functions

rankdata(da[, dims, method])

Wrap and extend scipy.stats.rankdata.

logsumexp(da[, dims, b, return_sign])

Wrap and extend scipy.special.logsumexp.

Convenience functions

get_default_dims(dims)

Get default dims on which to perfom an operation.