class_docstr: Class used to calculate the confidence interval.
class_docstr_tok: ["Class","used","to","calculate","the","confidence","interval","."]
code: def __init__(
      self,
      minimizer,
      result,
      p_names=None,
      prob_func=None,
      sigmas=None,
      trace=False,
      verbose=False,
      maxiter=50,
  ):
      self.verbose = verbose
      self.minimizer = minimizer
      self.result = result
      self.params = result.params.copy()
      self.org = copy_vals(self.params)
      self.best_chi = result.chisqr
  
      if p_names is None:
          p_names = [i for i in self.params if self.params[i].vary]
  
      self.p_names = p_names
      self.fit_params = [self.params[p] for p in self.p_names]
  
      # check that there are at least 2 true variables!
      # check that all stderrs are sensible (including not None or NaN)
  
      for par in self.fit_params:
          if par.vary and (par.stderr is None or par.stderr is np.nan):
              raise MinimizerException(CONF_ERR_STDERR)
      nvars = len([p for p in self.params.values() if p.vary])
      if nvars < 2:
          raise MinimizerException(CONF_ERR_NVARS)
  
      if prob_func is None:
          self.prob_func = f_compare
      else:
          self.prob_func = prob_func
      if trace:
          self.trace_dict = {i: [] for i in self.p_names}
  
      self.trace = trace
      self.maxiter = maxiter
      self.min_rel_change = 1e-5
  
      if sigmas is None:
          sigmas = [1, 2, 3]
      self.sigmas = list(sigmas)
      self.sigmas.sort()
      self.probs = []
      for sigma in self.sigmas:
          if sigma < 1:
              prob = sigma
          else:
              prob = erf(sigma / np.sqrt(2))
          self.probs.append(prob)
  
file_path: lmfit-py/lmfit/confidence.py
imports: from warnings import warn
  import numpy
  from scipy.optimize import root_scalar
  from scipy.special import erf
  from scipy.stats import f
  from .minimizer import MinimizerException
label_desc: Use image node_id 1 to create a new ConfidenceInterval object  with example: obj = ConfidenceInterval(minimizer, result, p_names, prob_func, sigmas, trace, verbose, maxiter)