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.1.tar.gz (459.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.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.5+ x86-64

harmonic-1.0.3.1-cp38-cp38-macosx_10_9_x86_64.whl (388.7 kB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

harmonic-1.0.3.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.5+ x86-64

harmonic-1.0.3.1-cp37-cp37m-macosx_10_9_x86_64.whl (380.7 kB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

harmonic-1.0.3.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.5+ x86-64

harmonic-1.0.3.1-cp36-cp36m-macosx_10_9_x86_64.whl (382.5 kB view details)

Uploaded CPython 3.6mmacOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: harmonic-1.0.3.1.tar.gz
  • Upload date:
  • Size: 459.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.13

File hashes

Hashes for harmonic-1.0.3.1.tar.gz
Algorithm Hash digest
SHA256 3cc4143db7cd21a528c0f88d7a300843b79342f628cf0232d7e7f960e7f64c16
MD5 b9394a9f4b464c7377a46992fa9e33ba
BLAKE2b-256 809d258795ed22a6b66590a859cc89efbf2b0940fb09ce677702f1d28c52a38c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for harmonic-1.0.3.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 550a66776285b8faf2c8e67e367ff63023053b7d1eeca4b98fca20ff915b68aa
MD5 5b51282d8cd5be26ede77c67b9b5d4ba
BLAKE2b-256 5c635d8757ca3937f04df7e48f0b4e53dce29f1deb1c672d1b6f767cdad0fe80

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for harmonic-1.0.3.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e785dc436e26ff62d2a96b7b422817721e37d5c42621bfeddfc471febd018b6c
MD5 895687cea2ed5e00453b88eb89ccd398
BLAKE2b-256 b781b5f864489d954c67180a4eee7a184f0c3bc450d5bcee8ed263c43b4390a6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for harmonic-1.0.3.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b122af5fc798fc78fde4840f8b4a062949e8142b507f5a5216c665374ea56173
MD5 7f7aaa334841bae858abeb0fe8e9fb71
BLAKE2b-256 b488422a0cd7873453a4efd0bb31ede00d261d68217402c85a633e2d3d5ca335

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for harmonic-1.0.3.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 66dcf10cab100ad623bd60adc0643909476572acf05b74d8f980f0e7e4f1576a
MD5 db0cb23764c35fa39b7f72ebe20a01dc
BLAKE2b-256 0c22c99f694b9311bd8674df4d445afc0f0b23260ff1b2783aae6deef473d5ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for harmonic-1.0.3.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 552a46022a1592ed54b589e78e41fcb433347479242079aeb6838e4b65f7e284
MD5 9bce206cadd2c01ee2c76c7fa2faf46a
BLAKE2b-256 644ee092e55c775d15e1641d20b1db328c4019b68a94304f95d81e99091c4664

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for harmonic-1.0.3.1-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 bef39d5afb1ac1ea2c4b49c39e66312f58c59ec710a6da388778e6b16c2923b8
MD5 91ca2e08230383912aa5ed0178cd9811
BLAKE2b-256 261158fde3a79ba2744c6ea29a080070ccb73c54bfbda054a911e7e1e789843c

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