# scipy.special.betaincc#

scipy.special.betaincc(a, b, x, out=None) = <ufunc 'betaincc'>#

Complement of the regularized incomplete beta function.

Computes the complement of the regularized incomplete beta function, defined as [1]:

$\bar{I}_x(a, b) = 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,$

for $$0 \leq x \leq 1$$.

Parameters:
a, barray_like

Positive, real-valued parameters

xarray_like

Real-valued such that $$0 \leq x \leq 1$$, the upper limit of integration

outndarray, optional

Optional output array for the function values

Returns:
scalar or ndarray

Value of the regularized incomplete beta function

betainc

regularized incomplete beta function

betaincinv

inverse of the regularized incomplete beta function

betainccinv

inverse of the complement of the regularized incomplete beta function

beta

beta function

scipy.stats.beta

beta distribution

Notes

Added in version 1.11.0.

References

[1]

NIST Digital Library of Mathematical Functions https://dlmf.nist.gov/8.17

Examples

>>> from scipy.special import betaincc, betainc


The naive calculation 1 - betainc(a, b, x) loses precision when the values of betainc(a, b, x) are close to 1:

>>> 1 - betainc(0.5, 8, [0.9, 0.99, 0.999])
array([2.0574632e-09, 0.0000000e+00, 0.0000000e+00])


By using betaincc, we get the correct values:

>>> betaincc(0.5, 8, [0.9, 0.99, 0.999])
array([2.05746321e-09, 1.97259354e-17, 1.96467954e-25])