本文整理匯總了Python中IMP.isd.LognormalRestraint類的典型用法代碼示例。如果您正苦於以下問題:Python LognormalRestraint類的具體用法?Python LognormalRestraint怎麽用?Python LognormalRestraint使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了LognormalRestraint類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: testE
def testE(self):
"Test LognormalRestraint(3) score"
gr = LognormalRestraint(*self.all)
for i in range(100):
map(self.change_value, self.all)
e = gr.evaluate(False)
self.assertAlmostEqual(e, self.normal_e(*self.all))
示例2: testSanityPE
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: testdmu
def testdmu(self):
"Test LognormalRestraint(3) mu derivative"
gr = LognormalRestraint(*self.all)
for i in range(100):
map(self.change_value, self.all)
gr.evaluate(True)
self.assertAlmostEqual(Nuisance(self.mu).get_nuisance_derivative(),
self.deriv_mu(*self.all))
示例4: testSanityEP
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)