statsmodels.discrete.discrete_model.NegativeBinomial.predict

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

Predict response variable of a model given exogenous variables.

Parameters:
paramsarray_like

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

exogarray_like, optional

1d or 2d array of exogenous values. If not supplied, then the 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.

offsetarray_like, optional

Offset is added to the linear predictor with coefficient equal to 1. Default is zero if exog is not None, and the model offset if exog is None.

exposurearray_like, optional

Log(exposure) is added to the linear prediction with coefficient equal to 1. Default is one if exog is is not None, and is the model exposure if exog is None.

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’ returns the estimated variance of endog implied by the model.

  • ‘prob’ return probabilities for counts from 0 to max(endog) or for y_values if those are provided.

linearbool

The linear` keyword is deprecated and will be removed, use ``which keyword instead. If True, returns the linear predicted values. If False or None, then the statistic specified by which will be returned.

y_valuesarray_like

Values of the random variable endog at which pmf is evaluated. Only used if which="prob"


Last update: Nov 14, 2024