Utils.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:LTTL 作者: axanthos 项目源码 文件源码
def _prob_no_occurrence(
        sample_size,
        subsample_size,
        sample_freq,
        num_subsamples
    ):
    """Compute the probability that an type with a given probability does not
    occur in a subsample of given size drawn from a population of a given size.
    """
    if sample_freq > sample_size - subsample_size:
        return 0
    else:
        return binom(
            sample_size-sample_freq,
            subsample_size,
            exact=True
        ) / num_subsamples
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号