BETAINC
The regularized incomplete beta function evaluates a normalized cumulative integral of beta-kernel terms. It is widely used in cumulative probability calculations and ratio-based special-function identities.
It is defined as:
I_x(a,b)=\frac{\Gamma(a+b)}{\Gamma(a)\Gamma(b)}\int_0^x t^{a-1}(1-t)^{b-1}\,dt
for positive a,b and 0\le x\le 1. This wrapper returns the regularized value in [0,1].
Excel Usage
=BETAINC(a, b, x)
a(float, required): First positive shape parameter.b(float, required): Second positive shape parameter.x(float, required): Upper integration bound in the unit interval.
Returns (float): Regularized incomplete beta value for the given parameters.
Example 1: Regularized incomplete beta at upper bound one
Inputs:
| a | b | x |
|---|---|---|
| 0.2 | 3.5 | 1 |
Excel formula:
=BETAINC(0.2, 3.5, 1)
Expected output:
1
Example 2: Regularized incomplete beta at midpoint
Inputs:
| a | b | x |
|---|---|---|
| 1.4 | 3.1 | 0.5 |
Excel formula:
=BETAINC(1.4, 3.1, 0.5)
Expected output:
0.81489
Example 3: Regularized incomplete beta with moderate shapes
Inputs:
| a | b | x |
|---|---|---|
| 2.2 | 3.1 | 0.4 |
Excel formula:
=BETAINC(2.2, 3.1, 0.4)
Expected output:
0.493396
Example 4: Regularized incomplete beta at lower bound zero
Inputs:
| a | b | x |
|---|---|---|
| 2 | 5 | 0 |
Excel formula:
=BETAINC(2, 5, 0)
Expected output:
0
Python Code
from scipy.special import betainc as scipy_betainc
def betainc(a, b, x):
"""
Compute the regularized incomplete beta function.
See: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.betainc.html
This example function is provided as-is without any representation of accuracy.
Args:
a (float): First positive shape parameter.
b (float): Second positive shape parameter.
x (float): Upper integration bound in the unit interval.
Returns:
float: Regularized incomplete beta value for the given parameters.
"""
try:
if a <= 0 or b <= 0:
return "Error: a and b must be positive"
if x < 0 or x > 1:
return "Error: x must be between 0 and 1"
return float(scipy_betainc(a, b, x))
except Exception as e:
return f"Error: {str(e)}"Online Calculator
First positive shape parameter.
Second positive shape parameter.
Upper integration bound in the unit interval.