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 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. out is 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. out is never supported for JAX because JAX arrays are immutable. pdtr does not currently support out for 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 ])