示例#1
0
 def test_offgrid_float(self):
     qn = qnormal_gen(0, 1, .2)
     assert qn.pmf(0) > 0.0
     assert qn.pmf(.1) == 0.0
     assert qn.pmf(.2) > 0.0
     assert qn.pmf(.4) > 0.0
     assert qn.pmf(-.2) > 0.0
     assert qn.pmf(-.4) > 0.0
     assert qn.pmf(.99) == 0.0
     assert qn.pmf(-.99) == 0.0
示例#2
0
 def test_offgrid_float(self):
     qn = qnormal_gen(0, 1, 0.2)
     assert qn.pmf(0) > 0.0
     assert qn.pmf(0.1) == 0.0
     assert qn.pmf(0.2) > 0.0
     assert qn.pmf(0.4) > 0.0
     assert qn.pmf(-0.2) > 0.0
     assert qn.pmf(-0.4) > 0.0
     assert qn.pmf(0.99) == 0.0
     assert qn.pmf(-0.99) == 0.0
示例#3
0
 def test_rvs(self):
     for mu, sigma, q in [(0, 1, .1),
                          (-20, 3, 3),]:
         qn = qnormal_gen(mu, sigma, q)
         #tdb.check_ppf_ppf(qn, ())
         #tdb.check_cdf_ppf(qn, (), '')
         try:
             check_d_samples(qn, n=10000)
         except:
             print mu, sigma, q
             raise
示例#4
0
 def test_numeric(self):
     qn = qnormal_gen(0, 1, 1)
     assert qn.pmf(500) > -np.inf
示例#5
0
 def test_offgrid_int(self):
     qn = qnormal_gen(0, 1, 2)
     assert qn.pmf(0) > 0.0
     assert qn.pmf(1) == 0.0
     assert qn.pmf(2) > 0.0
示例#6
0
 def test_bigq(self):
     mu, sigma, q = (-20, 4, 3)
     qn = qnormal_gen(mu, sigma, q)
     check_d_samples(qn, n=10000)
示例#7
0
 def test_smallq(self):
     mu, sigma, q = (0, 1, .1)
     qn = qnormal_gen(mu, sigma, q)
     check_d_samples(qn, n=10000)
示例#8
0
 def test_output_type_float(self):
     assert float == type(qnormal_gen(0, 10, 1.0).rvs())
示例#9
0
 def test_output_type_int(self):
     result = qnormal_gen(0, 10, 1).rvs()
     assert int == type(result)