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: Estimate the dispersion/scale.
  
  The scale parameter for binomial and Poisson families is
  fixed at 1, otherwise it is estimated from the data.
docstr_tok: ["Estimate","the","dispersion\/scale",".","The","scale","parameter","for","binomial","and","Poisson","families","is","fixed","at","1",",","otherwise","it","is","estimated","from","the","data","."]
code: def estimate_scale(self, params):
      """
      Estimate the dispersion/scale.
  
      The scale parameter for binomial and Poisson families is
      fixed at 1, otherwise it is estimated from the data.
      """
  
      if isinstance(self.family, (families.Binomial, families.Poisson)):
          return 1.0
  
      if hasattr(self, "ddof_scale"):
          ddof_scale = self.ddof_scale
      else:
          ddof_scale = self.exog[1]
  
      lpr = np.dot(self.exog, params)
      mean = self.family.link.inverse(lpr)
      resid = self.endog - mean
      scale = np.sum(resid**2) / (self.nobs - ddof_scale)
  
      return scale
  
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 4 for calling the QIF obj's underlying member method code with example usage: obj.estimate_scale(params) and returns: scale, int