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

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

XrDiscreteRV.__init__(dist, *args, **kwargs)

XrDiscreteRV.cdf(*args[, apply_kwargs])

Method wrapping scipy.stats.rv_discrete.cdf with xarray.apply_ufunc

XrDiscreteRV.isf(*args[, apply_kwargs])

Method wrapping scipy.stats.rv_discrete.isf with xarray.apply_ufunc

XrDiscreteRV.logcdf(*args[, apply_kwargs])

Method wrapping scipy.stats.rv_discrete.logcdf with xarray.apply_ufunc

XrDiscreteRV.logpmf(*args[, apply_kwargs])

Method wrapping scipy.stats.rv_discrete.logpmf with xarray.apply_ufunc

XrDiscreteRV.logsf(*args[, apply_kwargs])

Method wrapping scipy.stats.rv_discrete.logsf with xarray.apply_ufunc

XrDiscreteRV.pmf(*args[, apply_kwargs])

Method wrapping scipy.stats.rv_discrete.pmf with xarray.apply_ufunc

XrDiscreteRV.ppf(*args[, apply_kwargs])

Method wrapping scipy.stats.rv_discrete.ppf with xarray.apply_ufunc

XrDiscreteRV.rvs(*args[, size, ...])

Method wrapping scipy.stats.rv_discrete.rvs with xarray.apply_ufunc

XrDiscreteRV.sf(*args[, apply_kwargs])

Method wrapping scipy.stats.rv_discrete.sf with xarray.apply_ufunc