Пример #1
0
 def testSanityPE(self):
     "Test if LognormalRestraint(13) prob is exp(-score)"
     gr = LognormalRestraint(*self.all)
     for i in range(100):
         map(self.change_value, self.all)
         self.assertAlmostEqual(gr.get_probability(),
                                exp(-gr.evaluate(False)), delta=0.001)
Пример #2
0
 def testSanityPE(self):
     "Test if LognormalRestraint(13) prob is exp(-score)"
     gr = LognormalRestraint(*self.all)
     for i in range(100):
         map(self.change_value, self.all)
         self.assertAlmostEqual(gr.get_probability(),
                                exp(-gr.evaluate(False)),
                                delta=0.001)
Пример #3
0
 def testSanityEP(self):
     "Test if LognormalRestraint(13) score is -log(prob)"
     gr = LognormalRestraint(*self.all)
     for i in range(100):
         map(self.change_value, self.all)
         expected = gr.get_probability()
         if expected == 0:
             continue
         self.assertAlmostEqual(-log(expected),
                                gr.evaluate(False), delta=0.001)
Пример #4
0
 def testSanityEP(self):
     "Test if LognormalRestraint(13) score is -log(prob)"
     gr = LognormalRestraint(*self.all)
     for i in range(100):
         map(self.change_value, self.all)
         expected = gr.get_probability()
         if expected == 0:
             continue
         self.assertAlmostEqual(-log(expected),
                                gr.evaluate(False),
                                delta=0.001)