statsmodels.genmod.bayes_mixed_glm.BinomialBayesMixedGLM.fit_vb

BinomialBayesMixedGLM.fit_vb(mean=None, sd=None, fit_method='BFGS', minim_opts=None, scale_fe=False, verbose=False)

Fit a model using the variational Bayes mean field approximation.

Parameters:
  • mean (array-like) – Starting value for VB mean vector
  • sd (array-like) – Starting value for VB standard deviation vector
  • fit_method (string) – Algorithm for scipy.minimize
  • minim_opts (dict-like) – Options passed to scipy.minimize
  • scale_fe (bool) – If true, the columns of the fixed effects design matrix are centered and scaled to unit variance before fitting the model. The results are back-transformed so that the results are presented on the original scale.
  • verbose (bool) – If True, print the gradient norm to the screen each time it is calculated.

Notes

The goal is to find a factored Gaussian approximation q1*q2*… to the posterior distribution, approximately minimizing the KL divergence from the factored approximation to the actual posterior. The KL divergence, or ELBO function has the form

E* log p(y, fe, vcp, vc) - E* log q

where E* is expectation with respect to the product of qj.

References

Blei, Kucukelbir, McAuliffe (2017). Variational Inference: A review for Statisticians https://arxiv.org/pdf/1601.00670.pdf