Skip to main content

Neural Network-Boosted Importance Sampling for Bayesian Statistics

Project description

Logo

Unit Testing Status Code Coverage 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 exploration 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.4.1.tar.gz (28.9 kB view details)

Uploaded Source

Built Distribution

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

nautilus_sampler-0.4.1-py2.py3-none-any.whl (22.8 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

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

File hashes

Hashes for nautilus-sampler-0.4.1.tar.gz
Algorithm Hash digest
SHA256 15de65e2b9c1c5e297ec5a6830508de33ea584d0671da69fafd41689288e50ce
MD5 6d3d5669af8d4f41f2e959dce2f2cd12
BLAKE2b-256 b7a0ceb03d26d18496e4e612a1a5415dde1fced2c14495380c8f406a0d5405a6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nautilus_sampler-0.4.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 15be20fcb2b3c9e5063c151a854e29f2ee931d6c15a8d4f0d82aa840b9078713
MD5 41648f1fd297cc8a0683442cb41e4879
BLAKE2b-256 ce798b0074e6886755e7ce22b3c6fc68ea3dbb34c1459e5638580b31743036ca

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