class_docstr: Fit a regression model using quadratic inference functions (QIF).
  
  QIF is an alternative to GEE that can be more efficient, and that
  offers different approaches for model selection and inference.
  
  Parameters
  ----------
  endog : array_like
      The dependent variables of the regression.
  exog : array_like
      The independent variables of the regression.
  groups : array_like
      Labels indicating which group each observation belongs to.
      Observations in different groups should be independent.
  family : genmod family
      An instance of a GLM family.
  cov_struct : QIFCovariance instance
      An instance of a QIFCovariance.
  
  References
  ----------
  A. Qu, B. Lindsay, B. Li (2000).  Improving Generalized Estimating
  Equations using Quadratic Inference Functions, Biometrika 87:4.
  www.jstor.org/stable/2673612
docstr: Fit a GLM to correlated data using QIF.
  
  Parameters
  ----------
  maxiter : int
      Maximum number of iterations.
  start_params : array_like, optional
      Starting values
  tol : float
      Convergence threshold for difference of successive
      estimates.
  gtol : float
      Convergence threshold for gradient.
  ddof_scale : int, optional
      Degrees of freedom for the scale parameter
  
  Returns
  -------
  QIFResults object
docstr_tok: ["Fit","a","GLM","to","correlated","data","using","QIF",".","Parameters","--","--","--","--","--","maxiter",":","int","Maximum","number","of","iterations",".","start_params",":","array_like",",","optional","Starting","values","tol",":","float","Convergence","threshold","for","difference","of","successive","estimates",".","gtol",":","float","Convergence","threshold","for","gradient",".","ddof_scale",":","int",",","optional","Degrees","of","freedom","for","the","scale","parameter","Returns","--","--","--","-","QIFResults","object"]
code: def fit(
      self,
      maxiter=100,
      start_params=None,
      tol=1e-6,
      gtol=1e-4,
      ddof_scale=None,
  ):
      """
      Fit a GLM to correlated data using QIF.
  
      Parameters
      ----------
      maxiter : int
          Maximum number of iterations.
      start_params : array_like, optional
          Starting values
      tol : float
          Convergence threshold for difference of successive
          estimates.
      gtol : float
          Convergence threshold for gradient.
      ddof_scale : int, optional
          Degrees of freedom for the scale parameter
  
      Returns
      -------
      QIFResults object
      """
  
      if ddof_scale is None:
          self.ddof_scale = self.exog.shape[1]
      else:
          self.ddof_scale = ddof_scale
  
      if start_params is None:
          model = GLM(self.endog, self.exog, family=self.family)
          result = model.fit()
          params = result.params
      else:
          params = start_params
  
      for _ in range(maxiter):
          qif, grad, cmat, _, gn_deriv = self.objective(params)
  
          gnorm = np.sqrt(np.sum(grad * grad))
          self._fit_history["qif"].append(qif)
          self._fit_history["gradnorm"].append(gnorm)
  
          if gnorm < gtol:
              break
  
          cjac = 2 * np.dot(gn_deriv.T, np.linalg.solve(cmat, gn_deriv))
          step = np.linalg.solve(cjac, grad)
  
          snorm = np.sqrt(np.sum(step * step))
          self._fit_history["stepnorm"].append(snorm)
          if snorm < tol:
              break
          params -= step
  
      vcov = np.dot(gn_deriv.T, np.linalg.solve(cmat, gn_deriv))
      vcov = np.linalg.inv(vcov)
      scale = self.estimate_scale(params)
  
      rslt = QIFResults(self, params, vcov / scale, scale)
      rslt.fit_history = self._fit_history
      self._fit_history = defaultdict(list)
  
      return QIFResultsWrapper(rslt)
  
imports: import numpy
  from collections import defaultdict
  import statsmodels.base.model
  from statsmodels.genmod import families
  from statsmodels.genmod.generalized_linear_model import GLM
  from statsmodels.genmod.families import links
  from statsmodels.genmod.families import varfuncs
  import statsmodels.regression.linear_model
  import statsmodels.base.wrapper
  from statsmodels.tools.decorators import cache_readonly
label_desc: Use image node_id 6 for calling the QIF obj's underlying member method code with example usage: obj.fit(maxiter, start_params, tol, gtol, ddof_scale) and returns: QIFResultsWrapper