scipy.special.gdtria#
- scipy.special.gdtria(p, b, x, out=None) = <wrapped_ufunc 'gdtria'>#
Inverse of
gdtrvs a.Returns the inverse with respect to the parameter a of
p = gdtr(a, b, x), the cumulative distribution function of the gamma distribution.- Parameters:
- parray_like
Probability values.
- barray_like
b parameter values of gdtr(a, b, x). b is the “shape” parameter of the gamma distribution.
- xarray_like
Nonnegative real values, from the domain of the gamma distribution.
- outndarray, optional
If a fourth argument is given, it must be a numpy.ndarray whose size matches the broadcast result of a, b and x. out is then the array returned by the function.
- Returns:
- ascalar or ndarray
Values of the a parameter such that
p = gdtr(a, b, x)`. ``1/ais the “scale” parameter of the gamma distribution.
See also
gdtrCDF of the gamma distribution.
gdtribInverse with respect to b of gdtr(a, b, x).
gdtrixInverse with respect to x of gdtr(a, b, x).
gammaincinvInverse of the incomplete regularized gamma function.
Notes
gdtriais implemented in terms of the incomplete gamma inverse asgdtria(p, b, x) = gammaincinv(b, p)/x.Array API Standard Support
gdtriahas 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 typically 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.gdtriadoes not currently supportoutfor the PyTorch backend.See Array API coverage for more information.
Examples
First evaluate
gdtr.>>> from scipy.special import gdtr, gdtria >>> p = gdtr(1.2, 3.4, 5.6) >>> print(p) 0.94378087442
Verify the inverse.
>>> gdtria(p, 3.4, 5.6) 1.2