call_windows.py 文件源码

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

项目:gamtools 作者: pombo-lab 项目源码 文件源码
def cumulative_neg_binom(x, n, p):
    """
    Get the cumulative probability distribution for a negative
    binomial, over an array of points x that are log-scaled.

    :param x: Points at which to calculate probability density
    :type x: :class:`~numpy.ndarray`
    :param int n: Number of trials (see :data:`~scipy.stats.nbinom`)
    :param int p: Probability of success (see :data:`~scipy.stats.nbinom`)
    :returns: Cumulative probability distribution over x
    """

    # x is in log, so transform it back
    x = list(10 ** x[1:])

    # Add the point 0.0
    x = [0.0] + x

    return nbinom.cdf(x, n, p)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号