scipy.special.pdtrc#
- scipy.special.pdtrc(k, m, out=None) = <ufunc 'pdtrc'>#
Poisson survival function.
Returns the sum of the terms from k+1 to infinity of the Poisson distribution: sum(exp(-m) * m**j / j!, j=k+1..inf) = gammainc( k+1, m). Arguments must both be non-negative doubles.
- 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 survival function
See also
Notes
Array API Standard Support
pdtrchas 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.pdtrcdoes not currently supportoutfor the PyTorch backend.See Support for the array API standard for more information.
Examples
>>> import numpy as np >>> import scipy.special as sc
It is a survival function, so it decreases to 0 monotonically as k goes to infinity.
>>> k = np.array([1, 10, 100, np.inf]) >>> sc.pdtrc(k, 1) array([2.64241118e-001, 1.00477664e-008, 3.94147589e-161, 0.00000000e+000])
It can be expressed in terms of the lower incomplete gamma function
gammainc.>>> sc.gammainc(k + 1, 1) array([2.64241118e-001, 1.00477664e-008, 3.94147589e-161, 0.00000000e+000])