【问题标题】:How do I calculate the Cumulative probability Function without the use of scipy?如何在不使用 scipy 的情况下计算累积概率函数?
【发布时间】:2021-10-22 07:47:01
【问题描述】:

我的意思

x1 = 0
cdf = scipy.stats.norm.cdf(x1)

计算包含均值和方差的 CDF 的原始数学公式是什么? (不使用 numpy、matplotlib 等)

【问题讨论】:

    标签: python scipy formula


    【解决方案1】:

    我不知道这是不是你想要的:

    from math import erf, sqrt
    
    def cdf(x):
        return (1 + erf(x/sqrt(2))) / 2
    
    x1 = 0
    
    >>> cdf(x1)
    0.5
    

    在 MathExchange 上阅读 this post

    【讨论】:

    • 我不明白为什么 (1 + erf(x/sqrt(2))) / 2 是 CDF 的公式。 CDF 不只是将 PDF 的每个迭代加在一起吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-11-12
    • 1970-01-01
    • 1970-01-01
    • 2014-08-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多