statsmodels.genmod.bayes_mixed_glm.PoissonBayesMixedGLM.predict#

PoissonBayesMixedGLM.predict(params, exog=None, linear=None, which='mean')#

Return the fitted mean structure.

Parameters:
paramsarray_like

The parameter vector, may be the full parameter vector, or may be truncated to include only the mean parameters.

exogarray_like, optional

The design matrix for the mean structure. If omitted, use the model’s design matrix.

linearbool, optional

If True, return the linear predictor without passing through the link function.

Deprecated since version 0.15.1: Use which="linear" instead of linear=True and which="mean" instead of linear=False. linear will be removed in statsmodels 0.17.0.

which{“mean”, “linear”}, optional

Statistic to predict. Default is “mean”.

  • “mean” returns the inverse link function applied to the linear predictor, exog @ params[:k_exog].

  • “linear” returns the linear predictor, exog @ params[:k_exog], without passing through the link function.

Added in version 0.15.1.

Returns:
ndarray

A 1-dimensional array of predicted values.

Notes

Only the fixed effects part of params is used. “mean” is therefore the conditional mean given that all random effects are zero, which is not the marginal mean, E(y | x), of a mixed model with a non-identity link. Use params from fit_map (posterior mode) or from fit_vb (variational posterior mean).