XrDiscreteRV¶
- class xarray_einstats.stats.XrDiscreteRV(dist, *args, **kwargs)[source]¶
Wrapper for subclasses of
rv_discrete.Usage examples available at Intro to the stats module
See also
Examples
Evaluate the ppf of a Student-T distribution from DataArrays that need broadcasting:
from xarray_einstats import tutorial from xarray_einstats.stats import XrDiscreteRV from scipy import stats ds = tutorial.generate_mcmc_like_dataset(3) dist = XrDiscreteRV(stats.poisson, ds["mu"]) dist.ppf([.1, .5, .6])
<xarray.DataArray (quantile: 3, chain: 4, draw: 10, team: 6)> Size: 6kB 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 3.0 0.0 1.0 2.0 0.0 0.0 1.0 1.0 0.0 Coordinates: * quantile (quantile) float64 24B 0.1 0.5 0.6 * chain (chain) int64 32B 0 1 2 3 * draw (draw) int64 80B 0 1 2 3 4 5 6 7 8 9 * team (team) <U1 24B 'a' 'b' 'c' 'd' 'e' 'f'
Methods
XrDiscreteRV.__init__(dist, *args, **kwargs)XrDiscreteRV.cdf(*args[, apply_kwargs])Method wrapping
.cdfof the input distribution withxarray.apply_ufuncXrDiscreteRV.isf(*args[, apply_kwargs])Method wrapping
.isfof the input distribution withxarray.apply_ufuncXrDiscreteRV.logcdf(*args[, apply_kwargs])Method wrapping
.logcdfof the input distribution withxarray.apply_ufuncXrDiscreteRV.logpmf(*args[, apply_kwargs])Method wrapping
.logpmfof the input distribution withxarray.apply_ufuncXrDiscreteRV.logsf(*args[, apply_kwargs])Method wrapping
.logsfof the input distribution withxarray.apply_ufuncXrDiscreteRV.pmf(*args[, apply_kwargs])Method wrapping
.pmfof the input distribution withxarray.apply_ufuncXrDiscreteRV.ppf(*args[, apply_kwargs])Method wrapping
.ppfof the input distribution withxarray.apply_ufuncXrDiscreteRV.rvs(*args[, size, ...])Method wrapping
.rvsof the input distribution withxarray.apply_ufuncXrDiscreteRV.sf(*args[, apply_kwargs])Method wrapping
.sfof the input distribution withxarray.apply_ufunc