# naginterfaces.library.specfun.beta_​incomplete¶

naginterfaces.library.specfun.beta_incomplete(a, b, x)[source]

beta_incomplete computes values for the regularized incomplete beta function and its complement .

For full information please refer to the NAG Library document for s14cc

https://www.nag.com/numeric/nl/nagdoc_28.5/flhtml/s/s14ccf.html

Parameters
afloat

The argument of the function.

bfloat

The argument of the function.

xfloat

, upper limit of integration.

Returns
wfloat

The value of the incomplete beta function evaluated from zero to .

w1float

The value of the complement of the incomplete beta function , i.e., the incomplete beta function evaluated from to one.

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, and were zero.

Constraint: or must be nonzero.

(errno )

On entry, .

Constraint: .

(errno )

On entry, and were zero.

Constraint: or must be nonzero.

(errno )

On entry, and were zero.

Constraint: or must be nonzero.

Notes

beta_incomplete evaluates the regularized incomplete beta function and its complement in the normalized form

with

,

and ,

and the beta function is defined as where is the gamma function.

Several methods are used to evaluate the functions depending on the arguments , and . The methods include Wise’s asymptotic expansion (see Wise (1950)) when , continued fraction derived by DiDonato and Morris (1992) when , , and power series when or . When both and are large, specifically , , the DiDonato and Morris (1992) asymptotic expansion is employed for greater efficiency.

Once either or is computed, the other is obtained by subtraction from . In order to avoid loss of relative precision in this subtraction, the smaller of and is computed first.

beta_incomplete is derived from BRATIO in DiDonato and Morris (1992).

References

DiDonato, A R and Morris, A H, 1992, Algorithm 708: Significant digit computation of the incomplete beta function ratios, ACM Trans. Math. Software (18), 360–373

Wise, M E, 1950, The incomplete beta function as a contour integral and a quickly converging series for its inverse, Biometrika (37), 208–218