statsmodels.genmod.bayes_mixed_glm.BayesMixedGLMResults.predict#

BayesMixedGLMResults.predict(exog=None, linear=None, which='mean')[source]#

Return predicted values for the mean structure.

Parameters:
exogarray_like, optional

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

linearbool, optional

If True, returns the linear predictor, otherwise transform the linear predictor using 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 one-dimensional array of fitted values.

Notes

Only the fixed effects part of the parameters is used, fe_mean. “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. The fixed effects are the posterior mode if the model was fit using fit_map and the variational posterior mean if it was fit using fit_vb.