Name | mici JSON |
Version |
0.2.1
JSON |
| download |
home_page | |
Summary | MCMC samplers based on simulating Hamiltonian dynamics on a manifold. |
upload_time | 2023-08-11 14:22:07 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.9 |
license | |
keywords |
inference
sampling
mcmc
hmc
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<img src='https://raw.githubusercontent.com/matt-graham/mici/main/images/mici-logo-rectangular.svg' width='400px'/>
<p class='badges'>
<a href="https://badge.fury.io/py/mici">
<img src="https://badge.fury.io/py/mici.svg" alt="PyPI version"/>
</a>
<a href="https://matt-graham.github.io/mici">
<img src="https://img.shields.io/badge/API_docs-grey.svg"
alt="API documentation"/>
</a>
<a href="https://zenodo.org/badge/latestdoi/52494384">
<img src="https://zenodo.org/badge/52494384.svg" alt="DOI"/>
</a>
<a href="https://github.com/matt-graham/mici/actions/workflows/tests.yml">
<img src="https://github.com/matt-graham/mici/actions/workflows/tests.yml/badge.svg" alt="Test status" />
</a>
</p>
**Mici** is a Python package providing implementations of *Markov chain Monte
Carlo* (MCMC) methods for approximate inference in probabilistic models, with a
particular focus on MCMC methods based on simulating Hamiltonian dynamics on a
manifold.
## Features
Key features include
* a modular design allowing use of a wide range of inference algorithms by
mixing and matching different components, and making it easy to
extend the package,
* a pure Python code base with minimal dependencies,
allowing easy integration within other code,
* implementations of MCMC methods for sampling from distributions on embedded
manifolds implicitly-defined by a constraint equation and distributions on
Riemannian manifolds with a user-specified metric,
* computationally efficient inference via transparent caching of the results
of expensive operations and intermediate results calculated in derivative
computations allowing later reuse without recalculation,
* memory efficient inference for large models by memory-mapping chains to
disk, allowing long runs on large models without hitting memory issues.
## Installation
To install and use Mici the minimal requirements are a Python 3.9+ environment
with [NumPy](http://www.numpy.org/) and [SciPy](https://www.scipy.org)
installed. The latest Mici release on PyPI (and its dependencies) can be
installed in the current Python environment by running
```sh
pip install mici
```
To instead install the latest development version from the `main` branch on Github run
```sh
pip install git+https://github.com/matt-graham/mici
```
If available in the installed Python environment the following additional
packages provide extra functionality and features
* [Autograd](https://github.com/HIPS/autograd): if available Autograd will
be used to automatically compute the required derivatives of the model
functions (providing they are specified using functions from the
`autograd.numpy` and `autograd.scipy` interfaces). To sample chains in
parallel using `autograd` functions you also need to install
[multiprocess](https://github.com/uqfoundation/multiprocess). This will
cause `multiprocess.Pool` to be used in preference to the in-built
`mutiprocessing.Pool` for parallelisation as multiprocess supports
serialisation (via [dill](https://github.com/uqfoundation/dill)) of a much
wider range of types, including of Autograd generated functions. Both
Autograd and multiprocess can be installed alongside Mici by running `pip
install mici[autodiff]`.
* [ArviZ](https://python.arviz.org/en/latest/index.html): if ArviZ is
available the traces (dictionary) output of a sampling run can be directly
converted to an `arviz.InferenceData` container object using
`arviz.convert_to_inference_data` or implicitly converted by passing the
traces dictionary as the `data` argument
[to ArviZ API functions](https://python.arviz.org/en/latest/api/index.html),
allowing straightforward use of the ArviZ's extensive visualisation and
diagnostic functions.
## Why Mici?
Mici is named for [Augusta 'Mici'
Teller](https://en.wikipedia.org/wiki/Augusta_H._Teller), who along with
[Arianna Rosenbluth](https://en.wikipedia.org/wiki/Arianna_W._Rosenbluth)
developed the code for the [MANIAC I](https://en.wikipedia.org/wiki/MANIAC_I)
computer used in the seminal paper [*Equations of State Calculations by Fast
Computing Machines*](https://doi.org/10.1063%2F1.1699114) which introduced the
first example of a Markov chain Monte Carlo method.
## Related projects
Other Python packages for performing MCMC inference include
[PyMC](https://github.com/pymc-devs/pymc),
[PyStan](https://github.com/stan-dev/pystan) (the Python interface to
[Stan](http://mc-stan.org/)), [Pyro](https://github.com/pyro-ppl/pyro) /
[NumPyro](https://github.com/pyro-ppl/numpyro), [TensorFlow
Probability](https://github.com/tensorflow/probability),
[emcee](https://github.com/dfm/emcee),
[Sampyl](https://github.com/mcleonard/sampyl) and
[BlackJAX](https://github.com/blackjax-devs/blackjax).
Unlike PyMC, PyStan, (Num)Pyro and TensorFlow Probability which are complete
probabilistic programming frameworks including functionality for definining a
probabilistic model / program, but like emcee, Sampyl and BlackJAX, Mici is solely
focussed on providing implementations of inference algorithms, with the user
expected to be able to define at a minimum a function specifying the negative
log (unnormalized) density of the distribution of interest.
Further while PyStan, (Num)Pyro and TensorFlow Probability all push the
sampling loop into external compiled non-Python code, in Mici the sampling loop
is run directly within Python. This has the consequence that for small models
in which the negative log density of the target distribution and other model
functions are cheap to evaluate, the interpreter overhead in iterating over the
chains in Python can dominate the computational cost, making sampling much
slower than packages which outsource the sampling loop to a efficient compiled
implementation.
## Overview of package
API documentation for the package is available
[here](https://matt-graham.github.io/mici/). The three main user-facing
modules within the `mici` package are the `systems`, `integrators` and
`samplers` modules and you will generally need to create an instance of one
class from each module.
[`mici.systems`](https://matt-graham.github.io/mici/mici.systems.html) -
Hamiltonian systems encapsulating model functions and their derivatives
* `EuclideanMetricSystem` - systems with a metric on the position space with
a constant matrix representation,
* `GaussianEuclideanMetricSystem` - systems in which the target distribution
is defined by a density with respect to the standard Gaussian measure on
the position space allowing analytically solving for flow corresponding to
the quadratic components of Hamiltonian
([Shahbaba et al., 2014](#shababa2014split)),
* `RiemannianMetricSystem` - systems with a metric on the position space
with a position-dependent matrix representation
([Girolami and Calderhead, 2011](#girolami2011riemann)),
* `SoftAbsRiemannianMetricSystem` - system with *SoftAbs*
eigenvalue-regularized Hessian of negative log target density as metric
matrix representation ([Betancourt, 2013](#betancourt2013general)),
* `DenseConstrainedEuclideanMetricSystem` - Euclidean-metric system subject
to holonomic constraints
([Hartmann and Schütte, 2005](#hartmann2005constrained);
[Brubaker, Salzmann and Urtasun, 2012](#brubaker2012family);
[Lelièvre, Rousset and Stoltz, 2019](#lelievre2019hybrid))
with a dense constraint function Jacobian matrix,
[`mici.integrators`](https://matt-graham.github.io/mici/mici.integrators.html) -
symplectic integrators for Hamiltonian dynamics
* `LeapfrogIntegrator` - explicit leapfrog (Störmer-Verlet) integrator for
separable Hamiltonian systems
([Leimkulher and Reich, 2004](#leimkuhler2004simulating)),
* `ImplicitLeapfrogIntegrator` - implicit (or generalized) leapfrog
integrator for Hamiltonian systems with non-separable component
([Leimkulher and Reich, 2004](#leimkuhler2004simulating)),
* `ImplicitMidpointIntegrator` - implicit midpoint
integrator for general Hamiltonian systems
([Leimkulher and Reich, 2004](#leimkuhler2004simulating)),
* `SymmetricCompositionIntegrator` - family of symplectic integrators for Hamiltonians
that can be split in to components with tractable flow maps, with specific
two-, three- and four-stage instantations due to [Blanes, Casas and Sanz-Serna (2014)](#blanes2014numerical),
* `ConstrainedLeapfrogIntegrator` - constrained leapfrog integrator for
Hamiltonian systems subject to holonomic constraints
([Andersen, 1983](#andersen1983rattle);
[Leimkuhler and Reich, 1994](#leimkuhler1994symplectic)).
[`mici.samplers`](https://matt-graham.github.io/mici/mici.samplers.html) - MCMC
samplers for peforming inference
* `StaticMetropolisHMC` - static integration time Hamiltonian Monte Carlo
with Metropolis accept step ([Duane et al., 1987](duane1987hybrid)),
* `RandomMetropolisHMC` - random integration time Hamiltonian Monte Carlo
with Metropolis accept step ([Mackenzie, 1989](#mackenzie1989improved)),
* `DynamicSliceHMC` - dynamic integration time Hamiltonian Monte Carlo
with slice sampling from trajectory, equivalent to the original 'NUTS' algorithm
([Hoffman and Gelman, 2014](#hoffman2014nouturn)).
* `DynamicMultinomialHMC` - dynamic integration time Hamiltonian Monte Carlo
with multinomial sampling from trajectory, equivalent to the current default
MCMC algorithm in [Stan](https://mc-stan.org/)
([Hoffman and Gelman, 2014](#hoffman2014nouturn);
[Betancourt, 2017](#betancourt2017conceptual)).
## Notebooks
The manifold MCMC methods implemented in Mici have been used in several research projects. Below links are provided to a selection of Jupyter notebooks associated with these projects as demonstrations of how to use Mici and to illustrate some of the settings in which manifold MCMC methods can be computationally advantageous.
<table>
<tr>
<th colspan="2"><a href="https://github.com/thiery-lab/manifold_lifting">Manifold lifting: MCMC in the vanishing noise regime</a></th>
</tr>
<tr>
<td>Open non-interactive version with nbviewer</td>
<td>
<a href="https://nbviewer.jupyter.org/github/thiery-lab/manifold_lifting/blob/main/notebooks/Two-dimensional_example.ipynb">
<img src="https://raw.githubusercontent.com/jupyter/design/main/logos/Badges/nbviewer_badge.svg?sanitize=true" width="109" alt="Render with nbviewer" style="vertical-align:text-bottom" />
</a>
</td>
</tr>
<tr>
<td>Open interactive version with Binder</td>
<td>
<a href="https://mybinder.org/v2/gh/thiery-lab/manifold_lifting/main?filepath=notebooks%2FTwo-dimensional_example.ipynb">
<img src="https://mybinder.org/badge_logo.svg" alt="Launch with Binder" style="vertical-align:text-bottom"/>
</a>
</td>
</tr>
<tr>
<td>Open interactive version with Google Colab</td>
<td>
<a href="https://colab.research.google.com/github/thiery-lab/manifold_lifting/blob/main/notebooks/Two-dimensional_example.ipynb">
<img alt="Open in Colab" src="https://colab.research.google.com/assets/colab-badge.svg" style="vertical-align:text-bottom">
</a>
</td>
</tr>
</table>
<table>
<tr>
<th colspan="2"><a href="https://github.com/thiery-lab/manifold-mcmc-for-diffusions">Manifold MCMC methods for inference in diffusion models</a></th>
</tr>
<tr>
<td>Open non-interactive version with nbviewer</td>
<td>
<a href="https://nbviewer.jupyter.org/github/thiery-lab/manifold-mcmc-for-diffusions/blob/main/FitzHugh-Nagumo_example.ipynb">
<img src="https://raw.githubusercontent.com/jupyter/design/main/logos/Badges/nbviewer_badge.svg?sanitize=true" width="109" alt="Render with nbviewer" style="vertical-align:text-bottom" />
</a>
</td>
</tr>
<tr>
<td>Open interactive version with Binder</td>
<td>
<a href="https://mybinder.org/v2/gh/thiery-lab/manifold-mcmc-for-diffusions/main?filepath=FitzHugh-Nagumo_example.ipynb">
<img src="https://mybinder.org/badge_logo.svg" alt="Launch with Binder" style="vertical-align:text-bottom"/>
</a>
</td>
</tr>
<tr>
<td>Open interactive version with Google Colab</td>
<td>
<a href="https://colab.research.google.com/github/thiery-lab/manifold-mcmc-for-diffusions/blob/main/FitzHugh-Nagumo_example.ipynb">
<img alt="Open in Colab" src="https://colab.research.google.com/assets/colab-badge.svg" style="vertical-align:text-bottom">
</a>
</td>
</tr>
</table>
## Example: sampling on a torus
<img src='https://raw.githubusercontent.com/matt-graham/mici/main/images/torus-samples.gif' width='360px'/>
A simple complete example of using the package to compute approximate samples
from a distribution on a two-dimensional torus embedded in a three-dimensional
space is given below. The computed samples are visualized in the animation
above. Here we use `autograd` to automatically construct functions to calculate
the required derivatives (gradient of negative log density of target
distribution and Jacobian of constraint function), sample four chains in
parallel using `multiprocess`, use `arviz` to calculate diagnostics and use
`matplotlib` to plot the samples.
> ⚠️ **If you do not have [`multiprocess`](https://github.com/uqfoundation/multiprocess) installed the example code below will hang or raise an error when sampling the chains as the inbuilt `multiprocessing` module does not support pickling Autograd functions.**
```Python
from mici import systems, integrators, samplers
import autograd.numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.animation as animation
import arviz
# Define fixed model parameters
R = 1.0 # toroidal radius ∈ (0, ∞)
r = 0.5 # poloidal radius ∈ (0, R)
α = 0.9 # density fluctuation amplitude ∈ [0, 1)
# Define constraint function such that the set {q : constr(q) == 0} is a torus
def constr(q):
x, y, z = q.T
return np.stack([((x**2 + y**2)**0.5 - R)**2 + z**2 - r**2], -1)
# Define negative log density for the target distribution on torus
# (with respect to 2D 'area' measure for torus)
def neg_log_dens(q):
x, y, z = q.T
θ = np.arctan2(y, x)
ϕ = np.arctan2(z, x / np.cos(θ) - R)
return np.log1p(r * np.cos(ϕ) / R) - np.log1p(np.sin(4*θ) * np.cos(ϕ) * α)
# Specify constrained Hamiltonian system with default identity metric
system = systems.DenseConstrainedEuclideanMetricSystem(neg_log_dens, constr)
# System is constrained therefore use constrained leapfrog integrator
integrator = integrators.ConstrainedLeapfrogIntegrator(system)
# Seed a random number generator
rng = np.random.default_rng(seed=1234)
# Use dynamic integration-time HMC implementation as MCMC sampler
sampler = samplers.DynamicMultinomialHMC(system, integrator, rng)
# Sample initial positions on torus using parameterisation (θ, ϕ) ∈ [0, 2π)²
# x, y, z = (R + r * cos(ϕ)) * cos(θ), (R + r * cos(ϕ)) * sin(θ), r * sin(ϕ)
n_chain = 4
θ_init, ϕ_init = rng.uniform(0, 2 * np.pi, size=(2, n_chain))
q_init = np.stack([
(R + r * np.cos(ϕ_init)) * np.cos(θ_init),
(R + r * np.cos(ϕ_init)) * np.sin(θ_init),
r * np.sin(ϕ_init)], -1)
# Define function to extract variables to trace during sampling
def trace_func(state):
x, y, z = state.pos
return {'x': x, 'y': y, 'z': z}
# Sample 4 chains in parallel with 500 adaptive warm up iterations in which the
# integrator step size is tuned, followed by 2000 non-adaptive iterations
final_states, traces, stats = sampler.sample_chains(
n_warm_up_iter=500,
n_main_iter=2000,
init_states=q_init,
n_process=4,
trace_funcs=[trace_func]
)
# Print average accept probability and number of integrator steps per chain
for c in range(n_chain):
print(f"Chain {c}:")
print(f" Average accept prob. = {stats['accept_stat'][c].mean():.2f}")
print(f" Average number steps = {stats['n_step'][c].mean():.1f}")
# Print summary statistics and diagnostics computed using ArviZ
print(arviz.summary(traces))
# Visualize concatentated chain samples as animated 3D scatter plot
fig = plt.figure(figsize=(4, 4))
ax = Axes3D(fig, [0., 0., 1., 1.], proj_type='ortho')
points_3d, = ax.plot(*(np.concatenate(traces[k]) for k in 'xyz'), '.', ms=0.5)
ax.axis('off')
for set_lim in [ax.set_xlim, ax.set_ylim, ax.set_zlim]:
set_lim((-1, 1))
def update(i):
angle = 45 * (np.sin(2 * np.pi * i / 60) + 1)
ax.view_init(elev=angle, azim=angle)
return (points_3d,)
anim = animation.FuncAnimation(fig, update, frames=60, interval=100, blit=True)
```
## References
1. <a id='andersen1983rattle'></a> Andersen, H.C., 1983. RATTLE: A “velocity”
version of the SHAKE algorithm for molecular dynamics calculations.
*Journal of Computational Physics*, 52(1), pp.24-34.
[![DOI:10.1016/0021-9991(83)90014-1](https://zenodo.org/badge/DOI/10.1016/0021-9991(83)90014-1.svg)](https://doi.org/10.1016/0021-9991(83)90014-1)
2. <a id='duane1987hybrid'></a> Duane, S., Kennedy, A.D., Pendleton, B.J. and
Roweth, D., 1987. Hybrid Monte Carlo. *Physics letters B*, 195(2),
pp.216-222.
[![DOI:10.1016/0370-2693(87)91197-X](https://zenodo.org/badge/DOI/10.1016/0370-2693(87)91197-X.svg)](https://doi.org/10.1016/0370-2693(87)91197-X)
3. <a id='mackenzie1989improved'></a> Mackenzie, P.B., 1989. An improved
hybrid Monte Carlo method. *Physics Letters B*, 226(3-4), pp.369-371.
[![DOI:10.1016/0370-2693(89)91212-4](https://zenodo.org/badge/DOI/10.1016/0370-2693(89)91212-4.svg)](https://doi.org/10.1016/0370-2693(89)91212-4)
4. <a id='horowitz1991generalized'></a> Horowitz, A.M., 1991. A generalized
guided Monte Carlo algorithm. *Physics Letters B*, 268(CERN-TH-6172-91),
pp.247-252.
[![DOI:10.1016/0370-2693(91)90812-5](https://zenodo.org/badge/DOI/10.1016/0370-2693(91)90812-5.svg)](https://doi.org/10.1016/0370-2693(91)90812-5)
5. <a id='leimkuhler1994symplectic'></a> Leimkuhler, B. and Reich, S., 1994.
Symplectic integration of constrained Hamiltonian systems. *Mathematics of
Computation*, 63(208), pp.589-605.
[![DOI:10.2307/2153284](https://zenodo.org/badge/DOI/10.2307/2153284.svg)](https://doi.org/10.2307/2153284)
6. <a id='leimkuhler2004simulating'></a> Leimkuhler, B. and Reich, S., 2004.
Simulating Hamiltonian dynamics (Vol. 14). *Cambridge University Press*.
[![DOI:10.1017/CBO9780511614118](https://zenodo.org/badge/DOI/10.1017/CBO9780511614118.svg)](https://doi.org/10.1017/CBO9780511614118)
7. <a id='hartmann2005constrained'></a> Hartmann, C. and Schütte, C., 2005. A
constrained hybrid Monte‐Carlo algorithm and the problem of calculating the
free energy in several variables. *ZAMM ‐ Journal of Applied Mathematics and
Mechanics*, 85(10), pp.700-710.
[![DOI:10.1002/zamm.200410218](https://zenodo.org/badge/DOI/10.1002/zamm.200410218.svg)](https://doi.org/10.1002/zamm.200410218)
8. <a id='girolami2011riemann'></a> Girolami, M. and Calderhead, B., 2011.
Riemann manifold Langevin and Hamiltonian Monte Carlo methods. *Journal of
the Royal Statistical Society: Series B (Statistical Methodology)*, 73(2), pp.123-214.
[![DOI:10.1111/j.1467-9868.2010.00765.x](https://zenodo.org/badge/DOI/10.1111/j.1467-9868.2010.00765.x.svg)](https://doi.org/10.1111/j.1467-9868.2010.00765.x)
9. <a id='brubaker2012family'></a> Brubaker, M., Salzmann, M. and
Urtasun, R., 2012. A family of MCMC methods on implicitly defined
manifolds. In *Artificial intelligence and statistics* (pp. 161-172).
[![CiteSeerX:10.1.1.417.6111](http://img.shields.io/badge/CiteSeerX-10.1.1.417.6111-blue.svg)](https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.417.6111)
10. <a id='betancourt2013general'></a> Betancourt, M., 2013. A general metric
for Riemannian manifold Hamiltonian Monte Carlo. In *Geometric science of
information* (pp. 327-334).
[![DOI:10.1007/978-3-642-40020-9_35](https://zenodo.org/badge/DOI/10.1007/978-3-642-40020-9_35.svg)](https://doi.org/10.1007/978-3-642-40020-9_35)
[![arXiv:1212.4693](http://img.shields.io/badge/arXiv-1212.4693-B31B1B.svg)](https://arxiv.org/abs/1212.4693)
11. <a id='hoffman2014nouturn'></a> Hoffman, M.D. and Gelman, A., 2014. The
No-U-turn sampler: adaptively setting path lengths in Hamiltonian Monte
Carlo. *Journal of Machine Learning Research*, 15(1), pp.1593-1623.
[![CiteSeerX:10.1.1.220.8395](http://img.shields.io/badge/CiteSeerX-10.1.1.220.8395-blue.svg)](https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.220.8395)
[![arXiv:1111.4246](http://img.shields.io/badge/arXiv-1111.4246-B31B1B.svg)](https://arxiv.org/abs/1111.4246)
12. <a id='shababa2014split'></a> Shahbaba, B., Lan, S., Johnson, W.O. and
Neal, R.M., 2014. Split Hamiltonian Monte Carlo. *Statistics and
Computing*, 24(3), pp.339-349.
[![DOI:10.1007/s11222-012-9373-1](https://zenodo.org/badge/DOI/10.1007/s11222-012-9373-1.svg)](https://doi.org/10.1007/s11222-012-9373-1)
[![arXiv:1106.5941](http://img.shields.io/badge/arXiv-1106.5941-B31B1B.svg)](https://arxiv.org/abs/1106.5941)
13. <a id='blanes2014numerical'></a> Blanes, S., Casas, F., & Sanz-Serna, J. M., 2014.
Numerical integrators for the Hybrid Monte Carlo method.
*SIAM Journal on Scientific Computing*, 36(4), A1556-A1580.
[![DOI:10.1137/130932740](https://zenodo.org/badge/DOI/10.1137/130932740.svg)](https://doi.org/10.1137/130932740)
[![arXiv:1405.3153](http://img.shields.io/badge/arXiv-1405.3153-B31B1B.svg)](https://arxiv.org/abs/1405.3153)
14. <a id='betancourt2017conceptual'></a> Betancourt, M., 2017. A conceptual
introduction to Hamiltonian Monte Carlo.
[![arXiv:1701.02434](http://img.shields.io/badge/arXiv-1701.02434-B31B1B.svg)](https://arxiv.org/abs/1701.02434)
15. <a id='lelievre2019hybrid'></a> Lelièvre, T., Rousset, M. and Stoltz, G.,
2019. Hybrid Monte Carlo methods for sampling probability measures on
submanifolds. In *Numerische Mathematik*, 143(2), (pp.379-421).
[![DOI:10.1007/s00211-019-01056-4](https://zenodo.org/badge/DOI/10.1007/s00211-019-01056-4.svg)](https://doi.org/10.1007/s00211-019-01056-4)
[![arXiv:1807.02356](http://img.shields.io/badge/arXiv-1807.02356-B31B1B.svg)](https://arxiv.org/abs/1807.02356)
Raw data
{
"_id": null,
"home_page": "",
"name": "mici",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": "",
"keywords": "inference,sampling,MCMC,HMC",
"author": "",
"author_email": "Matt Graham <m.graham@ucl.ac.uk>",
"download_url": "https://files.pythonhosted.org/packages/ea/0b/d1481e7b61d683ed3ef1e9ecab734f35b46f9520efaa0759c270a228e689/mici-0.2.1.tar.gz",
"platform": null,
"description": "<img src='https://raw.githubusercontent.com/matt-graham/mici/main/images/mici-logo-rectangular.svg' width='400px'/>\n\n<p class='badges'>\n <a href=\"https://badge.fury.io/py/mici\">\n <img src=\"https://badge.fury.io/py/mici.svg\" alt=\"PyPI version\"/>\n </a>\n <a href=\"https://matt-graham.github.io/mici\">\n <img src=\"https://img.shields.io/badge/API_docs-grey.svg\"\n alt=\"API documentation\"/>\n </a>\n <a href=\"https://zenodo.org/badge/latestdoi/52494384\">\n <img src=\"https://zenodo.org/badge/52494384.svg\" alt=\"DOI\"/>\n </a>\n <a href=\"https://github.com/matt-graham/mici/actions/workflows/tests.yml\">\n <img src=\"https://github.com/matt-graham/mici/actions/workflows/tests.yml/badge.svg\" alt=\"Test status\" />\n </a>\n</p>\n\n**Mici** is a Python package providing implementations of *Markov chain Monte\nCarlo* (MCMC) methods for approximate inference in probabilistic models, with a\nparticular focus on MCMC methods based on simulating Hamiltonian dynamics on a\nmanifold.\n\n## Features\n\nKey features include\n\n * a modular design allowing use of a wide range of inference algorithms by\n mixing and matching different components, and making it easy to\n extend the package,\n * a pure Python code base with minimal dependencies,\n allowing easy integration within other code,\n * implementations of MCMC methods for sampling from distributions on embedded\n manifolds implicitly-defined by a constraint equation and distributions on\n Riemannian manifolds with a user-specified metric,\n * computationally efficient inference via transparent caching of the results\n of expensive operations and intermediate results calculated in derivative\n computations allowing later reuse without recalculation,\n * memory efficient inference for large models by memory-mapping chains to\n disk, allowing long runs on large models without hitting memory issues.\n\n## Installation\n\nTo install and use Mici the minimal requirements are a Python 3.9+ environment\nwith [NumPy](http://www.numpy.org/) and [SciPy](https://www.scipy.org)\ninstalled. The latest Mici release on PyPI (and its dependencies) can be\ninstalled in the current Python environment by running\n\n```sh\npip install mici\n```\n\nTo instead install the latest development version from the `main` branch on Github run\n\n```sh\npip install git+https://github.com/matt-graham/mici\n```\n\nIf available in the installed Python environment the following additional\npackages provide extra functionality and features\n\n * [Autograd](https://github.com/HIPS/autograd): if available Autograd will\n be used to automatically compute the required derivatives of the model\n functions (providing they are specified using functions from the\n `autograd.numpy` and `autograd.scipy` interfaces). To sample chains in\n parallel using `autograd` functions you also need to install\n [multiprocess](https://github.com/uqfoundation/multiprocess). This will\n cause `multiprocess.Pool` to be used in preference to the in-built\n `mutiprocessing.Pool` for parallelisation as multiprocess supports\n serialisation (via [dill](https://github.com/uqfoundation/dill)) of a much\n wider range of types, including of Autograd generated functions. Both\n Autograd and multiprocess can be installed alongside Mici by running `pip\n install mici[autodiff]`.\n * [ArviZ](https://python.arviz.org/en/latest/index.html): if ArviZ is\n available the traces (dictionary) output of a sampling run can be directly\n converted to an `arviz.InferenceData` container object using\n `arviz.convert_to_inference_data` or implicitly converted by passing the\n traces dictionary as the `data` argument\n [to ArviZ API functions](https://python.arviz.org/en/latest/api/index.html),\n allowing straightforward use of the ArviZ's extensive visualisation and\n diagnostic functions.\n\n## Why Mici?\n\nMici is named for [Augusta 'Mici'\nTeller](https://en.wikipedia.org/wiki/Augusta_H._Teller), who along with\n[Arianna Rosenbluth](https://en.wikipedia.org/wiki/Arianna_W._Rosenbluth)\ndeveloped the code for the [MANIAC I](https://en.wikipedia.org/wiki/MANIAC_I)\ncomputer used in the seminal paper [*Equations of State Calculations by Fast\nComputing Machines*](https://doi.org/10.1063%2F1.1699114) which introduced the\nfirst example of a Markov chain Monte Carlo method.\n\n## Related projects\n\nOther Python packages for performing MCMC inference include\n[PyMC](https://github.com/pymc-devs/pymc),\n[PyStan](https://github.com/stan-dev/pystan) (the Python interface to\n[Stan](http://mc-stan.org/)), [Pyro](https://github.com/pyro-ppl/pyro) /\n[NumPyro](https://github.com/pyro-ppl/numpyro), [TensorFlow\nProbability](https://github.com/tensorflow/probability),\n[emcee](https://github.com/dfm/emcee),\n[Sampyl](https://github.com/mcleonard/sampyl) and\n[BlackJAX](https://github.com/blackjax-devs/blackjax).\n\nUnlike PyMC, PyStan, (Num)Pyro and TensorFlow Probability which are complete\nprobabilistic programming frameworks including functionality for definining a\nprobabilistic model / program, but like emcee, Sampyl and BlackJAX, Mici is solely\nfocussed on providing implementations of inference algorithms, with the user\nexpected to be able to define at a minimum a function specifying the negative\nlog (unnormalized) density of the distribution of interest.\n\nFurther while PyStan, (Num)Pyro and TensorFlow Probability all push the\nsampling loop into external compiled non-Python code, in Mici the sampling loop\nis run directly within Python. This has the consequence that for small models\nin which the negative log density of the target distribution and other model\nfunctions are cheap to evaluate, the interpreter overhead in iterating over the\nchains in Python can dominate the computational cost, making sampling much\nslower than packages which outsource the sampling loop to a efficient compiled\nimplementation.\n\n ## Overview of package\n\nAPI documentation for the package is available\n[here](https://matt-graham.github.io/mici/). The three main user-facing\nmodules within the `mici` package are the `systems`, `integrators` and\n`samplers` modules and you will generally need to create an instance of one\nclass from each module.\n\n [`mici.systems`](https://matt-graham.github.io/mici/mici.systems.html) -\n Hamiltonian systems encapsulating model functions and their derivatives\n\n * `EuclideanMetricSystem` - systems with a metric on the position space with\n a constant matrix representation,\n * `GaussianEuclideanMetricSystem` - systems in which the target distribution\n is defined by a density with respect to the standard Gaussian measure on\n the position space allowing analytically solving for flow corresponding to\n the quadratic components of Hamiltonian\n ([Shahbaba et al., 2014](#shababa2014split)),\n * `RiemannianMetricSystem` - systems with a metric on the position space\n with a position-dependent matrix representation\n ([Girolami and Calderhead, 2011](#girolami2011riemann)),\n * `SoftAbsRiemannianMetricSystem` - system with *SoftAbs*\n eigenvalue-regularized Hessian of negative log target density as metric\n matrix representation ([Betancourt, 2013](#betancourt2013general)),\n * `DenseConstrainedEuclideanMetricSystem` - Euclidean-metric system subject\n to holonomic constraints\n ([Hartmann and Sch\u00fctte, 2005](#hartmann2005constrained);\n [Brubaker, Salzmann and Urtasun, 2012](#brubaker2012family);\n [Leli\u00e8vre, Rousset and Stoltz, 2019](#lelievre2019hybrid))\n with a dense constraint function Jacobian matrix,\n\n[`mici.integrators`](https://matt-graham.github.io/mici/mici.integrators.html) -\nsymplectic integrators for Hamiltonian dynamics\n\n * `LeapfrogIntegrator` - explicit leapfrog (St\u00f6rmer-Verlet) integrator for\n separable Hamiltonian systems\n ([Leimkulher and Reich, 2004](#leimkuhler2004simulating)),\n * `ImplicitLeapfrogIntegrator` - implicit (or generalized) leapfrog\n integrator for Hamiltonian systems with non-separable component\n ([Leimkulher and Reich, 2004](#leimkuhler2004simulating)),\n * `ImplicitMidpointIntegrator` - implicit midpoint\n integrator for general Hamiltonian systems\n ([Leimkulher and Reich, 2004](#leimkuhler2004simulating)),\n * `SymmetricCompositionIntegrator` - family of symplectic integrators for Hamiltonians\n that can be split in to components with tractable flow maps, with specific\n two-, three- and four-stage instantations due to [Blanes, Casas and Sanz-Serna (2014)](#blanes2014numerical),\n * `ConstrainedLeapfrogIntegrator` - constrained leapfrog integrator for\n Hamiltonian systems subject to holonomic constraints\n ([Andersen, 1983](#andersen1983rattle);\n [Leimkuhler and Reich, 1994](#leimkuhler1994symplectic)).\n\n[`mici.samplers`](https://matt-graham.github.io/mici/mici.samplers.html) - MCMC\nsamplers for peforming inference\n\n * `StaticMetropolisHMC` - static integration time Hamiltonian Monte Carlo\n with Metropolis accept step ([Duane et al., 1987](duane1987hybrid)),\n * `RandomMetropolisHMC` - random integration time Hamiltonian Monte Carlo\n with Metropolis accept step ([Mackenzie, 1989](#mackenzie1989improved)),\n * `DynamicSliceHMC` - dynamic integration time Hamiltonian Monte Carlo\n with slice sampling from trajectory, equivalent to the original 'NUTS' algorithm\n ([Hoffman and Gelman, 2014](#hoffman2014nouturn)).\n * `DynamicMultinomialHMC` - dynamic integration time Hamiltonian Monte Carlo\n with multinomial sampling from trajectory, equivalent to the current default\n MCMC algorithm in [Stan](https://mc-stan.org/)\n ([Hoffman and Gelman, 2014](#hoffman2014nouturn);\n [Betancourt, 2017](#betancourt2017conceptual)).\n\n## Notebooks\n\nThe manifold MCMC methods implemented in Mici have been used in several research projects. Below links are provided to a selection of Jupyter notebooks associated with these projects as demonstrations of how to use Mici and to illustrate some of the settings in which manifold MCMC methods can be computationally advantageous.\n\n<table>\n <tr>\n <th colspan=\"2\"><a href=\"https://github.com/thiery-lab/manifold_lifting\">Manifold lifting: MCMC in the vanishing noise regime</a></th>\n </tr>\n <tr>\n <td>Open non-interactive version with nbviewer</td>\n <td>\n <a href=\"https://nbviewer.jupyter.org/github/thiery-lab/manifold_lifting/blob/main/notebooks/Two-dimensional_example.ipynb\">\n <img src=\"https://raw.githubusercontent.com/jupyter/design/main/logos/Badges/nbviewer_badge.svg?sanitize=true\" width=\"109\" alt=\"Render with nbviewer\" style=\"vertical-align:text-bottom\" />\n </a>\n </td>\n </tr>\n <tr>\n <td>Open interactive version with Binder</td>\n <td>\n <a href=\"https://mybinder.org/v2/gh/thiery-lab/manifold_lifting/main?filepath=notebooks%2FTwo-dimensional_example.ipynb\">\n <img src=\"https://mybinder.org/badge_logo.svg\" alt=\"Launch with Binder\" style=\"vertical-align:text-bottom\"/>\n </a>\n </td>\n </tr>\n <tr>\n <td>Open interactive version with Google Colab</td>\n <td>\n <a href=\"https://colab.research.google.com/github/thiery-lab/manifold_lifting/blob/main/notebooks/Two-dimensional_example.ipynb\">\n <img alt=\"Open in Colab\" src=\"https://colab.research.google.com/assets/colab-badge.svg\" style=\"vertical-align:text-bottom\">\n </a>\n </td>\n </tr>\n</table>\n\n<table>\n <tr>\n <th colspan=\"2\"><a href=\"https://github.com/thiery-lab/manifold-mcmc-for-diffusions\">Manifold MCMC methods for inference in diffusion models</a></th>\n </tr>\n <tr>\n <td>Open non-interactive version with nbviewer</td>\n <td>\n <a href=\"https://nbviewer.jupyter.org/github/thiery-lab/manifold-mcmc-for-diffusions/blob/main/FitzHugh-Nagumo_example.ipynb\">\n <img src=\"https://raw.githubusercontent.com/jupyter/design/main/logos/Badges/nbviewer_badge.svg?sanitize=true\" width=\"109\" alt=\"Render with nbviewer\" style=\"vertical-align:text-bottom\" />\n </a>\n </td>\n </tr>\n <tr>\n <td>Open interactive version with Binder</td>\n <td>\n <a href=\"https://mybinder.org/v2/gh/thiery-lab/manifold-mcmc-for-diffusions/main?filepath=FitzHugh-Nagumo_example.ipynb\">\n <img src=\"https://mybinder.org/badge_logo.svg\" alt=\"Launch with Binder\" style=\"vertical-align:text-bottom\"/>\n </a>\n </td>\n </tr>\n <tr>\n <td>Open interactive version with Google Colab</td>\n <td>\n <a href=\"https://colab.research.google.com/github/thiery-lab/manifold-mcmc-for-diffusions/blob/main/FitzHugh-Nagumo_example.ipynb\">\n <img alt=\"Open in Colab\" src=\"https://colab.research.google.com/assets/colab-badge.svg\" style=\"vertical-align:text-bottom\">\n </a>\n </td>\n </tr>\n</table>\n\n## Example: sampling on a torus\n\n<img src='https://raw.githubusercontent.com/matt-graham/mici/main/images/torus-samples.gif' width='360px'/>\n\nA simple complete example of using the package to compute approximate samples\nfrom a distribution on a two-dimensional torus embedded in a three-dimensional\nspace is given below. The computed samples are visualized in the animation\nabove. Here we use `autograd` to automatically construct functions to calculate\nthe required derivatives (gradient of negative log density of target\ndistribution and Jacobian of constraint function), sample four chains in\nparallel using `multiprocess`, use `arviz` to calculate diagnostics and use\n`matplotlib` to plot the samples.\n\n> \u26a0\ufe0f **If you do not have [`multiprocess`](https://github.com/uqfoundation/multiprocess) installed the example code below will hang or raise an error when sampling the chains as the inbuilt `multiprocessing` module does not support pickling Autograd functions.**\n\n```Python\nfrom mici import systems, integrators, samplers\nimport autograd.numpy as np\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\nimport matplotlib.animation as animation\nimport arviz\n\n# Define fixed model parameters\nR = 1.0 # toroidal radius \u2208 (0, \u221e)\nr = 0.5 # poloidal radius \u2208 (0, R)\n\u03b1 = 0.9 # density fluctuation amplitude \u2208 [0, 1)\n\n# Define constraint function such that the set {q : constr(q) == 0} is a torus\ndef constr(q):\n x, y, z = q.T\n return np.stack([((x**2 + y**2)**0.5 - R)**2 + z**2 - r**2], -1)\n\n# Define negative log density for the target distribution on torus\n# (with respect to 2D 'area' measure for torus)\ndef neg_log_dens(q):\n x, y, z = q.T\n \u03b8 = np.arctan2(y, x)\n \u03d5 = np.arctan2(z, x / np.cos(\u03b8) - R)\n return np.log1p(r * np.cos(\u03d5) / R) - np.log1p(np.sin(4*\u03b8) * np.cos(\u03d5) * \u03b1)\n\n# Specify constrained Hamiltonian system with default identity metric\nsystem = systems.DenseConstrainedEuclideanMetricSystem(neg_log_dens, constr)\n\n# System is constrained therefore use constrained leapfrog integrator\nintegrator = integrators.ConstrainedLeapfrogIntegrator(system)\n\n# Seed a random number generator\nrng = np.random.default_rng(seed=1234)\n\n# Use dynamic integration-time HMC implementation as MCMC sampler\nsampler = samplers.DynamicMultinomialHMC(system, integrator, rng)\n\n# Sample initial positions on torus using parameterisation (\u03b8, \u03d5) \u2208 [0, 2\u03c0)\u00b2\n# x, y, z = (R + r * cos(\u03d5)) * cos(\u03b8), (R + r * cos(\u03d5)) * sin(\u03b8), r * sin(\u03d5)\nn_chain = 4\n\u03b8_init, \u03d5_init = rng.uniform(0, 2 * np.pi, size=(2, n_chain))\nq_init = np.stack([\n (R + r * np.cos(\u03d5_init)) * np.cos(\u03b8_init),\n (R + r * np.cos(\u03d5_init)) * np.sin(\u03b8_init),\n r * np.sin(\u03d5_init)], -1)\n\n# Define function to extract variables to trace during sampling\ndef trace_func(state):\n x, y, z = state.pos\n return {'x': x, 'y': y, 'z': z}\n\n# Sample 4 chains in parallel with 500 adaptive warm up iterations in which the\n# integrator step size is tuned, followed by 2000 non-adaptive iterations\nfinal_states, traces, stats = sampler.sample_chains(\n n_warm_up_iter=500,\n n_main_iter=2000,\n init_states=q_init,\n n_process=4,\n trace_funcs=[trace_func]\n)\n\n# Print average accept probability and number of integrator steps per chain\nfor c in range(n_chain):\n print(f\"Chain {c}:\")\n print(f\" Average accept prob. = {stats['accept_stat'][c].mean():.2f}\")\n print(f\" Average number steps = {stats['n_step'][c].mean():.1f}\")\n\n# Print summary statistics and diagnostics computed using ArviZ\nprint(arviz.summary(traces))\n\n# Visualize concatentated chain samples as animated 3D scatter plot\nfig = plt.figure(figsize=(4, 4))\nax = Axes3D(fig, [0., 0., 1., 1.], proj_type='ortho')\npoints_3d, = ax.plot(*(np.concatenate(traces[k]) for k in 'xyz'), '.', ms=0.5)\nax.axis('off')\nfor set_lim in [ax.set_xlim, ax.set_ylim, ax.set_zlim]:\n set_lim((-1, 1))\n\ndef update(i):\n angle = 45 * (np.sin(2 * np.pi * i / 60) + 1)\n ax.view_init(elev=angle, azim=angle)\n return (points_3d,)\n\nanim = animation.FuncAnimation(fig, update, frames=60, interval=100, blit=True)\n```\n\n## References\n\n 1. <a id='andersen1983rattle'></a> Andersen, H.C., 1983. RATTLE: A \u201cvelocity\u201d\n version of the SHAKE algorithm for molecular dynamics calculations.\n *Journal of Computational Physics*, 52(1), pp.24-34.\n [![DOI:10.1016/0021-9991(83)90014-1](https://zenodo.org/badge/DOI/10.1016/0021-9991(83)90014-1.svg)](https://doi.org/10.1016/0021-9991(83)90014-1)\n 2. <a id='duane1987hybrid'></a> Duane, S., Kennedy, A.D., Pendleton, B.J. and\n Roweth, D., 1987. Hybrid Monte Carlo. *Physics letters B*, 195(2),\n pp.216-222.\n [![DOI:10.1016/0370-2693(87)91197-X](https://zenodo.org/badge/DOI/10.1016/0370-2693(87)91197-X.svg)](https://doi.org/10.1016/0370-2693(87)91197-X)\n 3. <a id='mackenzie1989improved'></a> Mackenzie, P.B., 1989. An improved\n hybrid Monte Carlo method. *Physics Letters B*, 226(3-4), pp.369-371.\n [![DOI:10.1016/0370-2693(89)91212-4](https://zenodo.org/badge/DOI/10.1016/0370-2693(89)91212-4.svg)](https://doi.org/10.1016/0370-2693(89)91212-4)\n 4. <a id='horowitz1991generalized'></a> Horowitz, A.M., 1991. A generalized\n guided Monte Carlo algorithm. *Physics Letters B*, 268(CERN-TH-6172-91),\n pp.247-252.\n [![DOI:10.1016/0370-2693(91)90812-5](https://zenodo.org/badge/DOI/10.1016/0370-2693(91)90812-5.svg)](https://doi.org/10.1016/0370-2693(91)90812-5)\n 5. <a id='leimkuhler1994symplectic'></a> Leimkuhler, B. and Reich, S., 1994.\n Symplectic integration of constrained Hamiltonian systems. *Mathematics of\n Computation*, 63(208), pp.589-605.\n [![DOI:10.2307/2153284](https://zenodo.org/badge/DOI/10.2307/2153284.svg)](https://doi.org/10.2307/2153284)\n 6. <a id='leimkuhler2004simulating'></a> Leimkuhler, B. and Reich, S., 2004.\n Simulating Hamiltonian dynamics (Vol. 14). *Cambridge University Press*.\n [![DOI:10.1017/CBO9780511614118](https://zenodo.org/badge/DOI/10.1017/CBO9780511614118.svg)](https://doi.org/10.1017/CBO9780511614118)\n 7. <a id='hartmann2005constrained'></a> Hartmann, C. and Sch\u00fctte, C., 2005. A\n constrained hybrid Monte\u2010Carlo algorithm and the problem of calculating the\n free energy in several variables. *ZAMM \u2010 Journal of Applied Mathematics and\n Mechanics*, 85(10), pp.700-710.\n [![DOI:10.1002/zamm.200410218](https://zenodo.org/badge/DOI/10.1002/zamm.200410218.svg)](https://doi.org/10.1002/zamm.200410218)\n 8. <a id='girolami2011riemann'></a> Girolami, M. and Calderhead, B., 2011.\n Riemann manifold Langevin and Hamiltonian Monte Carlo methods. *Journal of\n the Royal Statistical Society: Series B (Statistical Methodology)*, 73(2), pp.123-214.\n [![DOI:10.1111/j.1467-9868.2010.00765.x](https://zenodo.org/badge/DOI/10.1111/j.1467-9868.2010.00765.x.svg)](https://doi.org/10.1111/j.1467-9868.2010.00765.x)\n 9. <a id='brubaker2012family'></a> Brubaker, M., Salzmann, M. and\n Urtasun, R., 2012. A family of MCMC methods on implicitly defined\n manifolds. In *Artificial intelligence and statistics* (pp. 161-172).\n [![CiteSeerX:10.1.1.417.6111](http://img.shields.io/badge/CiteSeerX-10.1.1.417.6111-blue.svg)](https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.417.6111)\n 10. <a id='betancourt2013general'></a> Betancourt, M., 2013. A general metric\n for Riemannian manifold Hamiltonian Monte Carlo. In *Geometric science of\n information* (pp. 327-334).\n [![DOI:10.1007/978-3-642-40020-9_35](https://zenodo.org/badge/DOI/10.1007/978-3-642-40020-9_35.svg)](https://doi.org/10.1007/978-3-642-40020-9_35)\n [![arXiv:1212.4693](http://img.shields.io/badge/arXiv-1212.4693-B31B1B.svg)](https://arxiv.org/abs/1212.4693)\n 11. <a id='hoffman2014nouturn'></a> Hoffman, M.D. and Gelman, A., 2014. The\n No-U-turn sampler: adaptively setting path lengths in Hamiltonian Monte\n Carlo. *Journal of Machine Learning Research*, 15(1), pp.1593-1623.\n [![CiteSeerX:10.1.1.220.8395](http://img.shields.io/badge/CiteSeerX-10.1.1.220.8395-blue.svg)](https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.220.8395)\n [![arXiv:1111.4246](http://img.shields.io/badge/arXiv-1111.4246-B31B1B.svg)](https://arxiv.org/abs/1111.4246)\n 12. <a id='shababa2014split'></a> Shahbaba, B., Lan, S., Johnson, W.O. and\n Neal, R.M., 2014. Split Hamiltonian Monte Carlo. *Statistics and\n Computing*, 24(3), pp.339-349.\n [![DOI:10.1007/s11222-012-9373-1](https://zenodo.org/badge/DOI/10.1007/s11222-012-9373-1.svg)](https://doi.org/10.1007/s11222-012-9373-1)\n [![arXiv:1106.5941](http://img.shields.io/badge/arXiv-1106.5941-B31B1B.svg)](https://arxiv.org/abs/1106.5941)\n 13. <a id='blanes2014numerical'></a> Blanes, S., Casas, F., & Sanz-Serna, J. M., 2014.\n Numerical integrators for the Hybrid Monte Carlo method.\n *SIAM Journal on Scientific Computing*, 36(4), A1556-A1580.\n [![DOI:10.1137/130932740](https://zenodo.org/badge/DOI/10.1137/130932740.svg)](https://doi.org/10.1137/130932740)\n [![arXiv:1405.3153](http://img.shields.io/badge/arXiv-1405.3153-B31B1B.svg)](https://arxiv.org/abs/1405.3153)\n 14. <a id='betancourt2017conceptual'></a> Betancourt, M., 2017. A conceptual\n introduction to Hamiltonian Monte Carlo.\n [![arXiv:1701.02434](http://img.shields.io/badge/arXiv-1701.02434-B31B1B.svg)](https://arxiv.org/abs/1701.02434)\n 15. <a id='lelievre2019hybrid'></a> Leli\u00e8vre, T., Rousset, M. and Stoltz, G.,\n 2019. Hybrid Monte Carlo methods for sampling probability measures on\n submanifolds. In *Numerische Mathematik*, 143(2), (pp.379-421).\n [![DOI:10.1007/s00211-019-01056-4](https://zenodo.org/badge/DOI/10.1007/s00211-019-01056-4.svg)](https://doi.org/10.1007/s00211-019-01056-4)\n [![arXiv:1807.02356](http://img.shields.io/badge/arXiv-1807.02356-B31B1B.svg)](https://arxiv.org/abs/1807.02356)\n",
"bugtrack_url": null,
"license": "",
"summary": "MCMC samplers based on simulating Hamiltonian dynamics on a manifold.",
"version": "0.2.1",
"project_urls": {
"documentation": "https://matt-graham.github.io/mici",
"homepage": "https://github.com/matt-graham/mici"
},
"split_keywords": [
"inference",
"sampling",
"mcmc",
"hmc"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "19b8893fcaaba1cce307189266a6765688d8af69d421cddc64a8dca185fd5d93",
"md5": "f9f42e6d883a7a7199bad69005e4b676",
"sha256": "75bd68e9f585ab86593ed7b0bcdf7e710bc44086b346480a3ff503d6511a5ffb"
},
"downloads": -1,
"filename": "mici-0.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f9f42e6d883a7a7199bad69005e4b676",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 106797,
"upload_time": "2023-08-11T14:22:06",
"upload_time_iso_8601": "2023-08-11T14:22:06.147926Z",
"url": "https://files.pythonhosted.org/packages/19/b8/893fcaaba1cce307189266a6765688d8af69d421cddc64a8dca185fd5d93/mici-0.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ea0bd1481e7b61d683ed3ef1e9ecab734f35b46f9520efaa0759c270a228e689",
"md5": "8395a36c74fdea5d69d6ed333953d18c",
"sha256": "b5bdb5aa7fc0e1b3e742c8c61312eb3c8b92098121de28ef3c6be250f15ff990"
},
"downloads": -1,
"filename": "mici-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "8395a36c74fdea5d69d6ed333953d18c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 127011,
"upload_time": "2023-08-11T14:22:07",
"upload_time_iso_8601": "2023-08-11T14:22:07.900284Z",
"url": "https://files.pythonhosted.org/packages/ea/0b/d1481e7b61d683ed3ef1e9ecab734f35b46f9520efaa0759c270a228e689/mici-0.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-11 14:22:07",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "matt-graham",
"github_project": "mici",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "mici"
}