Skip to main content

Logo

Unit Testing Status Documentation Status Code Coverage PyPI PyPI - Downloads Conda Conda - Downloads 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 often needs fewer likelihood calls and produces much larger posterior samples. Additionally, nautilus is highly accurate and produces Bayesian evidence estimates with percent precision. It is widely used in many areas of astrophysical research.

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')

Installation

The most recent stable version of nautilus is listed in the Python Package Index (PyPI) and can be installed via pip.

pip install nautilus-sampler

Additionally, nautilus is also on conda-forge. To install via conda use the following command.

conda install -c conda-forge nautilus-sampler

Documentation

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

Attribution

A paper describing nautilus's underlying methods and performance has been published in the Monthly Notices of the Royal Astronomical Society. A draft of the paper is also available on arXiv. Please cite the paper if you find nautilus helpful in your research.

@article{nautilus,
    author = {Lange, Johannes U},
    title = "{nautilus: boosting Bayesian importance nested sampling with deep learning}",
    journal = {Monthly Notices of the Royal Astronomical Society},
    volume = {525},
    number = {2},
    pages = {3181-3194},
    year = {2023},
    month = {08},
    doi = {10.1093/mnras/stad2441},
    url = {https://doi.org/10.1093/mnras/stad2441},
    eprint = {https://academic.oup.com/mnras/article-pdf/525/2/3181/51331635/stad2441.pdf},
}

License

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

Metadata

Release files for nautilus-sampler 1.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nautilus-sampler 1.0.6
File Size Uploaded
nautilus_sampler-1.0.6.tar.gz 43.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nautilus-sampler 1.0.6
File Interpreter ABI Platform
nautilus_sampler-1.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 78.9 kB

Release files / nautilus_sampler-1.0.6.tar.gz

Download URL nautilus_sampler-1.0.6.tar.gz
Size 43.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4e90b6d97be742be2e255c35a79e5a388cee043b4d2ce970eec327ed34139b78
BLAKE2b-256 checksum
How to use checksums
b12ca50c1a550ba43d86a0b41cf6410986d478d8640139c8e963f4dde8a8bfc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.32.3

Release files / nautilus_sampler-1.0.6-py3-none-any.whl

Download URL nautilus_sampler-1.0.6-py3-none-any.whl
Size 35.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
de6f3b9d249d87f05a673e8597e56621037e84dc712a6c2d3c18ff3672735b9b
BLAKE2b-256 checksum
How to use checksums
4754372c42bcfe324b650946f6cfee0e5adbd55aafc25cab555460bf5d9e8d36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.32.3

Release history Release notifications | RSS feed

This release

1.0.6 This release

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page