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)
评论列表
文章目录