Esempio n. 1
0
def normal_cdf_moment_ratio(n, x):
    mpmath.mp.dps = 500
    xmpf = x._to_mpmath(500)
    nmpf = n._to_mpmath(500)
    if x < 0:
        return Float(mpmath.power(2, -0.5 - nmpf / 2) * mpmath.hyperu(nmpf / 2 + 0.5, 0.5, xmpf * xmpf / 2))
    return Float(mpmath.exp(xmpf * xmpf / 4) * mpmath.pcfu(0.5 + nmpf, -xmpf))
def float_mp_hyperu(a, b, x):
    try:
        return float(mpmath.hyperu(a, b, x))
    except TypeError as e:
        return numpy.nan
Esempio n. 3
0
 def test_hyperu(self):
     assert_mpmath_equal(sc.hyperu,
                         _exception_to_nan(lambda a, b, x: mpmath.hyperu(a, b, x, **HYPERKW)),
                         [Arg(), Arg(), Arg()])
Esempio n. 4
0
 def test_hyperu(self):
     assert_mpmath_equal(
         sc.hyperu,
         _exception_to_nan(
             lambda a, b, x: mpmath.hyperu(a, b, x, **HYPERKW)),
         [Arg(), Arg(), Arg()])
Esempio n. 5
0
 def psi_(self, a, b, x):
     # This does not return a number but rather an mpmath string
     return mp.hyperu(a, b, x)
Esempio n. 6
0
def float_mp_hyperu(a, b, x):
    try:
        return float(mpmath.hyperu(a, b, x))
    except TypeError as e:
        return numpy.nan