neuroprob/utils/stats.py
def nb_count_prob(n, rate, r_inv, sim_time):
    """
    Negative binomial count probability. The mean is given by :math:`r \cdot \Delta t` like in 
    the Poisson case.
    """
    g = rate*sim_time
    if g == 0:
        return (n == 0).astype(float)
    
    r = 1./r_inv
    log_terms = sps.loggamma(r+n) - sps.loggamma(r) - (n+r)*np.log(g+r) + r*np.log(r)
    return np.exp(np.log(g)*n - sps.gammaln(n+1) + log_terms)

    Negative binomial count probability. The mean is given by :math:`r \cdot \Delta t` like in 
    the Poisson case.
    
Negative binomial count probability. The mean is given by :math:`r \cdot \Delta t` like in
the Poisson case.
Negative binomial count probability . The mean is given by : math : ` r \ cdot \ Delta t ` like in the Poisson case .
def nb_count_prob(n, rate, r_inv, sim_time):
    g = rate*sim_time
    if g == 0:
        return (n == 0).astype(float)
    r = 1./r_inv
    log_terms = sps.loggamma(r+n) - sps.loggamma(r) - (n+r)*np.log(g+r) + r*np.log(r)
    return np.exp(np.log(g)*n - sps.gammaln(n+1) + log_terms)
def nb_count_prob ( n , rate , r_inv , sim_time ) : g = rate * sim_time if g == 0 : return ( n == 0 ) . astype ( float ) r = 1. / r_inv log_terms = sps . loggamma ( r + n ) - sps . loggamma ( r ) - ( n + r ) * np . log ( g + r ) + r * np . log ( r ) return np . exp ( np . log ( g ) * n - sps . gammaln ( n + 1 ) + log_terms )
Negative binomial count probability.
Negative binomial count probability .
"""
    Negative binomial count probability. The mean is given by :math:`r \cdot \Delta t` like in 
    the Poisson case.
    """
n
rate
r_inv
sim_time