【问题标题】:Calculate the cumulative distribution function using a different model使用不同的模型计算累积分布函数
【发布时间】:2020-04-16 17:07:40
【问题描述】:

如何使用不同的模型计算累积分布函数? 我特指这个函数

from scipy.stats import norm
norm.cdf(1639651)

用另一个可以为任何数据集生成 N50、α = 和 β 的函数替换上面的函数。

【问题讨论】:

    标签: python cdf


    【解决方案1】:

    您可以将模型定义为扩展 stats.rv_continuous 的类,如下所示:

    from scipy import stats
    class deterministic_gen(stats.rv_continuous):
        def _cdf(self, x):
            return np.where(x < 0, 0., 1.)
        def _stats(self):
            return 0., 0., 0., 0.
    

    我认为您只能定义 th estats 并且 cdf 将随之而来。这是文档:link

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-09-07
      • 1970-01-01
      • 2020-10-20
      • 2014-08-14
      • 2012-08-15
      • 1970-01-01
      • 2010-10-23
      • 1970-01-01
      相关资源
      最近更新 更多