Пример #1
0
 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
Пример #2
0
 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)
Пример #3
0
 def test_bigq(self):
     low, high, q = (-20, 4, 3)
     qlu = qloguniform_gen(low, high, q)
     check_d_samples(qlu, n=10000)
Пример #4
0
 def test_smallq(self):
     low, high, q = (0, 1, .1)
     qlu = qloguniform_gen(low, high, q)
     check_d_samples(qlu, n=10000)
Пример #5
0
 def logp(self, x, low, high, q):
     return qloguniform_gen(low, high, q).logpmf(x)
Пример #6
0
 def test_output_type_float(self):
     assert float == type(qloguniform_gen(0, 10, 1.0).rvs())
Пример #7
0
 def test_output_type_int(self):
     result = qloguniform_gen(0, 10, 1).rvs()
     assert int == type(result)