code: def negbin_loglike(r, p, x):
      # the negative binomial log likelihood we want to maximize
      return (
          gammaln(r + x)
          - gammaln(r)
          - gammaln(x + 1)
          + x * np.log(p)
          + r * np.log(1 - p)
      )
  
file_path: autograd/examples/negative_binomial_maxlike.py
imports: from __future__ import division, print_function
  import autograd.numpy
  import autograd.numpy.random
  from autograd.scipy.special import gammaln
  from autograd import grad
  import scipy.optimize
label_desc: Use image node_id 2 for calling a global function with example usage: negbin_loglike(r, p, x) and returns: unknown