xarray_einstats.stats.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)> 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 0.1 0.5 0.6 * chain (chain) int64 0 1 2 3 * draw (draw) int64 0 1 2 3 4 5 6 7 8 9 * team (team) <U1 'a' 'b' 'c' 'd' 'e' 'f'
Methods