本文整理汇总了Python中skills.numerics.Gaussian.cumulative_to方法的典型用法代码示例。如果您正苦于以下问题:Python Gaussian.cumulative_to方法的具体用法?Python Gaussian.cumulative_to怎么用?Python Gaussian.cumulative_to使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类skills.numerics.Gaussian
的用法示例。
在下文中一共展示了Gaussian.cumulative_to方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: log_normalization
# 需要导入模块: from skills.numerics import Gaussian [as 别名]
# 或者: from skills.numerics.Gaussian import cumulative_to [as 别名]
def log_normalization(self):
marginal = self.variables[0].value
message = self.messages[0].value
message_from_variable = marginal / message
mean = message_from_variable.mean
std = message_from_variable.stdev
z = (Gaussian.cumulative_to((self.epsilon - mean) / std) -
Gaussian.cumulative_to((-self.epsilon - mean) / std))
return -Gaussian.log_product_normalization(message_from_variable, message) + log(z)
示例2: w_within_margin
# 需要导入模块: from skills.numerics import Gaussian [as 别名]
# 或者: from skills.numerics.Gaussian import cumulative_to [as 别名]
def w_within_margin(team_performance_difference, draw_margin):
team_performance_difference_abs = abs(team_performance_difference)
denominator = (Gaussian.cumulative_to(draw_margin - team_performance_difference_abs) -
Gaussian.cumulative_to(-draw_margin - team_performance_difference_abs))
if denominator < 2.222758749e-162:
return 1.0
vt = v_within_margin(team_performance_difference_abs, draw_margin)
return (vt ** 2 +
(
(draw_margin - team_performance_difference_abs) *
Gaussian.at(draw_margin - team_performance_difference_abs) -
(-draw_margin - team_performance_difference_abs) *
Gaussian.at(-draw_margin - team_performance_difference_abs)) / denominator)
示例3: v_within_margin
# 需要导入模块: from skills.numerics import Gaussian [as 别名]
# 或者: from skills.numerics.Gaussian import cumulative_to [as 别名]
def v_within_margin(team_performance_difference, draw_margin):
team_performance_difference_abs = abs(team_performance_difference)
denominator = (
Gaussian.cumulative_to(draw_margin - team_performance_difference_abs) -
Gaussian.cumulative_to(-draw_margin - team_performance_difference_abs))
if denominator < 2.222758749e-162:
if team_performance_difference < 0.0:
return -team_performance_difference - draw_margin
return -team_performance_difference + draw_margin
numerator = (Gaussian.at(-draw_margin - team_performance_difference_abs) -
Gaussian.at(draw_margin - team_performance_difference_abs))
if team_performance_difference < 0.0:
return -numerator / denominator
return numerator / denominator
示例4: w_exceeds_margin
# 需要导入模块: from skills.numerics import Gaussian [as 别名]
# 或者: from skills.numerics.Gaussian import cumulative_to [as 别名]
def w_exceeds_margin(team_performance_difference, draw_margin):
denominator = Gaussian.cumulative_to(team_performance_difference - draw_margin)
if denominator < 2.222758749e-162:
if team_performance_difference < 0.0:
return 1.0
return 0.0
v_win = v_exceeds_margin(team_performance_difference, draw_margin)
return v_win * (v_win + team_performance_difference - draw_margin)
示例5: v_exceeds_margin
# 需要导入模块: from skills.numerics import Gaussian [as 别名]
# 或者: from skills.numerics.Gaussian import cumulative_to [as 别名]
def v_exceeds_margin(team_performance_difference, draw_margin):
denominator = Gaussian.cumulative_to(team_performance_difference - draw_margin)
if (denominator < 2.22275874e-162):
return -team_performance_difference + draw_margin
return Gaussian.at(team_performance_difference - draw_margin) / denominator
示例6: testCumulativeTo
# 需要导入模块: from skills.numerics import Gaussian [as 别名]
# 或者: from skills.numerics.Gaussian import cumulative_to [as 别名]
def testCumulativeTo(self):
expected = 0.691462461274013
answer = Gaussian.cumulative_to(0.5)
self.assertAlmostEqual(expected, answer, None,
"testCumulativeTo expected %.15f, got %.15f" % (expected, answer),
GaussianDistributionTest.ERROR_TOLERANCE)