Easy approximation of the incomplete beta function $\text{B}_x(a,b)$

7.1k Views Asked by At

I need to calculate $\text{B}_x(a,b)$ on the cheap, without too many coefficients and loops. For the complete $\text{B}(a,b)$, I can use $\Gamma(a)\Gamma(b)/\Gamma(a+b)$, and Stirling's approximation for $\Gamma(.)$. Is there a way to calculate the incomplete beta function using Stirling's approximation?

2

There are 2 best solutions below

0
On

I believe that one of the fastest ways to compute $\text{B}(a,b,x)$ is to simply use numerical integration. The integrand is very nice, and the interval is small. In fact, I think given a fixed amount of time, numerical integration will yield higher accuracy for $\text{B}(a,b)$ then Stirlings formula.

There are many times where we have explicit formulas for certain integrals in terms of the gamma function and other well known functions, but to evaluate those integrals the basic numerical integration is used instead of evaluating the known exact expression.

0
On

You can express ${\rm B}(x;a,b)$ in terms of the hypergeometric function
$$ F(a,b;c;z) = 1 + \frac{{ab}}{c}z + \frac{{a(a + 1)b(b + 1)}}{{c(c + 1)2!}}z^2 + \cdots , $$ as $$ {\rm B}(x;a,b) = \frac{{x^a }}{a}F(a,1 - b;a + 1;x) $$ or $$ {\rm B}(x;a,b) = \frac{{x^a (1 - x)^b }}{a}F(a + b,1;a + 1;x). $$ For this and more, see here.