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)
Beispiel #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)
 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)
Beispiel #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)