'Return predicted values for a marginal regression model fit
using GEE.
Parameters
params : array-like
Parameters / coefficients of a marginal regression model.
exog : array-like, optional
Design / exogenous data. If exog is None, model exog is
used.
offset : array-like, optional
Offset for exog if provided.  If offset is None, model
offset is used.
exposure : array-like, optional
Exposure for exog, if exposure is None, model exposure is
used.  Only allowed if link function is the logarithm.
linear : bool
If True, returns the linear predicted values.  If False,
returns the value of the inverse of the model\'s link
function at the linear predicted values.
Returns
An array of fitted values
Notes
Using log(V) as the offset is equivalent to using V as the
exposure.  If exposure U and offset V are both provided, then
log(U) + V is added to the linear predictor.'

def predict(self, params, exog=None, offset=None, exposure=None, linear=False):

    if (exposure is not None):
        if (not isinstance(self.family.link, families.links.Log)):
            raise ValueError('exposure    can    only    be    used    with    the    log    link    function')
    _offset = 0.0
    if (exog is None):
        exog = self.exog
        if (not isinstance(self.family.link, families.links.Log)):
            if (offset is None):
                if (self._offset_exposure is not None):
                    _offset = self._offset_exposure.copy()
            else:
                _offset = offset
        elif ((offset is None) and (exposure is None)):
            if (self._offset_exposure is not None):
                _offset = self._offset_exposure
        elif ((offset is None) and (exposure is not None)):
            _offset = np.log(exposure)
            if hasattr(self, 'offset'):
                _offset = (_offset + self.offset)
        elif ((offset is not None) and (exposure is None)):
            _offset = offset
            if hasattr(self, 'exposure'):
                _offset = (offset + np.log(self.exposure))
        else:
            _offset = (offset + np.log(exposure))
    else:
        if (offset is not None):
            _offset = (_offset + offset)
        if (exposure is not None):
            _offset += np.log(exposure)
    lin_pred = (_offset + np.dot(exog, params))
    if (not linear):
        return self.family.link.inverse(lin_pred)
    return lin_pred
