class_docstr: Asymptotic covariance by Deltamethod
  
  The function is designed for 2d array, with rows equal to
  the number of equations or constraints and columns equal to the number
  of parameters. 1d params work by chance ?
  
  fun: R^{m*k) -> R^{m}  where m is number of equations and k is
  the number of parameters.
  
  equations follow Greene
  
  This class does not use any caching. The intended usage is as a helper
  function. Extra methods have been added for convenience but might move
  to calling functions.
  
  The naming in this class uses params for the original random variable, and
  cov_params for it's covariance matrix. However, this class is independent
  of the use cases in support of the models.
  
  Parameters
  ----------
  func : callable, f(params)
      Nonlinear function of the estimation parameters. The return of
      the function can be vector valued, i.e. a 1-D array.
  params : ndarray
      Parameters at which function `func` is evaluated.
  cov_params : ndarray
      Covariance matrix of the parameters `params`.
  deriv : function or None
      First derivative or Jacobian of func. If deriv is None, then a
      numerical derivative will be used. If func returns a 1-D array,
      then the `deriv` should have rows corresponding to the elements
      of the return of func.
  func_args : None
      Not yet implemented.
class_docstr_tok: ["Asymptotic","covariance","by","Deltamethod","The","function","is","designed","for","2d","array",",","with","rows","equal","to","the","number","of","equations","or","constraints","and","columns","equal","to","the","number","of","parameters",".","1d","params","work","by","chance","?","fun",":","R^","{","m","*","k",")","-",">","R^","{","m","}","where","m","is","number","of","equations","and","k","is","the","number","of","parameters",".","equations","follow","Greene","This","class","does","not","use","any","caching",".","The","intended","usage","is","as","a","helper","function",".","Extra","methods","have","been","added","for","convenience","but","might","move","to","calling","functions",".","The","naming","in","this","class","uses","params","for","the","original","random","variable",",","and","cov_params","for","it","'s","covariance","matrix",".","However",",","this","class","is","independent","of","the","use","cases","in","support","of","the","models",".","Parameters","--","--","--","--","--","func",":","callable",",","f","(","params",")","Nonlinear","function","of","the","estimation","parameters",".","The","return","of","the","function","can","be","vector","valued",",","i.e",".","a","1-D","array",".","params",":","ndarray","Parameters","at","which","function","`","func","`","is","evaluated",".","cov_params",":","ndarray","Covariance","matrix","of","the","parameters","`","params","`",".","deriv",":","function","or","None","First","derivative","or","Jacobian","of","func",".","If","deriv","is","None",",","then","a","numerical","derivative","will","be","used",".","If","func","returns","a","1-D","array",",","then","the","`","deriv","`","should","have","rows","corresponding","to","the","elements","of","the","return","of","func",".","func_args",":","None","Not","yet","implemented","."]
docstr: First derivative, jacobian of func evaluated at params.
  
  Parameters
  ----------
  params : None or ndarray
      Values at which gradient is evaluated. If params is None, then
      the attached params are used.
      TODO: should we drop this
  kwds : keyword arguments
      This keyword arguments are used without changes in the calulation
      of numerical derivatives. These are only used if a `deriv` function
      was not provided.
  
  Returns
  -------
  grad : ndarray
      gradient or jacobian of the function
docstr_tok: ["First","derivative",",","jacobian","of","func","evaluated","at","params",".","Parameters","--","--","--","--","--","params",":","None","or","ndarray","Values","at","which","gradient","is","evaluated",".","If","params","is","None",",","then","the","attached","params","are","used",".","TODO",":","should","we","drop","this","kwds",":","keyword","arguments","This","keyword","arguments","are","used","without","changes","in","the","calulation","of","numerical","derivatives",".","These","are","only","used","if","a","`","deriv","`","function","was","not","provided",".","Returns","--","--","--","-","grad",":","ndarray","gradient","or","jacobian","of","the","function"]
code: def grad(self, params=None, **kwds):
      """First derivative, jacobian of func evaluated at params.
  
      Parameters
      ----------
      params : None or ndarray
          Values at which gradient is evaluated. If params is None, then
          the attached params are used.
          TODO: should we drop this
      kwds : keyword arguments
          This keyword arguments are used without changes in the calulation
          of numerical derivatives. These are only used if a `deriv` function
          was not provided.
  
      Returns
      -------
      grad : ndarray
          gradient or jacobian of the function
      """
      if params is None:
          params = self.params
      if self._grad is not None:
          return self._grad(params)
      else:
          # copied from discrete_margins
          try:
              from statsmodels.tools.numdiff import approx_fprime_cs
  
              jac = approx_fprime_cs(params, self.fun, **kwds)
          except TypeError:  # norm.cdf doesn't take complex values
              from statsmodels.tools.numdiff import approx_fprime
  
              jac = approx_fprime(params, self.fun, **kwds)
  
          return jac
  
file_path: statsmodels/statsmodels/stats/_delta_method.py
imports: import numpy
  from scipy import stats
label_desc: Use image node_id 2 for calling the NonlinearDeltaCov obj's underlying member method code with example usage: obj.grad(params) and returns: self, jac