statsmodels.discrete.discrete_model.CountModel.predict

CountModel.predict(params, exog=None, exposure=None, offset=None, which='mean', linear=None)[source]

Predict response variable of a count model given exogenous variables

Parameters:
paramsarray_like

Model parameters

exogarray_like, optional

Design / exogenous data. Is exog is None, model exog is used.

exposurearray_like, optional

Log(exposure) is added to the linear prediction with coefficient equal to 1. If exposure is not provided and exog is None, uses the model’s exposure if present. If not, uses 0 as the default value.

offsetarray_like, optional

Offset is added to the linear prediction with coefficient equal to 1. If offset is not provided and exog is None, uses the model’s offset if present. If not, uses 0 as the default value.

which‘mean’, ‘linear’, ‘var’, ‘prob’ (optional)

Statitistic to predict. Default is ‘mean’.

  • ‘mean’ returns the conditional expectation of endog E(y | x), i.e. exp of linear predictor.

  • ‘linear’ returns the linear predictor of the mean function.

  • ‘var’ variance of endog implied by the likelihood model

  • ‘prob’ predicted probabilities for counts.

linearbool

If True, returns the linear predicted values. If False or None, then the statistic specified by which will be returned.

Notes

If exposure is specified, then it will be logged by the method. The user does not need to log it first.


Last update: Oct 03, 2024