def multinomial_logpmf(x, n, p):
 return ((gammaln((n + 1.0)) - np.sum(gammaln((x + 1.0)))) + np.sum((x * np.log(p))))

def multinomial_logpmf ( x , n , p ) : return ( ( gammaln ( ( n + 1.0 ) ) - np . sum ( gammaln ( ( x + 1.0 ) ) ) ) + np . sum ( ( x * np . log ( p ) ) ) )
log pmf of multinomial .