当前位置: 首页>>代码示例>>Python>>正文


Python Gaussian.cumulative_to方法代码示例

本文整理汇总了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)
开发者ID:agoragames,项目名称:PythonSkills,代码行数:12,代码来源:factors.py

示例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)
开发者ID:Geoff1938,项目名称:PythonSkills,代码行数:18,代码来源:truncated.py

示例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
开发者ID:Geoff1938,项目名称:PythonSkills,代码行数:19,代码来源:truncated.py

示例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)
开发者ID:Geoff1938,项目名称:PythonSkills,代码行数:10,代码来源:truncated.py

示例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
开发者ID:Geoff1938,项目名称:PythonSkills,代码行数:7,代码来源:truncated.py

示例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)
开发者ID:agoragames,项目名称:PythonSkills,代码行数:8,代码来源:test_numerics.py


注:本文中的skills.numerics.Gaussian.cumulative_to方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。