def _ll_nbt(y, X, beta, alph, C=0):
 Q = 0
 mu = np.exp(np.dot(X, beta))
 size = ((1 / alph) * (mu ** Q))
 prob = (size / (size + mu))
 ll = (nbinom.logpmf(y, size, prob) - np.log((1 - nbinom.cdf(C, size, prob))))
 return ll

def _ll_nbt ( y , X , beta , alph , C = 0 ) : Q = 0 mu = np . exp ( np . dot ( X , beta ) ) size = ( ( 1 / alph ) * ( mu ** Q ) ) prob = ( size / ( size + mu ) ) ll = ( nbinom . logpmf ( y , size , prob ) - np . log ( ( 1 - nbinom . cdf ( C , size , prob ) ) ) ) return ll
negative binomial truncated densities for count models : .