regularizedBeta

Computes the regularized incomplete beta function I(x; a, b) at point x.

The regularized incomplete beta function gives the cumulative probability for beta-distributed random variables. It is central to computing p-values for t-tests, F-tests, and other hypothesis tests. Uses Lentz's continued fraction algorithm with a symmetry relation for numerical stability.

Example:

regularizedBeta(0.5, 1.0, 1.0) // 0.5 (uniform on [0,1])
regularizedBeta(0.5, 2.0, 3.0) // 0.6875

Return

the regularized incomplete beta function value at x, in the range 0, 1.

Parameters

x

the point at which to evaluate, in the range 0, 1.

a

the first shape parameter. Must be positive.

b

the second shape parameter. Must be positive.

Throws

if the continued fraction does not converge within the iteration limit.