Skip to main content

abeec: a library to perform approximate bayesian computation

Project description

abeec 🐝 --- an ABC sampler


abeec is a sampler to perform Approximate Bayesian Computation (ABC) --- i.e., likelihood free posterior inference! It is based on the algorithm presented in Ishida et al. (2015).

Author: Nestor Espinoza (nespinoza@stsci.edu)

Statement of need

While for Cosmological applications an ABC sampler has already been published by the team of Ishida et al (cosmoabc --- check their repository!), there was a need to develop a more general scheme to allow some flexibility to the sampler. For instance, doing arbitrary prior distributions (e.g., with priors that might be correlated) was not straightforward to implement, as well as have external functions for distances and simulators that could all benefit from a common parallelization scheme. On top of that, I wanted a simple sampler that used the most basic python libraries (e.g., numpy and scipy) at its core. That's where abeec comes into place.

Using the library

To perform ABC on a given dataset, you need three ingredients:

  1. A prior from which to draw points.
  2. A distance to compute distances from simulated datasets to your dataset.
  3. And a simulator, to simulate datasets to compare against your dataset.

In abeec, it is expected the user will provide classes defining the prior, the distance and the simulator. All the sampler does it take those and apply the iterative importance sampling scheme outlined in Ishida et al. (2015), giving back a sample from the posterior. Once those classes are written, one might simply run the sampler as:

    import abeec
    from your_script import prior, distance, simulator

    samples = abeec.sample(prior, distance, simulator)

The best is to check the examples under examples.

Installation

Installation is as simple as:

    python setup.py install

Or via PyPi:

    pip install abeec

Licence and attribution

Read the LICENCE file for licencing details on how to use the code. If you make use of this code, please cite Ishida et al. (2015) and link back to this repository.

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

abeec-0.2.tar.gz (20.6 kB view details)

Uploaded Source

Built Distributions

abeec-0.2-py3.7.egg (8.7 kB view details)

Uploaded Source

abeec-0.2-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file abeec-0.2.tar.gz.

File metadata

  • Download URL: abeec-0.2.tar.gz
  • Upload date:
  • Size: 20.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.7.0 requests/2.25.1 setuptools/50.3.0.post20201006 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.10

File hashes

Hashes for abeec-0.2.tar.gz
Algorithm Hash digest
SHA256 b5f129e800224a71ab375a255406ac7c57f3403f81e416157b4c2ecbf2ace801
MD5 7bea4878178f3a935644a4f3ac92043a
BLAKE2b-256 b70840a172350b3e1a11619880c228d35ffdf154507e7ed7ff3157d78ee4fcf0

See more details on using hashes here.

File details

Details for the file abeec-0.2-py3.7.egg.

File metadata

  • Download URL: abeec-0.2-py3.7.egg
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.7.0 requests/2.25.1 setuptools/50.3.0.post20201006 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.10

File hashes

Hashes for abeec-0.2-py3.7.egg
Algorithm Hash digest
SHA256 0ff8253c46d85b797da54f570a29e54b0572bf3045d28909dcbae46bf6938785
MD5 8d526802a070c8e58e6d07cdda6e71aa
BLAKE2b-256 8fb2d3203b38c4a67cae841ede877e40c33ddf522565243307a380f6952ab741

See more details on using hashes here.

File details

Details for the file abeec-0.2-py3-none-any.whl.

File metadata

  • Download URL: abeec-0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.7.0 requests/2.25.1 setuptools/50.3.0.post20201006 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.10

File hashes

Hashes for abeec-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 628bec0dcac21d41a3bd9d898ee30f243585ceb64b565aacda3e4cbfa658b312
MD5 004e07d93fbb0d35b573dcf330c9fc3a
BLAKE2b-256 0dc3be809f6192c98aa5d0ffe34b3e8d833d2a8cd76c4831ff9ee0a4b7f5923e

See more details on using hashes here.

Supported by

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