scipy.special.betaincinv#
- scipy.special.betaincinv(a, b, y, out=None) = <ufunc 'betaincinv'>#
Inverse of the regularized incomplete beta function.
Computes \(x\) such that:
\[y = I_x(a, b) = \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
betainc
and \(\Gamma\) is thegamma
function [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 regularized incomplete beta function
Notes
This function wraps the
ibeta_inv
routine from the Boost Math C++ library [2].betaincinv
has experimental support for Python Array API Standard compatible backends in addition to NumPy. Please consider testing these features by setting an environment variableSCIPY_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
⚠️ no JIT
⛔
Dask
✅
n/a
See Support for the array API standard 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
>>> import scipy.special as sc
This function is the inverse of
betainc
for fixed values of \(a\) and \(b\).>>> a, b = 1.2, 3.1 >>> y = sc.betainc(a, b, 0.2) >>> sc.betaincinv(a, b, y) 0.2 >>> >>> a, b = 7.5, 0.4 >>> x = sc.betaincinv(a, b, 0.5) >>> sc.betainc(a, b, x) 0.5