scipy.special.bdtr#
- scipy.special.bdtr(k, n, p, out=None) = <ufunc 'bdtr'>#
Binomial distribution cumulative distribution function.
Sum of the terms 0 through floor(k) of the Binomial probability density.
\[\mathrm{bdtr}(k, n, p) = \sum_{j=0}^{\lfloor k \rfloor} {{n}\choose{j}} p^j (1-p)^{n-j}\]- Parameters:
- karray_like
Number of successes (double), rounded down to the nearest integer.
- narray_like
Number of events (int).
- parray_like
Probability of success in a single event (float).
- outndarray, optional
Optional output array for the function values
- Returns:
- yscalar or ndarray
Probability of floor(k) or fewer successes in n independent events with success probabilities of p.
Notes
The terms are not summed directly; instead the regularized incomplete beta function is employed, according to the formula,
\[\mathrm{bdtr}(k, n, p) = I_{1 - p}(n - \lfloor k \rfloor, \lfloor k \rfloor + 1).\]Wrapper for the Cephes [1] routine
bdtr
.bdtr
has experimental support for Python Array API Standard compatible backends in addition to NumPy. Please consider testing these features by setting an environment variableSCIPY_ARRAY_API=1
and providing CuPy, PyTorch, JAX, or Dask arrays as array arguments. The following combinations of backend and device (or other capability) are supported.Library
CPU
GPU
NumPy
✅
n/a
CuPy
n/a
✅
PyTorch
✅
⛔
JAX
⚠️ no JIT
⛔
Dask
✅
n/a
See Support for the array API standard for more information.
References
[1]Cephes Mathematical Functions Library, http://www.netlib.org/cephes/