8000 GitHub - PeiKaLunCi/harmonic: Machine learning assisted marginal likelihood (Bayesian evidence) estimation for Bayesian model selection
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Machine learning assisted marginal likelihood (Bayesian evidence) estimation for Bayesian model selection

License

Notifications You must be signed in to change notification settings

PeiKaLunCi/harmonic

 
 

Repository files navigation

https://img.shields.io/badge/GitHub-harmonic-brightgreen.svg?style=flat https://readthedocs.org/projects/ansicolortags/badge/?version=latest https://codecov.io/gh/astro-informatics/harmonic/branch/main/graph/badge.svg?token=1s4SATphHV http://img.shields.io/badge/arXiv-2111.12720-orange.svg?style=flat http://img.shields.io/badge/arXiv-2207.04037-red.svg?style=flat

Harmonic

harmonic is an open source, well tested and documented Python implementation of the learnt harmonic mean estimator (McEwen et al. 2021) to compute the marginal likelihood (Bayesian evidence), required for Bayesian model selection.

For an accessible overview of the learnt harmonic mean estimator please see this Towards Data Science article.

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 code implementing the affine invariant sampler of Goodman & Weare (2010).

Basic usage is highlighted in this interactive demo.

Overview video

docs/assets/video_screenshot.png

Installation

Brief installation instructions are given below (for further details see the full installation documentation).

Quick install (PyPi)

The harmonic package can be installed by running

pip install harmonic

Install from source (GitHub)

The harmonic package can also be installed from source by running

git clone https://github.com/astro-informatics/harmonic
cd harmonic

and running the install script, within the root directory, with one command

bash build_harmonic.sh

To check the install has worked correctly run the unit tests with

pytest

Documentation

Comprehensive documentation for harmonic is available.

Contributors

Jason D. McEwen, Christopher G. R. Wallis, Matthew A. Price, Matthew M. Docherty, Alessio Spurio Mancini

Attribution

Please cite McEwen et al. (2021) if this code package has been of use in your project.

A BibTeX entry for the paper is:

@article{harmonic,
   author = {Jason~D.~McEwen and Christopher~G.~R.~Wallis and Matthew~A.~Price and Matthew~M.~Docherty},
    title = {Machine learning assisted {B}ayesian model comparison: learnt harmonic mean estimator},
  journal = {ArXiv},
   eprint = {arXiv:2111.12720},
     year = 2021
}

Please also cite Spurio Mancini et al. (2022) if this code has been of use in a simulation-based inference project.

A BibTeX entry for the paper is:

@article{harmonic_sbi,
   author = {Spurio Mancini, A. and Docherty, M. M. and Price, M. A. and McEwen, J. D.},
    title = {{B}ayesian model comparison for simulation-based inference},
  journal = {ArXiv},
   eprint = {arXiv:2207.04037},
     year = 2022
}

License

harmonic is released under the GPL-3 license (see LICENSE.txt), subject to the non-commercial use condition (see LICENSE_EXT.txt)

harmonic
Copyright (C) 2021 Jason D. McEwen, Christopher G. R. Wallis,
Matthew A. Price, Matthew M. Docherty, Alessio Spurio Mancini & contributors

This program is released under the GPL-3 license (see LICENSE.txt),
subject to a non-commercial use condition (see LICENSE_EXT.txt).

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

About

Machine learning assisted marginal likelihood (Bayesian evidence) estimation for Bayesian model selection

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Cython 36.4%
  • Jupyter Notebook 36.4%
  • Python 26.9%
  • Shell 0.3%
0