Persistent Sampling
Project description
TEMPEST
Tempest is a Python implementation of the Persistent Sampling method for accelerated Bayesian inference
Getting started
Brief introduction
Tempest is a Python package for fast Bayesian posterior and model evidence estimation. It leverages
the Persistent Sampling (PS) algorithm, offering significant speed improvements over
traditional methods like MCMC and Nested Sampling. Ideal for large-scale scientific problems
with expensive likelihood evaluations, non-linear correlations, and multimodality, Tempest
provides efficient and scalable posterior sampling and model evidence estimation. Widely used
in cosmology and astronomy, Tempest is user-friendly, flexible, and actively maintained.
Documentation
Read the docs at tempest-sampler.readthedocs.io for more information, examples and tutorials. For a detailed list of changes, see the CHANGELOG.md.
Installation
To install tempest using pip run:
pip install tempest-sampler
or, to install from source:
git clone https://github.com/minaskar/tempest.git
cd tempest
pip install .
Basic example
For instance, if you wanted to draw samples from a 10-dimensional Rosenbrock distribution with a uniform prior, you would do something like:
import tempest as tp
import numpy as np
n_dim = 10 # Number of dimensions
# Define prior transform: U(-10, 10) for each dimension
def prior_transform(u):
return 20 * u - 10
# Define log-likelihood
def log_likelihood(x):
return -np.sum(10.0*(x[:,::2]**2.0 - x[:,1::2])**2.0 \
+ (x[:,::2] - 1.0)**2.0, axis=1)
# Create and run sampler
sampler = tp.Sampler(
prior_transform=prior_transform,
log_likelihood=log_likelihood,
n_dim=n_dim,
vectorize=True,
)
sampler.run()
samples, weights, logl = sampler.posterior() # Weighted posterior samples
logz, logz_err = sampler.evidence() # Bayesian model evidence estimate and uncertainty
Attribution & Citation
Please cite the following papers if you found this code useful in your research:
@article{karamanis2025persistent,
title={Persistent Sampling: Enhancing the Efficiency of Sequential Monte Carlo},
author={Karamanis, Minas and Seljak, Uro{\v{s}}},
journal={Statistics and Computing},
volume={35},
number={5},
pages={1--22},
year={2025},
publisher={Springer}
}
Licence
Copyright 2026-Present Minas Karamanis and contributors.
Tempest is free software made available under the MIT License. For details see the LICENCE file.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tempest_sampler-0.1.4.tar.gz.
File metadata
- Download URL: tempest_sampler-0.1.4.tar.gz
- Upload date:
- Size: 62.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c80fc1384f6133bcc6b35959046d593d4ff6ef954f6d340653953149aee8c5ce
|
|
| MD5 |
c756c309e518de01c79babd664517d6b
|
|
| BLAKE2b-256 |
e517e2cb8c42819c89c5d9252c7065d67bfd5bfddc2a893b1614a1440200890d
|
Provenance
The following attestation bundles were made for tempest_sampler-0.1.4.tar.gz:
Publisher:
pypi-deploy.yml on minaskar/tempest
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tempest_sampler-0.1.4.tar.gz -
Subject digest:
c80fc1384f6133bcc6b35959046d593d4ff6ef954f6d340653953149aee8c5ce - Sigstore transparency entry: 850232231
- Sigstore integration time:
-
Permalink:
minaskar/tempest@2dded75ac22e6ade52b9f76b0b65752b8b9683fb -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/minaskar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-deploy.yml@2dded75ac22e6ade52b9f76b0b65752b8b9683fb -
Trigger Event:
release
-
Statement type:
File details
Details for the file tempest_sampler-0.1.4-py3-none-any.whl.
File metadata
- Download URL: tempest_sampler-0.1.4-py3-none-any.whl
- Upload date:
- Size: 43.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6369a2a59582525a3df808acfe529f1458899e577dbf17fdeb7b08a652055f36
|
|
| MD5 |
8cd54bedb51d02a0f2736579a540999e
|
|
| BLAKE2b-256 |
2251321e7b4f2ed172cb277c788c490743bce6f54859a0d4f7bbc9730952ba6b
|
Provenance
The following attestation bundles were made for tempest_sampler-0.1.4-py3-none-any.whl:
Publisher:
pypi-deploy.yml on minaskar/tempest
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tempest_sampler-0.1.4-py3-none-any.whl -
Subject digest:
6369a2a59582525a3df808acfe529f1458899e577dbf17fdeb7b08a652055f36 - Sigstore transparency entry: 850232233
- Sigstore integration time:
-
Permalink:
minaskar/tempest@2dded75ac22e6ade52b9f76b0b65752b8b9683fb -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/minaskar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-deploy.yml@2dded75ac22e6ade52b9f76b0b65752b8b9683fb -
Trigger Event:
release
-
Statement type: