GenericLikelihoodModelResults.get_prediction(exog=None, which='mean', transform=True, row_labels=None, average=False, agg_weights=None, **kwargs)[source]

Compute prediction results when endpoint transformation is valid.

exogarray_like, optional

The values for which you want to predict.

transformbool, optional

If the model was fit via a formula, do you want to pass exog through the formula. Default is True. E.g., if you fit a model y ~ log(x1) + log(x2), and transform is True, then you can pass a data structure that contains x1 and x2 in their original form. Otherwise, you’d need to log the data first.


Which statistic is to be predicted. Default is “mean”. The available statistics and options depend on the model. see the model.predict docstring

row_labelslist of str or None

If row_lables are provided, then they will replace the generated labels.


If average is True, then the mean prediction is computed, that is, predictions are computed for individual exog and then the average over observation is used. If average is False, then the results are the predictions for all observations, i.e. same length as exog.

agg_weightsndarray, optional

Aggregation weights, only used if average is True. The weights are not normalized.


Some models can take additional keyword arguments, such as offset, exposure or additional exog in multi-part models like zero inflated models. See the predict method of the model for the details.


The prediction results instance contains prediction and prediction variance and can on demand calculate confidence intervals and summary dataframe for the prediction.


Status: new in 0.14, experimental

Last update: Jul 16, 2024