Skip to main content

Python package for efficient Bayesian evidence computation

Project description

https://img.shields.io/badge/GitHub-harmonic-brightgreen.svg?style=flat https://github.com/astro-informatics/harmonic/actions/workflows/python.yml/badge.svg https://readthedocs.org/projects/ansicolortags/badge/?version=latest https://codecov.io/gh/astro-informatics/harmonic/branch/main/graph/badge.svg?token=1s4SATphHV https://img.shields.io/badge/License-GPL-blue.svg http://img.shields.io/badge/arXiv-2111.12720-orange.svg?style=flat

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

Basic usage is highlighted in this interactive demo.

Documentation

Comprehensive documentation for harmonic is available.

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
}

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 & 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

harmonic-1.0.3.tar.gz (425.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

harmonic-1.0.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.5+ x86-64

harmonic-1.0.3-cp38-cp38-macosx_10_9_x86_64.whl (410.7 kB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

harmonic-1.0.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.5+ x86-64

harmonic-1.0.3-cp37-cp37m-macosx_10_9_x86_64.whl (401.9 kB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

harmonic-1.0.3-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.5+ x86-64

harmonic-1.0.3-cp36-cp36m-macosx_10_9_x86_64.whl (422.4 kB view details)

Uploaded CPython 3.6mmacOS 10.9+ x86-64

File details

Details for the file harmonic-1.0.3.tar.gz.

File metadata

  • Download URL: harmonic-1.0.3.tar.gz
  • Upload date:
  • Size: 425.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for harmonic-1.0.3.tar.gz
Algorithm Hash digest
SHA256 8b447666342f32a92bd055122fa53489d07929d4ef937147840b61d0a786c20d
MD5 5d6b34fa1117689d44cc916ccdb03186
BLAKE2b-256 c3fdf94af05003a76989af9f1e3b1ab10045e2886bc93363e84b479af972b954

See more details on using hashes here.

File details

Details for the file harmonic-1.0.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

  • Download URL: harmonic-1.0.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: CPython 3.8, manylinux: glibc 2.5+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for harmonic-1.0.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0e54054acdea24dab10679c88589862ef717a2f82e3063c34867ec829e31651a
MD5 93209adb614b3b1a94cd510a122abc2d
BLAKE2b-256 793b68cc3bb475c93c5a16bd099393c36605099bcb359f00e03498279016eaa9

See more details on using hashes here.

File details

Details for the file harmonic-1.0.3-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: harmonic-1.0.3-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 410.7 kB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for harmonic-1.0.3-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d464ba11bb2ef9f3b0b26162dcfc87150f57760592d554d96d85aa0fe1b33980
MD5 c7c132a9445445ac1a1d76cc383fa615
BLAKE2b-256 13d371eadf967e18d60f5d74c1515712041a0a94d562f63391c68011e264629c

See more details on using hashes here.

File details

Details for the file harmonic-1.0.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

  • Download URL: harmonic-1.0.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.7m, manylinux: glibc 2.5+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for harmonic-1.0.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 dad55cadd202439ce244864ce0180afdb471fc0f139926799b89c4821903ebdf
MD5 95c6c585e8315e931be11619e05f7e76
BLAKE2b-256 7c6abf7ea8bc666668d42ed3e95f4605e0e47af0f2a8f1873b070b6771400a64

See more details on using hashes here.

File details

Details for the file harmonic-1.0.3-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: harmonic-1.0.3-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 401.9 kB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for harmonic-1.0.3-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3bc8f2c5098b60cef0421f7bdddaa5672d74954f3b0eaf30747a67d89ec69567
MD5 fb1bc0d3bec58ef2e9d38fdf35ba01bf
BLAKE2b-256 9df1c737d9ff24f5e8ea58a17cd90e362ed7f88b7740cc98185acf794183336f

See more details on using hashes here.

File details

Details for the file harmonic-1.0.3-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

  • Download URL: harmonic-1.0.3-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.6m, manylinux: glibc 2.5+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for harmonic-1.0.3-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f9518abb36a0397c9740d32532baf9af2b6b79c7cc7e8fbc835d95f6d06de1dc
MD5 82260d1fad0904757e8f307189bdcc77
BLAKE2b-256 adc6eafde5de628060169dda95ce3baadc642dbc0f3c496d7e51444cc763d5dc

See more details on using hashes here.

File details

Details for the file harmonic-1.0.3-cp36-cp36m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: harmonic-1.0.3-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 422.4 kB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for harmonic-1.0.3-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 bcaf94c85eefdac7b20363b7714edf2a06b710c5f08a27bdb1f5fee1d81f74f2
MD5 242a2d1f95db9b0dca866c7d3b9db337
BLAKE2b-256 15f56bc95de6b619dd177408fd66fe13b1836d8a56f871cfcb713460a378ed75

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page