'Return predicted values for a design matrix
Parameters
params : array-like
Parameters / coefficients of a GLM.
exog : array-like, optional
Design / exogenous data. Is exog is None, model exog is used.
exposure : array-like, optional
Exposure time values, only can be used with the log link
function.  See notes for details.
offset : array-like, optional
Offset values.  See notes for details.
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
Any `exposure` and `offset` provided here take precedence over
the `exposure` and `offset` used in the model fit.  If `exog`
is passed as an argument here, then any `exposure` and
`offset` values in the fit will be ignored.
Exposure values must be strictly positive.'

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

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