Example #1
0
 def test_rvs(self):
     for mu, sigma, q in [(0, 1, .1),
                          (-1, 3, 3),]:
         qn = qlognormal_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
Example #2
0
 def test_offgrid_float(self):
     mu, sigma, q = (-.5, 2, .2)
     qn = qlognormal_gen(mu, sigma, q)
     assert qn.pmf(0) > qn.pmf(.2) > qn.pmf(2) > 0
     assert qn.pmf(.1) == qn.pmf(.2 - .001) == qn.pmf(-.2) == 0
Example #3
0
 def test_offgrid_int(self):
     mu, sigma, q = (1, 2, 2)
     qn = qlognormal_gen(mu, sigma, q)
     assert qn.pmf(0) > qn.pmf(2) > qn.pmf(20) > 0
     assert qn.pmf(1) == qn.pmf(2 - .001) == qn.pmf(-1) == 0
Example #4
0
 def test_bigq(self):
     mu, sigma, q = (-20, 4, 3)
     qn = qlognormal_gen(mu, sigma, q)
     check_d_samples(qn, n=10000)
Example #5
0
 def test_smallq(self):
     mu, sigma, q = (0, 1, .1)
     qn = qlognormal_gen(mu, sigma, q)
     check_d_samples(qn, n=10000)
Example #6
0
 def test_output_type_float(self):
     assert float == type(qlognormal_gen(0, 10, 1.0).rvs())
Example #7
0
 def test_output_type_int(self):
     result = qlognormal_gen(0, 10, 1).rvs()
     assert int == type(result)