Skip to main content

Neural Network-Boosted Importance Sampling for Bayesian Statistics

Project description

Logo

Unit Testing Status Documentation Status PyPI License: MIT Language: Python

nautilus is an MIT-licensed pure-Python package for Bayesian posterior and evidence estimation. It utilizes importance sampling and efficient space tessellation using neural networks. Compared to traditional MCMC and Nested Sampling codes, it needs fewer likelihood calls and produces much larger posterior samples. Additionally, nautilus is highly accurate and produces Bayesian evidence estimates with percent precision.

Example

This example, sampling a 3-dimensional Gaussian, illustrates how to use nautilus.

import corner
import numpy as np
from nautilus import Prior, Sampler
from scipy.stats import multivariate_normal

prior = Prior()
for key in 'abc':
    prior.add_parameter(key)

def likelihood(param_dict):
    x = [param_dict[key] for key in 'abc']
    return multivariate_normal.logpdf(x, mean=[0.4, 0.5, 0.6], cov=0.01)

sampler = Sampler(prior, likelihood)
sampler.run(verbose=True)
points, log_w, log_l = sampler.posterior()
corner.corner(points, weights=np.exp(log_w), labels='abc')

Documentation

You can find the documentation at nautilus-sampler.readthedocs.io.

License

nautilus is licensed under the MIT License. The logo uses an image from the Illustris Collaboration.

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

nautilus-sampler-0.3.2.tar.gz (20.6 kB view details)

Uploaded Source

Built Distribution

nautilus_sampler-0.3.2-py2.py3-none-any.whl (22.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file nautilus-sampler-0.3.2.tar.gz.

File metadata

  • Download URL: nautilus-sampler-0.3.2.tar.gz
  • Upload date:
  • Size: 20.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.27.1

File hashes

Hashes for nautilus-sampler-0.3.2.tar.gz
Algorithm Hash digest
SHA256 23307d2322e5d3566dbfc9af042ee708b6e2b632f0f22b405af8ad5e0db1d26b
MD5 fde05766d745f1ca646f80389730eaf6
BLAKE2b-256 01ca63ba0bdd0f7d386c86292d46fdf26ea57809a9f6bdffbbe8ecae3ff7807f

See more details on using hashes here.

File details

Details for the file nautilus_sampler-0.3.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for nautilus_sampler-0.3.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f9aed3794bd2a74dfedbbbcb38eafa18532ca52be73bfdb794cea1f952b666bf
MD5 369b6f3cf69d39606281cad3c6dae46c
BLAKE2b-256 5da87126051394315a498c4c68f59b687b2f4e75e31be8df660e30928f48f821

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