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: Confidence interval for predicted based on delta method.
  
  Parameters
  ----------
  alpha : float, optional
      The significance level for the confidence interval.
      ie., The default `alpha` = .05 returns a 95% confidence interval.
  use_t : boolean
      If use_t is False (default), then the normal distribution is used
      for the confidence interval, otherwise the t distribution with
      `df` degrees of freedom is used.
  df : int or float
      degrees of freedom for t distribution. Only used and required if
      use_t is True.
  var_extra : None or array_like float
      Additional variance that is added to the variance based on the
      delta method. This can be used to obtain confidence intervalls for
      new observations (prediction interval).
  predicted : ndarray (float)
      Predicted value, can be used to avoid repeated calculations if it
      is already available.
  se : ndarray (float)
      Standard error, can be used to avoid repeated calculations if it
      is already available.
  
  Returns
  -------
  conf_int : array
      Each row contains [lower, upper] limits of the confidence interval
      for the corresponding parameter. The first column contains all
      lower, the second column contains all upper limits.
docstr_tok: ["Confidence","interval","for","predicted","based","on","delta","method",".","Parameters","--","--","--","--","--","alpha",":","float",",","optional","The","significance","level","for","the","confidence","interval",".","ie.",",","The","default","`","alpha","`","=",".05","returns","a","95","%","confidence","interval",".","use_t",":","boolean","If","use_t","is","False","(","default",")",",","then","the","normal","distribution","is","used","for","the","confidence","interval",",","otherwise","the","t","distribution","with","`","df","`","degrees","of","freedom","is","used",".","df",":","int","or","float","degrees","of","freedom","for","t","distribution",".","Only","used","and","required","if","use_t","is","True",".","var_extra",":","None","or","array_like","float","Additional","variance","that","is","added","to","the","variance","based","on","the","delta","method",".","This","can","be","used","to","obtain","confidence","intervalls","for","new","observations","(","prediction","interval",")",".","predicted",":","ndarray","(","float",")","Predicted","value",",","can","be","used","to","avoid","repeated","calculations","if","it","is","already","available",".","se",":","ndarray","(","float",")","Standard","error",",","can","be","used","to","avoid","repeated","calculations","if","it","is","already","available",".","Returns","--","--","--","-","conf_int",":","array","Each","row","contains","[","lower",",","upper","]","limits","of","the","confidence","interval","for","the","corresponding","parameter",".","The","first","column","contains","all","lower",",","the","second","column","contains","all","upper","limits","."]
code: def conf_int(
      self,
      alpha=0.05,
      use_t=False,
      df=None,
      var_extra=None,
      predicted=None,
      se=None,
  ):
      """
      Confidence interval for predicted based on delta method.
  
      Parameters
      ----------
      alpha : float, optional
          The significance level for the confidence interval.
          ie., The default `alpha` = .05 returns a 95% confidence interval.
      use_t : boolean
          If use_t is False (default), then the normal distribution is used
          for the confidence interval, otherwise the t distribution with
          `df` degrees of freedom is used.
      df : int or float
          degrees of freedom for t distribution. Only used and required if
          use_t is True.
      var_extra : None or array_like float
          Additional variance that is added to the variance based on the
          delta method. This can be used to obtain confidence intervalls for
          new observations (prediction interval).
      predicted : ndarray (float)
          Predicted value, can be used to avoid repeated calculations if it
          is already available.
      se : ndarray (float)
          Standard error, can be used to avoid repeated calculations if it
          is already available.
  
      Returns
      -------
      conf_int : array
          Each row contains [lower, upper] limits of the confidence interval
          for the corresponding parameter. The first column contains all
          lower, the second column contains all upper limits.
      """
  
      # TODO: predicted and se as arguments to avoid duplicate calculations
      # or leave unchanged?
      if not use_t:
          dist = stats.norm
          dist_args = ()
      else:
          if df is None:
              raise ValueError("t distribution requires df")
          dist = stats.t
          dist_args = (df,)
  
      if predicted is None:
          predicted = self.predicted()
      if se is None:
          se = self.se_vectorized()
      if var_extra is not None:
          se = np.sqrt(se**2 + var_extra)
  
      q = dist.ppf(1 - alpha / 2.0, *dist_args)
      lower = predicted - q * se
      upper = predicted + q * se
      ci = np.column_stack((lower, upper))
      if ci.shape[1] != 2:
          raise RuntimeError("something wrong: ci not 2 columns")
      return ci
  
file_path: statsmodels/statsmodels/stats/_delta_method.py
imports: import numpy
  from scipy import stats
label_desc: Use image node_id 8 for calling the NonlinearDeltaCov obj's underlying member method code with example usage: obj.conf_int(alpha, use_t, df, var_extra, predicted, se) and returns: ci