def test_rvs(self): for low, high, q in [(0, 1, .1), (-20, 4, 3),]: qlu = qloguniform_gen(low, high, q) tdb.check_ppf_ppf(qlu, ()) tdb.check_cdf_ppf(qlu, (), '') try: check_d_samples(qlu, n=10000) except: print low, high, q raise
def test_2points(self): low, high, q = (np.log(.05), np.log(.75), 0.5) qlu = qloguniform_gen(low, high, q) check_d_samples(qlu, n=10000)
def test_bigq(self): low, high, q = (-20, 4, 3) qlu = qloguniform_gen(low, high, q) check_d_samples(qlu, n=10000)
def test_smallq(self): low, high, q = (0, 1, .1) qlu = qloguniform_gen(low, high, q) check_d_samples(qlu, n=10000)
def logp(self, x, low, high, q): return qloguniform_gen(low, high, q).logpmf(x)
def test_output_type_float(self): assert float == type(qloguniform_gen(0, 10, 1.0).rvs())
def test_output_type_int(self): result = qloguniform_gen(0, 10, 1).rvs() assert int == type(result)