Computing $\mathrm{B}_{x,y}(\alpha+1,\beta) / \mathrm{B}_{x,y}(\alpha,\beta)$ numerically

92 Views Asked by At

I need to compute numerically ratios of the form:

$$\frac{\mathrm{B}_{x,y}(\alpha+1,\beta)}{\mathrm{B}_{x,y}(\alpha,\beta)} \tag{1}$$

where $\mathrm{B}_{z_1,z_2}(\alpha,\beta)$ is the incomplete Beta function:

$$\mathrm{B}_{z_1,z_2}(\alpha,\beta) = \int_{z_{1}}^{z_{2}}x^{\alpha-1}\left(1-x\right)^{\beta-1}\mathrm{d}x$$

and $\alpha,\beta > 1$.

The problem is that sometimes the numerator and denominator of (1) get really small or really big, specially for large values of $\alpha,\beta$, and cannot be represented in floating-point, so computing the ratio directly is a bad idea.

For the ordinary Beta function, this is not a problem, because of the useful property:

$$\frac{\mathrm{B}(\alpha+1,\beta)}{\mathrm{B}(\alpha,\beta)} = \frac{\alpha}{\alpha+\beta} \tag{2}$$

which allows the computation of the ratio without going through the intermediate values of the Beta, which can be very small or large.

Is there something similar to (2) for the incomplete Beta function that I can use to compute ratios like (1)? Or what is a good way to compute numerically (1)?

Note: All the numbers here are real numbers, inside their allowed domains so that the Beta functions make sense.

1

There are 1 best solutions below

0
On

There's a useful property here:

$$\frac{\mathrm{B}_{z_1,z_2}(a+1,b)}{\mathrm{B}_{z_1,z_2}(a,b)}=\frac{1}{a+b}\left( a - \frac{z_2^a (1-z_2)^b - z_1^a (1-z_1)^b}{\mathrm{B}_{z_1,z_2}(a,b)} \right)$$

The problem with this approach is that I still need to compute $\mathrm{B}_{z_1,z_2}(a,b)$, which can lead to underflow/overflow. This is just an idea (too large to fit in a comment), not a complete answer. I am waiting for someone to make a better suggestion, perhaps expanding along these lines.