Skip to main content

betai

betai (a, b, x [, accuracy ])

The betai function returns the regularized incomplete beta function Ix (a, b ),

Ix(a,b)=B(x;a,b)B(a,b).\displaystyle I_{x}(a, b)=\frac{B(x ; a, b)}{B(a, b)} .

Here

B(x;a,b)=0xta1(1t)b1dt.\displaystyle B(x ; a, b)=\int_{0}^{x} t^{a-1}(1-t)^{b-1} d t .

where a, b > 0, and 0 <= x <= 1.

Optionally, accuracy can be used to specify the desired fractional accuracy.

Details

The accuracy parameter specifies the fractional accuracy that you desire. That is, if you set accuracy to 1e-7, that means that you wish that the absolute value of (factual-freturned)/factual be less than 10-7.

Larger values of accuracy (poorer accuracy) result in evaluation of fewer terms of a series, which means the function executes somewhat faster.

A single-precision level of accuracy is about 3x10-7, double-precision about 2x10-16. The betai function will return full double-precision accuracy for small values of a and b. Achievable accuracy declines as a and b increase:

abxbetaiAccuracy Achievable
11.50.50.646447full double precision (2x10-16)
8100.50.6854706x10-16
20210.50.5626852x10-15
20210.11.87186e-105x10-15