tinyDA

tinyDA is a Delayed Acceptance MCMC sampler with finite-length subchain sampling and adaptive error modelling.

This is intended as a simple, lightweight implementation, with minimal dependencies, i.e. nothing beyond the SciPy stack.

It is fully imperative and easy to use!

Features

Proposals

  • Random Walk Metropolis Hastings (RWMH)

  • preconditioned Crank-Nicolson (pCN)

  • Adaptive Metropolis (AM)

  • Operator-weighted pCN

  • Metropolis Adjusted Langevin Algorithm (MALA)

  • DREAM(Z)

  • Multiple-Try Metropolis (MTM)

Adaptive Error Models

  • State independent

  • State dependent

Diagnostics

  • ArviZ compatibility

Documentation

Examples

Please refer to the Jupyter Notebooks in the GitHub repository.

Installation

Install tinyDA by running:

pip install tinyDA

Dependencies:

  • NumPy

  • SciPy

  • ArviZ

  • tqdm

  • Ray (multiprocessing, optional)

Contribute

License

The project is licensed under the MIT license.

References

  • Metropolis, N., Rosenbluth, A. W., Rosenbluth, M. N., Teller, A. H., & Teller, E. (1953). Equation of State Calculations by Fast Computing Machines. The Journal of Chemical Physics, 21(6), 1087–1092. https://doi.org/10.1063/1.1699114

  • Hastings, W. K. (1970). Monte Carlo sampling methods using Markov chains and their applications. Biometrika, 13.

  • Liu, J. S., Liang, F., & Wong, W. H. (2000). The Multiple-Try Method and Local Optimization in Metropolis Sampling. Journal of the American Statistical Association, 95(449), 121–134. https://doi.org/10.1080/01621459.2000.10473908

  • Haario, H., Saksman, E., & Tamminen, J. (2001). An Adaptive Metropolis Algorithm. Bernoulli, 7(2), 223. https://doi.org/10.2307/3318737

  • Cotter, S. L., Roberts, G. O., Stuart, A. M., & White, D. (2013). MCMC Methods for Functions: Modifying Old Algorithms to Make Them Faster. Statistical Science, 28(3), 424–446. https://doi.org/10.1214/13-STS421

  • Law, K. J. H. (2014). Proposals which speed-up function-space MCMC. Journal of Computational and Applied Mathematics, 262, 127–138. https://doi.org/10.1016/j.cam.2013.07.026

  • Vrugt, J. A. (2016). Markov chain Monte Carlo simulation using the DREAM software package: Theory, concepts, and MATLAB implementation. Environmental Modelling & Software, 75, 273–316. https://doi.org/10.1016/j.envsoft.2015.08.013

  • Cui, T., Fox, C., & O’Sullivan, M. J. (2018). A posteriori stochastic correction of reduced models in delayed acceptance MCMC, with application to multiphase subsurface inverse problems. http://arxiv.org/abs/1809.03176

  • Vehtari, A., Gelman, A., Simpson, D., Carpenter, B., & Bürkner, P.-C. (2020). Rank-normalization, folding, and localization: An improved R for assessing convergence of MCMC. https://doi.org/10.1214/20-BA1221

  • Lykkegaard, M. B., Dodwell, T. J., & Moxey, D. (2020). Accelerating Uncertainty Quantification of Groundwater Flow Modelling Using Deep Neural Networks. http://arxiv.org/abs/2007.00400

  • Lykkegaard, M. B., Mingas, G., Scheichl, R., Fox, C., & Dodwell, T. J. (2020). Multilevel Delayed Acceptance MCMC with an Adaptive Error Model in PyMC3.

  • Lykkegaard, M. B., Dodwell, T. J., Fox, C., Mingas, G., & Scheichl, R. (2023). Multilevel Delayed Acceptance MCMC. SIAM/ASA Journal on Uncertainty Quantification, 11(1), 1–30. https://doi.org/10.1137/22M1476770