I am working in python. I have a function for incomplete beta. Iow would I calculate tCDF and invT using this? the incomplete beta function that I have is this:
def incBeta(a, b, x):
# Shortcut special cases
if (x == 0):
return 0;
elif (x == 1):
return 1;
# otherwise calculate things.
else:
lbeta = math.lgamma(a+b) - math.lgamma(a) - math.lgamma(b) + a * math.log(x) + b * math.log(1-x)
if (x < (a+1) / (a+b+2)):
return math.exp(lbeta) * contfractbeta(a, b, x) / a;
else:
return 1 - math.exp(lbeta) * contfractbeta(b, a, 1-x) / b;
How do I calculate the tcdf and invT using the value returned from this?