docstr: find starting values
  
  Parameters
  ----------
  niter : int
      Number of iterations of WLS approximation
  return_intermediate : bool
      If False (default), then only the preliminary parameter estimate
      will be returned.
      If True, then also the two results instances of the WLS estimate
      for mean parameters and for the precision parameters will be
      returned.
  
  Returns
  -------
  sp : ndarray
      start parameters for the optimization
  res_m2 : results instance (optional)
      Results instance for the WLS regression of the mean function.
  res_p2 : results instance (optional)
      Results instance for the WLS regression of the precision function.
  
  Notes
  -----
  This calculates a few iteration of weighted least squares. This is not
  a full scoring algorithm.
docstr_tok: ["find","starting","values","Parameters","--","--","--","--","--","niter",":","int","Number","of","iterations","of","WLS","approximation","return_intermediate",":","bool","If","False","(","default",")",",","then","only","the","preliminary","parameter","estimate","will","be","returned",".","If","True",",","then","also","the","two","results","instances","of","the","WLS","estimate","for","mean","parameters","and","for","the","precision","parameters","will","be","returned",".","Returns","--","--","--","-","sp",":","ndarray","start","parameters","for","the","optimization","res_m2",":","results","instance","(","optional",")","Results","instance","for","the","WLS","regression","of","the","mean","function",".","res_p2",":","results","instance","(","optional",")","Results","instance","for","the","WLS","regression","of","the","precision","function",".","Notes","--","--","-","This","calculates","a","few","iteration","of","weighted","least","squares",".","This","is","not","a","full","scoring","algorithm","."]
code: def _start_params(self, niter=2, return_intermediate=False):
      """find starting values
  
      Parameters
      ----------
      niter : int
          Number of iterations of WLS approximation
      return_intermediate : bool
          If False (default), then only the preliminary parameter estimate
          will be returned.
          If True, then also the two results instances of the WLS estimate
          for mean parameters and for the precision parameters will be
          returned.
  
      Returns
      -------
      sp : ndarray
          start parameters for the optimization
      res_m2 : results instance (optional)
          Results instance for the WLS regression of the mean function.
      res_p2 : results instance (optional)
          Results instance for the WLS regression of the precision function.
  
      Notes
      -----
      This calculates a few iteration of weighted least squares. This is not
      a full scoring algorithm.
      """
      # WLS of the mean equation uses the implied weights (inverse variance),
      # WLS for the precision equations uses weights that only take
      # account of the link transformation of the precision endog.
      from statsmodels.regression.linear_model import OLS, WLS
  
      res_m = OLS(self.link(self.endog), self.exog).fit()
      fitted = self.link.inverse(res_m.fittedvalues)
      resid = self.endog - fitted
  
      prec_i = (
          fitted * (1 - fitted) / np.maximum(np.abs(resid), 1e-2) ** 2
          - 1
      )
      res_p = OLS(
          self.link_precision(prec_i), self.exog_precision
      ).fit()
      prec_fitted = self.link_precision.inverse(res_p.fittedvalues)
      # sp = np.concatenate((res_m.params, res_p.params))
  
      for _ in range(niter):
          y_var_inv = (1 + prec_fitted) / (fitted * (1 - fitted))
          # y_var = fitted * (1 - fitted) / (1 + prec_fitted)
  
          ylink_var_inv = y_var_inv / self.link.deriv(fitted) ** 2
          res_m2 = WLS(
              self.link(self.endog), self.exog, weights=ylink_var_inv
          ).fit()
          fitted = self.link.inverse(res_m2.fittedvalues)
          resid2 = self.endog - fitted
  
          prec_i2 = (
              fitted
              * (1 - fitted)
              / np.maximum(np.abs(resid2), 1e-2) ** 2
              - 1
          )
          w_p = 1.0 / self.link_precision.deriv(prec_fitted) ** 2
          res_p2 = WLS(
              self.link_precision(prec_i2),
              self.exog_precision,
              weights=w_p,
          ).fit()
          prec_fitted = self.link_precision.inverse(res_p2.fittedvalues)
          sp2 = np.concatenate((res_m2.params, res_p2.params))
  
      if return_intermediate:
          return sp2, res_m2, res_p2
  
      return sp2
  
imports: import numpy
  from scipy.special import gammaln
  import patsy
  import statsmodels.base.wrapper
  import statsmodels.regression.linear_model
  from statsmodels.tools.decorators import cache_readonly
  from statsmodels.base.model import GenericLikelihoodModel, GenericLikelihoodModelResults, _LLRMixin
  from statsmodels.genmod import families
label_desc: Use image node_id 16 for calling the BetaModel obj's underlying member method code with example usage: obj._start_params(niter, return_intermediate) and returns: sp2, sp2,  res_m2,  res_p2