Generated by DeepSeek V3.2| PyMC | |
|---|---|
![]() Unknown authorUnknown author · Public domain · source | |
| Name | PyMC |
| Developer | Aesara Development Team, NumFOCUS |
| Released | 0 2003 |
| Programming language | Python (programming language) |
| Operating system | Cross-platform |
| Genre | Probabilistic programming, Bayesian statistics |
| License | Apache License 2.0 |
PyMC. It is a Python (programing language) library for probabilistic programming, primarily used for Bayesian statistical modeling and machine learning. The library allows users to flexibly specify complex hierarchical models and perform statistical inference using advanced Markov chain Monte Carlo and variational inference algorithms. Its development is supported by the non-profit NumFOCUS and it has become a cornerstone of the modern scientific Python ecosystem for data analysis.
PyMC provides a high-level, intuitive interface for defining probabilistic models, abstracting away the complex mathematics required for posterior distribution sampling. It integrates seamlessly with the broader PyData stack, including libraries like NumPy, pandas (software), and ArviZ for diagnostics and visualization. The project is fundamentally open-source, fostering a collaborative environment where contributions from the global community, including institutions like Columbia University and Google, have shaped its evolution. By enabling straightforward implementation of models ranging from simple linear regression to complex deep learning architectures, it empowers researchers in fields from astrophysics to computational biology.
A core feature is its comprehensive suite of MCMC samplers, including the efficient No-U-Turn Sampler implemented for Hamiltonian Monte Carlo. The library also supports automatic differentiation via its computational backend, Aesara, which is a fork of the popular Theano (software) library. For model comparison and evaluation, PyMC offers tools for computing information criteria like the Watanabe–AIC and performing posterior predictive checks. Recent versions have expanded support for Gaussian process models, time series analysis with state-space models, and integration with JAX (software) for accelerated computation on hardware like Google TPUs and NVIDIA GPUs.
The original version was created in 2003 by John Salvatier, Chris Fonnesbeck, and Thomas Wiecki, with inspiration from earlier projects like BUGS (software) and JAGS. A major rewrite, known as PyMC3, was released in 2015, transitioning the codebase to use Theano (software) and introducing modern sampling algorithms. In 2021, the project dropped the version suffix and moved to Aesara as Theano's development ceased, marking the current era. Key development milestones have been presented at conferences such as SciPy (conference) and supported by grants from organizations like the Alfred P. Sloan Foundation.
Users typically start by defining a model context and then declare stochastic random variables using distributions from the SciPy stats module or built-in ones. The model specification closely mirrors the mathematical notation of Bayesian hierarchical models, making it accessible for those familiar with probability theory. After specification, inference is performed by passing the model to a sampler like Metropolis–Hastings algorithm or NUTS sampler, with results yielding samples from the joint posterior. These samples can then be analyzed with companion libraries like ArviZ to compute credible intervals, Gelman–Rubin statistic, and generate visualizations for publications.
PyMC exists within a rich landscape of probabilistic programming tools. It is often compared to Stan (software), which uses its own Stan (programming language), and TensorFlow Probability from Google. Other related libraries in the Python (programming language) space include Pyro (software) from Uber and NumPyro built on JAX (software). The ecosystem is bolstered by educational resources from projects like Bayesian Methods for Hackers and integration with interactive computing environments such as Jupyter Notebook. Its development is formally sponsored by NumFOCUS, alongside other key projects like pandas (software) and Project Jupyter.
Category:Free software programmed in Python Category:Bayesian statistics Category:NumFOCUS