BETAINCINV
This function solves for the unit-interval argument x in the regularized incomplete beta relation for fixed positive parameters a and b.
It finds x such that:
y = I_x(a,b)
where I_x(a,b) is the regularized incomplete beta function. The output lies in [0,1] when inputs are in-domain.
Excel Usage
=BETAINCINV(a, b, y)
a(float, required): First positive shape parameter.b(float, required): Second positive shape parameter.y(float, required): Regularized incomplete beta target value in the unit interval.
Returns (float): Unit-interval x value satisfying the inverse regularized incomplete beta equation.
Example 1: Inverse regularized incomplete beta at central probability
Inputs:
| a | b | y |
|---|---|---|
| 1.2 | 3.1 | 0.5 |
Excel formula:
=BETAINCINV(1.2, 3.1, 0.5)
Expected output:
0.242835
Example 2: Inverse regularized incomplete beta at low probability
Inputs:
| a | b | y |
|---|---|---|
| 2 | 5 | 0.1 |
Excel formula:
=BETAINCINV(2, 5, 0.1)
Expected output:
0.0925953
Example 3: Inverse regularized incomplete beta at high probability
Inputs:
| a | b | y |
|---|---|---|
| 7.5 | 0.4 | 0.8 |
Excel formula:
=BETAINCINV(7.5, 0.4, 0.8)
Expected output:
0.998143
Example 4: Inverse regularized incomplete beta at zero
Inputs:
| a | b | y |
|---|---|---|
| 2 | 2 | 0 |
Excel formula:
=BETAINCINV(2, 2, 0)
Expected output:
0
Python Code
from scipy.special import betaincinv as scipy_betaincinv
def betaincinv(a, b, y):
"""
Invert the regularized incomplete beta function with respect to x.
See: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.betaincinv.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.
y (float): Regularized incomplete beta target value in the unit interval.
Returns:
float: Unit-interval x value satisfying the inverse regularized incomplete beta equation.
"""
try:
if a <= 0 or b <= 0:
return "Error: a and b must be positive"
if y < 0 or y > 1:
return "Error: y must be between 0 and 1"
return float(scipy_betaincinv(a, b, y))
except Exception as e:
return f"Error: {str(e)}"Online Calculator
First positive shape parameter.
Second positive shape parameter.
Regularized incomplete beta target value in the unit interval.