Skip to content

Commit

Permalink
Add flows paper and update sampler recommendations.
Browse files Browse the repository at this point in the history
  • Loading branch information
alicjapolanska committed May 14, 2024
1 parent 41ece0c commit c14714a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
28 changes: 18 additions & 10 deletions .pip_readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ harmonic
:target: https://arxiv.org/abs/2207.04037
.. image:: http://img.shields.io/badge/arXiv-2307.00048-red.svg?style=flat
:target: https://arxiv.org/abs/2307.00048
.. image:: http://img.shields.io/badge/arXiv-2405.05969-red.svg?style=flat
:target: https://arxiv.org/abs/2405.05969


**Python package to efficiently compute the learnt harmonic mean estimator of the Bayesian evidence**


``harmonic`` is an open source, well tested and documented Python implementation of the *learnt harmonic mean estimator* (`McEwen et al. 2021 <https://arxiv.org/abs/2111.12720>`_) to compute the marginal likelihood (Bayesian evidence), required for Bayesian model selection.

While ``harmonic`` requires only posterior samples, and so is agnostic to the technique used to perform Markov chain Monte Carlo (MCMC) sampling, ``harmonic`` works exceptionally well with MCMC sampling techniques that naturally provide samples from multiple chains by their ensemble nature, such as affine invariant ensemble samplers. We therefore advocate use of `harmonic` with the popular `emcee <https://github.com/dfm/emcee>`_ code implementing the affine invariant sampler of `Goodman & Weare (2010) <https://cims.nyu.edu/~weare/papers/d13.pdf>`_.
While ``harmonic`` requires only posterior samples, and so is agnostic to the technique used to perform Markov chain Monte Carlo (MCMC) sampling, ``harmonic`` works well with MCMC sampling techniques that naturally provide samples from multiple chains by their ensemble nature, such as affine invariant ensemble samplers. For instance, `harmonic` can be used with the popular `emcee <https://github.com/dfm/emcee>`_ code implementing the affine invariant sampler of `Goodman & Weare (2010) <https://cims.nyu.edu/~weare/papers/d13.pdf>`_, or the `NumPyro <https://github.com/pyro-ppl/numpyro>`_ code implementing various MCMC algorithms.

Basic usage is highlighted in this `interactive demo <https://colab.research.google.com/github/astro-informatics/harmonic/blob/main/notebooks/basic_usage.ipynb>`_.

Expand All @@ -50,6 +52,21 @@ A BibTeX entry for the paper is:
year = 2021
}
Please *also* cite `Polanska et al. (2024) <https://arxiv.org/abs/2405.05969>`_ if using normalizing flow models.

A BibTeX entry for the paper is:

.. code-block::
@misc{polanska2024learned,
title={Learned harmonic mean estimation of the Bayesian evidence with normalizing flows},
author={Alicja Polanska and Matthew A. Price and Davide Piras and Alessio Spurio Mancini and Jason D. McEwen},
year={2024},
eprint={2405.05969},
archivePrefix={arXiv},
primaryClass={astro-ph.IM}
}
Please *also* cite `Spurio Mancini et al. (2022) <https://arxiv.org/abs/2207.04037>`_ if this code has been of use in a simulation-based inference project.

A BibTeX entry for the paper is:
Expand All @@ -65,15 +82,6 @@ A BibTeX entry for the paper is:
year = {2023}
}
.. code-block::
@inproceedings{polanska:harmonic_nfs_maxent,
author = {A.~Polanska and M.~A.~Price and A.~Spurio Mancini and J.~D.~McEwen},
booktitle = {International Workshop on Bayesian Inference and Maximum Entropy Methods in Science and Engineering},
eprint = {arXiv:2307.00048},
title = {Learned harmonic mean estimation of the marginal likelihood with normalizing flows},
year = {2023}
}
License
-------
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

For an accessible overview of the *learnt harmonic mean estimator* please see this `Towards Data Science article <https://towardsdatascience.com/learnt-harmonic-mean-estimator-for-bayesian-model-selection-47258bb0fc2e>`_.

While ``harmonic`` requires only posterior samples, and so is agnostic to the technique used to perform Markov chain Monte Carlo (MCMC) sampling, ``harmonic`` works exceptionally well with MCMC sampling techniques that naturally provide samples from multiple chains by their ensemble nature, such as affine invariant ensemble samplers. We therefore advocate use of `harmonic` with the popular `emcee <https://github.com/dfm/emcee>`_ code implementing the affine invariant sampler of `Goodman & Weare (2010) <https://cims.nyu.edu/~weare/papers/d13.pdf>`_.
While ``harmonic`` requires only posterior samples, and so is agnostic to the technique used to perform Markov chain Monte Carlo (MCMC) sampling, ``harmonic`` works well with MCMC sampling techniques that naturally provide samples from multiple chains by their ensemble nature, such as affine invariant ensemble samplers. For instance, `harmonic` can be used with the popular `emcee <https://github.com/dfm/emcee>`_ code implementing the affine invariant sampler of `Goodman & Weare (2010) <https://cims.nyu.edu/~weare/papers/d13.pdf>`_, or the `NumPyro <https://github.com/pyro-ppl/numpyro>`_ code implementing various MCMC algorithms.

Basic usage is highlighted in this `interactive demo <https://colab.research.google.com/github/astro-informatics/harmonic/blob/main/notebooks/basic_usage.ipynb>`_.

Expand Down

0 comments on commit c14714a

Please sign in to comment.