def _start_params(self, niter=2, return_intermediate=False):
    'find starting values\n\n        Parameters\n        ----------\n        niter : int\n            Number of iterations of WLS approximation\n        return_intermediate : bool\n            If False (default), then only the preliminary parameter estimate\n            will be returned.\n            If True, then also the two results instances of the WLS estimate\n            for mean parameters and for the precision parameters will be\n            returned.\n\n        Returns\n        -------\n        sp : ndarray\n            start parameters for the optimization\n        res_m2 : results instance (optional)\n            Results instance for the WLS regression of the mean function.\n        res_p2 : results instance (optional)\n            Results instance for the WLS regression of the precision function.\n\n        Notes\n        -----\n        This calculates a few iteration of weighted least squares. This is not\n        a full scoring algorithm.\n        '
    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), 0.01) ** 2)) - 1)
    res_p = OLS(self.link_precision(prec_i), self.exog_precision).fit()
    prec_fitted = self.link_precision.inverse(res_p.fittedvalues)
    for _ in range(niter):
        y_var_inv = ((1 + prec_fitted) / (fitted * (1 - 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), 0.01) ** 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
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.
def _start_params(self, niter=2, return_intermediate=False):
    'find starting values\n\n        Parameters\n        ----------\n        niter : int\n            Number of iterations of WLS approximation\n        return_intermediate : bool\n            If False (default), then only the preliminary parameter estimate\n            will be returned.\n            If True, then also the two results instances of the WLS estimate\n            for mean parameters and for the precision parameters will be\n            returned.\n\n        Returns\n        -------\n        sp : ndarray\n            start parameters for the optimization\n        res_m2 : results instance (optional)\n            Results instance for the WLS regression of the mean function.\n        res_p2 : results instance (optional)\n            Results instance for the WLS regression of the precision function.\n\n        Notes\n        -----\n        This calculates a few iteration of weighted least squares. This is not\n        a full scoring algorithm.\n        '
    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), 0.01) ** 2)) - 1)
    res_p = OLS(self.link_precision(prec_i), self.exog_precision).fit()
    prec_fitted = self.link_precision.inverse(res_p.fittedvalues)
    for _ in range(niter):
        y_var_inv = ((1 + prec_fitted) / (fitted * (1 - 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), 0.01) ** 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