bambinos / bambi

BAyesian Model-Building Interface (Bambi) in Python.
https://bambinos.github.io/bambi/
MIT License
1.08k stars 124 forks source link

Support variational inference in StanBackEnd #80

Closed tyarkoni closed 4 years ago

tyarkoni commented 7 years ago

We currently support PyMC's ADVI implementation, but PyStan now provides easy access to Stan's VI implementation as well (which has the benefit of supporting not just the mean-field but also the full-rank approximation), so we should implement support for it. Probably the way to go is to stick with the approach of taking a method argument to the sampler (which should be made explicit in the signature; right now it's passed through in kwargs) that can be either 'mcmc' or 'advi'. Users can then specify algorithm='fullrank' if they like, which would be passed through to the PyStan advi init.

ahartikainen commented 5 years ago

Stan 2.19 (not yet in PyStan 2.19 vb output, but should be in csv file, if user defines that) has log_p and log_g (these are found in PyMC3 already), which enable use methods defined in "Yes, but Did It Work?: Evaluating Variational Inference"

https://arxiv.org/abs/1802.02538

Also we are going to add a bit more diagnostics for vb, which are already found in PyMC3.