class_docstr: WLS with heteroscedasticity that depends on explanatory variables
  
  note: mixing GLS sigma and weights for heteroscedasticity might not make
  sense
  
  I think rewriting following the pattern of GLSAR is better
  stopping criteria: improve in GLSAR also, e.g. change in rho
class_docstr_tok: ["WLS","with","heteroscedasticity","that","depends","on","explanatory","variables","note",":","mixing","GLS","sigma","and","weights","for","heteroscedasticity","might","not","make","sense","I","think","rewriting","following","the","pattern","of","GLSAR","is","better","stopping","criteria",":","improve","in","GLSAR","also",",","e.g",".","change","in","rho"]
code: def fit(self, lambd=1.0):
      # maybe iterate
      # preliminary estimate
      res_gls = GLS(self.endog, self.exog, sigma=self.sigma).fit()
      res_resid = OLS(res_gls.resid**2, self.exog_var).fit()
      # or  log-link
      # res_resid = OLS(np.log(res_gls.resid**2), self.exog_var).fit()
      # here I could use whiten and current instance instead of delegating
      # but this is easier
      # see pattern of GLSAR, calls self.initialize and self.fit
      res_wls = WLS(
          self.endog, self.exog, weights=1.0 / res_resid.fittedvalues
      ).fit()
  
      res_wls._results.results_residual_regression = res_resid
      return res_wls
  
file_path: statsmodels/statsmodels/regression/feasible_gls.py
imports: import numpy
  from statsmodels.regression.linear_model import OLS, GLS, WLS
label_desc: Use image node_id 2 for calling the GLSHet2 obj's underlying member method code with example usage: obj.fit(lambd) and returns: res_wls