PyMC
| PyMC | |
|---|---|
| File:PyMC logo.png | |
| Other names | PyMC2, PyMC3 |
| Original author | PyMC Development Team |
| Initial release | April 6, 2012 |
| Repository | https://github.com/pymc-devs/pymc |
| Written in | Python |
| Engine | |
| Operating system | Unix-like, Mac OS X, Microsoft Windows |
| Platform | Intel x86 – 32-bit, x64 |
| Type | Statistical package |
| License | Apache License, Version 2.0 |
| Website | www |
PyMC (formerly known as PyMC3) is a probabilistic programming library for Python. It can be used for Bayesian statistical modeling and probabilistic machine learning.
PyMC performs inference based on advanced Markov chain Monte Carlo and/or variational fitting algorithms.[1][2][3][4][5] It is a rewrite from scratch of the previous version of the PyMC software.[6] Unlike PyMC2, which had used Fortran extensions for performing computations, PyMC relies on PyTensor, a Python library that allows defining, optimizing, and efficiently evaluating mathematical expressions involving multi-dimensional arrays. From version 3.8 PyMC relies on ArviZ to handle plotting, diagnostics, and statistical checks. PyMC and Stan are the two most popular probabilistic programming tools.[7] PyMC is an open source project, developed by the community and has been fiscally sponsored by NumFOCUS.[8]
PyMC has been used to solve inference problems in several scientific domains, including astronomy,[9][10] epidemiology,[11][12] molecular biology,[13] crystallography,[14][15] chemistry,[16] ecology[17][18] and psychology.[19] Previous versions of PyMC were also used widely, for example in climate science,[20] public health,[21] neuroscience,[22] and parasitology.[23][24]
After Theano announced plans to discontinue development in 2017,[25] the PyMC team evaluated TensorFlow Probability as a computational backend,[26] but decided in 2020 to fork Theano under the name Aesara.[27] Large parts of the Theano codebase have been refactored and compilation through JAX[28] and Numba were added. The PyMC team has released the revised computational backend under the name PyTensor and continues the development of PyMC.[29]
Inference engines
[edit | edit source]PyMC implements non-gradient-based and gradient-based Markov chain Monte Carlo (MCMC) algorithms for Bayesian inference and stochastic, gradient-based variational Bayesian methods for approximate Bayesian inference.
- MCMC-based algorithms:
- No-U-Turn sampler[30] (NUTS), a variant of Hamiltonian Monte Carlo and PyMC's default engine for continuous variables
- Metropolis–Hastings, PyMC's default engine for discrete variables
- Sequential Monte Carlo for static posteriors
- Sequential Monte Carlo for approximate Bayesian computation
- Variational inference algorithms:
- Black-box Variational Inference[31]
See also
[edit | edit source]- Stan is a probabilistic programming language for statistical inference written in C++
- ArviZ a Python library for exploratory analysis of Bayesian models
- Bambi is a high-level Bayesian model-building interface based on PyMC
References
[edit | edit source]- ^ Abril-Pla O, Andreani V, Carroll C, Dong L, Fonnesbeck CJ, Kochurov M, Kumar R, Lao J, Luhmann CC, Martin OA, Osthege M, Vieira R, Wiecki T, Zinkov R. (2023) PyMC: a modern, and comprehensive probabilistic programming framework in Python. PeerJ Comput. Sci. 9:e1516 Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Salvatier J, Wiecki TV, Fonnesbeck C. (2016) Probabilistic programming in Python using PyMC3. PeerJ Computer Science 2:e55 Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
Further reading
[edit | edit source]- Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
External links
[edit | edit source]- PyMC website
- PyMC source, a Git repository hosted on GitHub
- PyTensor is a Python library for defining, optimizing, and efficiently evaluating mathematical expressions involving multi-dimensional arrays.