def predict(self, params, exog=None, exog_infl=None, exposure=None, offset=None, which='mean', y_values=None):
    '\n        Predict response variable or other statistic given exogenous variables.\n\n        Parameters\n        ----------\n        params : array_like\n            The parameters of the model.\n        exog : ndarray, optional\n            Explanatory variables for the main count model.\n            If ``exog`` is None, then the data from the model will be used.\n        exog_infl : ndarray, optional\n            Explanatory variables for the zero-inflation model.\n            ``exog_infl`` has to be provided if ``exog`` was provided unless\n            ``exog_infl`` in the model is only a constant.\n        offset : ndarray, optional\n            Offset is added to the linear predictor of the mean function with\n            coefficient equal to 1.\n            Default is zero if exog is not None, and the model offset if exog\n            is None.\n        exposure : ndarray, optional\n            Log(exposure) is added to the linear predictor with coefficient\n            equal to 1. If exposure is specified, then it will be logged by\n            the method. The user does not need to log it first.\n            Default is one if exog is is not None, and it is the model exposure\n            if exog is None.\n        which : str (optional)\n            Statitistic to predict. Default is \'mean\'.\n\n            - \'mean\' : the conditional expectation of endog E(y | x),\n              i.e. exp of linear predictor.\n            - \'linear\' : the linear predictor of the mean function.\n            - \'var\' : returns the estimated variance of endog implied by the\n              model.\n            - \'mean-main\' : mean of the main count model\n            - \'prob-main\' : probability of selecting the main model.\n                The probability of zero inflation is ``1 - prob-main``.\n            - \'mean-nonzero\' : expected value conditional on having observation\n              larger than zero, E(y | X, y>0)\n            - \'prob-zero\' : probability of observing a zero count. P(y=0 | x)\n            - \'prob\' : probabilities of each count from 0 to max(endog), or\n              for y_values if those are provided. This is a multivariate\n              return (2-dim when predicting for several observations).\n\n        y_values : array_like\n            Values of the random variable endog at which pmf is evaluated.\n            Only used if ``which="prob"``\n        '
    no_exog = False
    if (exog is None):
        no_exog = True
        exog = self.exog
    if (exog_infl is None):
        if no_exog:
            exog_infl = self.exog_infl
        elif self._no_exog_infl:
            exog_infl = np.ones((len(exog), 1))
    else:
        exog_infl = np.asarray(exog_infl)
        if ((exog_infl.ndim == 1) and (self.k_inflate == 1)):
            exog_infl = exog_infl[:, None]
    if (exposure is None):
        if no_exog:
            exposure = getattr(self, 'exposure', 0)
        else:
            exposure = 0
    else:
        exposure = np.log(exposure)
    if (offset is None):
        if no_exog:
            offset = getattr(self, 'offset', 0)
        else:
            offset = 0
    params_infl = params[:self.k_inflate]
    params_main = params[self.k_inflate:]
    prob_main = (1 - self.model_infl.predict(params_infl, exog_infl))
    lin_pred = ((np.dot(exog, params_main[:self.exog.shape[1]]) + exposure) + offset)
    tmp_exog = self.model_main.exog
    tmp_endog = self.model_main.endog
    tmp_offset = getattr(self.model_main, 'offset', False)
    tmp_exposure = getattr(self.model_main, 'exposure', False)
    self.model_main.exog = exog
    self.model_main.endog = np.zeros(exog.shape[0])
    self.model_main.offset = offset
    self.model_main.exposure = exposure
    llf = self.model_main.loglikeobs(params_main)
    self.model_main.exog = tmp_exog
    self.model_main.endog = tmp_endog
    if (tmp_offset is False):
        del self.model_main.offset
    else:
        self.model_main.offset = tmp_offset
    if (tmp_exposure is False):
        del self.model_main.exposure
    else:
        self.model_main.exposure = tmp_exposure
    prob_zero = ((1 - prob_main) + (prob_main * np.exp(llf)))
    if (which == 'mean'):
        return (prob_main * np.exp(lin_pred))
    elif (which == 'mean-main'):
        return np.exp(lin_pred)
    elif (which == 'linear'):
        return lin_pred
    elif (which == 'mean-nonzero'):
        return ((prob_main * np.exp(lin_pred)) / (1 - prob_zero))
    elif (which == 'prob-zero'):
        return prob_zero
    elif (which == 'prob-main'):
        return prob_main
    elif (which == 'var'):
        mu = np.exp(lin_pred)
        return self._predict_var(params, mu, (1 - prob_main))
    elif (which == 'prob'):
        return self._predict_prob(params, exog, exog_infl, exposure, offset, y_values=y_values)
    else:
        raise ValueError(('which = %s is not available' % which))
Predict response variable or other statistic given exogenous variables.

Parameters
----------
params : array_like
    The parameters of the model.
exog : ndarray, optional
    Explanatory variables for the main count model.
    If ``exog`` is None, then the data from the model will be used.
exog_infl : ndarray, optional
    Explanatory variables for the zero-inflation model.
    ``exog_infl`` has to be provided if ``exog`` was provided unless
    ``exog_infl`` in the model is only a constant.
offset : ndarray, optional
    Offset is added to the linear predictor of the mean function with
    coefficient equal to 1.
    Default is zero if exog is not None, and the model offset if exog
    is None.
exposure : ndarray, optional
    Log(exposure) is added to the linear predictor with coefficient
    equal to 1. If exposure is specified, then it will be logged by
    the method. The user does not need to log it first.
    Default is one if exog is is not None, and it is the model exposure
    if exog is None.
which : str (optional)
    Statitistic to predict. Default is 'mean'.

    - 'mean' : the conditional expectation of endog E(y | x),
      i.e. exp of linear predictor.
    - 'linear' : the linear predictor of the mean function.
    - 'var' : returns the estimated variance of endog implied by the
      model.
    - 'mean-main' : mean of the main count model
    - 'prob-main' : probability of selecting the main model.
        The probability of zero inflation is ``1 - prob-main``.
    - 'mean-nonzero' : expected value conditional on having observation
      larger than zero, E(y | X, y>0)
    - 'prob-zero' : probability of observing a zero count. P(y=0 | x)
    - 'prob' : probabilities of each count from 0 to max(endog), or
      for y_values if those are provided. This is a multivariate
      return (2-dim when predicting for several observations).

y_values : array_like
    Values of the random variable endog at which pmf is evaluated.
    Only used if ``which="prob"``
def predict(self, params, exog=None, exog_infl=None, exposure=None, offset=None, which='mean', y_values=None):
    '\n        Predict response variable or other statistic given exogenous variables.\n\n        Parameters\n        ----------\n        params : array_like\n            The parameters of the model.\n        exog : ndarray, optional\n            Explanatory variables for the main count model.\n            If ``exog`` is None, then the data from the model will be used.\n        exog_infl : ndarray, optional\n            Explanatory variables for the zero-inflation model.\n            ``exog_infl`` has to be provided if ``exog`` was provided unless\n            ``exog_infl`` in the model is only a constant.\n        offset : ndarray, optional\n            Offset is added to the linear predictor of the mean function with\n            coefficient equal to 1.\n            Default is zero if exog is not None, and the model offset if exog\n            is None.\n        exposure : ndarray, optional\n            Log(exposure) is added to the linear predictor with coefficient\n            equal to 1. If exposure is specified, then it will be logged by\n            the method. The user does not need to log it first.\n            Default is one if exog is is not None, and it is the model exposure\n            if exog is None.\n        which : str (optional)\n            Statitistic to predict. Default is \'mean\'.\n\n            - \'mean\' : the conditional expectation of endog E(y | x),\n              i.e. exp of linear predictor.\n            - \'linear\' : the linear predictor of the mean function.\n            - \'var\' : returns the estimated variance of endog implied by the\n              model.\n            - \'mean-main\' : mean of the main count model\n            - \'prob-main\' : probability of selecting the main model.\n                The probability of zero inflation is ``1 - prob-main``.\n            - \'mean-nonzero\' : expected value conditional on having observation\n              larger than zero, E(y | X, y>0)\n            - \'prob-zero\' : probability of observing a zero count. P(y=0 | x)\n            - \'prob\' : probabilities of each count from 0 to max(endog), or\n              for y_values if those are provided. This is a multivariate\n              return (2-dim when predicting for several observations).\n\n        y_values : array_like\n            Values of the random variable endog at which pmf is evaluated.\n            Only used if ``which="prob"``\n        '
    no_exog = False
    if (exog is None):
        no_exog = True
        exog = self.exog
    if (exog_infl is None):
        if no_exog:
            exog_infl = self.exog_infl
        elif self._no_exog_infl:
            exog_infl = np.ones((len(exog), 1))
    else:
        exog_infl = np.asarray(exog_infl)
        if ((exog_infl.ndim == 1) and (self.k_inflate == 1)):
            exog_infl = exog_infl[:, None]
    if (exposure is None):
        if no_exog:
            exposure = getattr(self, 'exposure', 0)
        else:
            exposure = 0
    else:
        exposure = np.log(exposure)
    if (offset is None):
        if no_exog:
            offset = getattr(self, 'offset', 0)
        else:
            offset = 0
    params_infl = params[:self.k_inflate]
    params_main = params[self.k_inflate:]
    prob_main = (1 - self.model_infl.predict(params_infl, exog_infl))
    lin_pred = ((np.dot(exog, params_main[:self.exog.shape[1]]) + exposure) + offset)
    tmp_exog = self.model_main.exog
    tmp_endog = self.model_main.endog
    tmp_offset = getattr(self.model_main, 'offset', False)
    tmp_exposure = getattr(self.model_main, 'exposure', False)
    self.model_main.exog = exog
    self.model_main.endog = np.zeros(exog.shape[0])
    self.model_main.offset = offset
    self.model_main.exposure = exposure
    llf = self.model_main.loglikeobs(params_main)
    self.model_main.exog = tmp_exog
    self.model_main.endog = tmp_endog
    if (tmp_offset is False):
        del self.model_main.offset
    else:
        self.model_main.offset = tmp_offset
    if (tmp_exposure is False):
        del self.model_main.exposure
    else:
        self.model_main.exposure = tmp_exposure
    prob_zero = ((1 - prob_main) + (prob_main * np.exp(llf)))
    if (which == 'mean'):
        return (prob_main * np.exp(lin_pred))
    elif (which == 'mean-main'):
        return np.exp(lin_pred)
    elif (which == 'linear'):
        return lin_pred
    elif (which == 'mean-nonzero'):
        return ((prob_main * np.exp(lin_pred)) / (1 - prob_zero))
    elif (which == 'prob-zero'):
        return prob_zero
    elif (which == 'prob-main'):
        return prob_main
    elif (which == 'var'):
        mu = np.exp(lin_pred)
        return self._predict_var(params, mu, (1 - prob_main))
    elif (which == 'prob'):
        return self._predict_prob(params, exog, exog_infl, exposure, offset, y_values=y_values)
    else:
        raise ValueError(('which = %s is not available' % which))