scipy.special.pdtri#

scipy.special.pdtri(k, y, out=None) = <ufunc 'pdtri'>#

Inverse of pdtr with respect to m.

Returns the Poisson variable m such that the sum from 0 to k of the Poisson density is equal to the given probability y: calculated by gammainccinv(k + 1, y). k must be a nonnegative integer and y between 0 and 1.

Parameters:
karray_like

Number of occurrences (nonnegative, real).

yarray_like

Probability.

outndarray, optional

Optional output array for the function results.

Returns:
scalar or ndarray

Values of the shape parameter m such that pdtr(k, m) = y.

See also

pdtr

Poisson cumulative distribution function

pdtrc

Poisson survival function

pdtrik

Inverse of pdtr with respect to k

Notes

Array API Standard Support

pdtri 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

Dask

n/a

See Support for the array API standard for more information.

Examples

>>> import scipy.special as sc

Compute the CDF for several values of m:

>>> k = 1
>>> m = [0.5, 1, 1.5]
>>> p = sc.pdtr(k, m)
>>> p
array([0.90979599, 0.73575888, 0.5578254 ])

Invert the CDF with respect to the Poisson mean. We recover the values of m, as expected:

>>> sc.pdtri(k, p)
array([0.5, 1. , 1.5])

Verify the relation with gammainccinv:

>>> sc.gammainccinv(k + 1, p)
array([0.5, 1. , 1.5])