Skip to main content

Adaptive-MCMC

Adaptive Markov Chain Monte Carlo (MCMC) algorithms

Install

pip install adaptive-mcmc

Examples

import numpy as np
from adaptive_mcmc.mala import ESJDMALA
from scipy.stats import multivariate_normal

dim = 20
cov = 0.5 * np.eye(dim) + 0.5
inv_cov = np.linalg.inv(cov)


def logp(x):
    return multivariate_normal.logpdf(x, mean=np.zeros(dim), cov=cov)


def grad_logp(x):
    return -inv_cov @ x


mala = ESJDMALA(logp, grad_logp, initial_sample=np.zeros(dim), eps0=0.5)
samples, acc, eps_hist, esjd_hist = mala.run(20_000)
print(f"Acceptance: {acc:.3f}, Final epsilon = {eps_hist[-1]:.4f}")

pmala = PrecondESJDMALA(logp, grad_logp, initial_sample=np.zeros(dim), initial_covariance=np.eye(dim), eps0=0.5)
samples, acc, eps_hist, esjd_hist = pmala.run(20_000)
print(f"Acceptance: {acc:.3f}, Final epsilon = {eps_hist[-1]:.4f}")

Metadata

Release files for Adaptive-MCMC 0.1.3

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

Source distribution (sdist)

Source distribution for Adaptive-MCMC 0.1.3
File Size Uploaded Provenance Actions
adaptive_mcmc-0.1.3.tar.gz 6.2 kB Without provenance Details for adaptive_mcmc-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for Adaptive-MCMC 0.1.3
File Interpreter ABI Platform Actions
adaptive_mcmc-0.1.3-py3-none-any.whl Python 3 none any Details for adaptive_mcmc-0.1.3-py3-none-any.whl

Total release size: 11.0 kB

Release files / adaptive_mcmc-0.1.3.tar.gz

Download URL adaptive_mcmc-0.1.3.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b022fd8e83e4b812368c135673abc1ab0d98b844ffcb32309772eb744c19d34f
BLAKE2b-256 checksum
How to use checksums
682ab812393917a483c2b8e23dffa1219869edb5377dba321e3ba45b5decd52a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.3

Release files / adaptive_mcmc-0.1.3-py3-none-any.whl

Download URL adaptive_mcmc-0.1.3-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e0a040710aa59825d124663ed9ab010b7a9fe9c07e50f3c5e704728feaa71254
BLAKE2b-256 checksum
How to use checksums
9a5d27e20170c6bce08b935ad3acd6f79c2f655defaed5811adda7eed6953abd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.3

Security for Adaptive-MCMC 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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