statsmodels.discrete.discrete_model.NegativeBinomialP.predict

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

Predict response variable of a model given exogenous variables.

Parameters:

params : array_like

2d array of fitted parameters of the model. Should be in the order returned from the model.

exog : array_like, optional

1d or 2d array of exogenous values. If not supplied, the whole exog attribute of the model is used. If a 1d array is given it assumed to be 1 row of exogenous variables. If you only have one regressor and would like to do prediction, you must provide a 2d array with shape[1] == 1.

linear : bool, optional

If True, returns the linear predictor dot(exog,params). Else, returns the value of the cdf at the linear predictor.

offset : array_like, optional

Offset is added to the linear prediction with coefficient equal to 1.

exposure : array_like, optional

Log(exposure) is added to the linear prediction with coefficient

equal to 1.

which : ‘mean’, ‘linear’, ‘prob’, optional.

‘mean’ returns the exp of linear predictor exp(dot(exog,params)). ‘linear’ returns the linear predictor dot(exog,params). ‘prob’ return probabilities for counts from 0 to max(endog). Default is ‘mean’.