I’m glad it was helpful. By the way, I’ve finally found the functions in PyMC. they are:
inverse cdf: pm.math.probit
cdf: pm.math.invprobit
You can see the source here: pymc.math — PyMC 4.1.7 documentation
Note that pm.math.probit uses the formula I posted before, without the shift you added. I don’t quite get why have you added that shift, the only different version of the formula I’ve seen (as in Wikipedia) is:
def invcdf(x):
return pm.math.sqrt(2) * pm.math.erfinv(2*x - 1)
I have only tried the version I posted above, the one used by PyMC,and it usually works fine for me (I don’t know your specific case though).