code: def locscale_grad(y, loc, scale, dlldy, *args):
      """derivative of log-likelihood with respect to location and scale
  
      Parameters
      ----------
      y : array_like
          data points of random variable at which loglike is evaluated
      loc : float
          location parameter of distribution
      scale : float
          scale parameter of distribution
      dlldy : function
          derivative of loglikelihood fuction wrt. random variable x
      args : array_like
          shape parameters of log-likelihood function
  
      Returns
      -------
      dlldloc : ndarray
          derivative of loglikelihood wrt location evaluated at the
          points given in y
      dlldscale : ndarray
          derivative of loglikelihood wrt scale evaluated at the
          points given in y
  
      """
      yst = (y - loc) / scale  # ystandardized
      dlldloc = -dlldy(yst, *args) / scale
      dlldscale = (
          -1.0 / scale - dlldy(yst, *args) * (y - loc) / scale**2
      )
      return dlldloc, dlldscale
  
file_path: statsmodels/statsmodels/sandbox/regression/tools.py
imports: import numpy
  from scipy import special
  from scipy.special import gammaln
label_desc: Use image node_id 11 for calling a global function with example usage: locscale_grad(y, loc, scale, dlldy) and returns: dlldloc,  dlldscale