scipy.special.pdtr#
- scipy.special.pdtr(k, m, out=None) = <ufunc 'pdtr'>#
Poisson cumulative distribution function.
Defined as the probability that a Poisson-distributed random variable with event rate \(m\) is less than or equal to \(k\). More concretely, this works out to be [1]
\[\exp(-m) \sum_{j = 0}^{\lfloor{k}\rfloor} \frac{m^j}{j!}.\]- Parameters:
- karray_like
Number of occurrences (nonnegative, real)
- marray_like
Shape parameter (nonnegative, real)
- outndarray, optional
Optional output array for the function results
- Returns:
- scalar or ndarray
Values of the Poisson cumulative distribution function
See also
Notes
Array API Standard Support
pdtrhas support for Python Array API Standard compatible backends in addition to NumPy. The following combinations of backend and device (or other capability) are supported.Library
CPU
GPU
NumPy
✅
n/a
CuPy
n/a
✅
PyTorch
✅
⛔
JAX
✅
⛔
Dask
✅
n/a
For the NumPy backend, this function supports all NumPy ufunc keyword arguments. Other backends may support
out, but none of the other ufunc kwargs.outis typically supported for CuPy and PyTorch, but not currently in cases where SciPy relies on a generic Array API implementation or, for PyTorch on CPU, falls back to the NumPy backend.outis never supported for JAX because JAX arrays are immutable.pdtrdoes not currently supportoutfor the PyTorch backend.See Support for the array API standard for more information.
References
Examples
>>> import numpy as np >>> import scipy.special as sc
It is a cumulative distribution function, so it converges to 1 monotonically as k goes to infinity.
>>> sc.pdtr([1, 10, 100, np.inf], 1) array([0.73575888, 0.99999999, 1. , 1. ])
It is discontinuous at integers and constant between integers.
>>> sc.pdtr([1, 1.5, 1.9, 2], 1) array([0.73575888, 0.73575888, 0.73575888, 0.9196986 ])