scipy.special.betainccinv#
- scipy.special.betainccinv(a, b, y, out=None) = <wrapped_ufunc 'betainccinv'>#
Inverse of the complemented regularized incomplete beta function.
Computes \(x\) such that:
\[y = 1 - I_x(a, b) = 1 - \frac{\Gamma(a+b)}{\Gamma(a)\Gamma(b)} \int_0^x t^{a-1}(1-t)^{b-1}dt,\]where \(I_x\) is the normalized incomplete beta function
betaincand \(\Gamma\) is thegammafunction [1].- Parameters:
- a, barray_like
Positive, real-valued parameters
- yarray_like
Real-valued input
- outndarray, optional
Optional output array for function values
- Returns:
- scalar or ndarray
Value of the inverse of the complemented regularized incomplete beta function
See also
Notes
Added in version 1.11.0.
This function wraps the
ibetac_invroutine from the Boost Math C++ library [2].Array API Standard Support
betainccinvhas 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.betainccinvdoes not currently supportoutfor the PyTorch backend.See Array API coverage for more information.
References
[1]NIST Digital Library of Mathematical Functions https://dlmf.nist.gov/8.17
[2]The Boost Developers. “Boost C++ Libraries”. https://www.boost.org/.
Examples
>>> from scipy.special import betainccinv, betaincc
This function is the inverse of
betainccfor fixed values of \(a\) and \(b\).>>> a, b = 1.2, 3.1 >>> y = betaincc(a, b, 0.2) >>> betainccinv(a, b, y) 0.2
>>> a, b = 7, 2.5 >>> x = betainccinv(a, b, 0.875) >>> betaincc(a, b, x) 0.875