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

pdtrc

Poisson survival function

pdtrik

inverse of pdtr with respect to k

pdtri

inverse of pdtr with respect to m

Notes

Array API Standard Support

pdtr has experimental support for Python Array API Standard compatible backends in addition to NumPy. Please consider testing these features by setting an environment variable SCIPY_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

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 ])