acerbilab / pyvbmc

PyVBMC: Variational Bayesian Monte Carlo algorithm for posterior and model inference in Python
https://acerbilab.github.io/pyvbmc/
BSD 3-Clause "New" or "Revised" License
114 stars 6 forks source link

feat: enhance variational_optimization code and improve test coverage #29

Closed Solosneros closed 2 years ago

Solosneros commented 3 years ago

I increased the test coverage of variational_optimization.py from 79% -> 90% by adding three tests using Gaussian Mixtures and removing some dead code. The results and the comparison to MATLAB can be found below.

image

Furthermore, after speaking to @lacerbi I removed the CMA-ES optimization as it does not work well with variational_optimization. Then, I fixed a bug resulting from vp.sigma being 1D in variational_optimization.py. Finally, I added a setup.py so that we are able to use pyvbmc in jupiter notebooks without having to setup the final installation procedure and replaced some generic exceptions by specific ones.