--- id: pymc version: "6.3.0" license: Apache License, Version 2.0 license_treatment: permissive maintenance: active --- # pymc — Probabilistic Programming in Python: Bayesian Modeling and Probabilistic Machine Learning with PyTensor License: permissive · Maintenance: active · Downloads: 5.5M/mo ## What it is and what it does PyMC is a framework for specifying and fitting Bayesian statistical models using probabilistic programming. It translates intuitive mathematical notation (like x ~ N(0,1)) into executable inference code, handling the computational complexity of sampling from posterior distributions. The package combines advanced sampling algorithms—including the No U-Turn Sampler—with variational inference methods for both exact and approximate posterior estimation, making it suitable for models ranging from simple regression to complex hierarchical structures. Under the hood, PyMC relies on PyTensor for computation optimization and can compile models to C or JAX for performance. It integrates with numpy, scipy, and pandas for data handling, and uses arviz for posterior analysis and visualization. The package is designed for researchers and practitioners who need flexible Bayesian inference without deep expertise in sampling algorithm implementation. Use it for: - Fit Bayesian linear or generalized linear regression models to estimate parameter uncertainty and credible intervals. - Perform hierarchical modeling for grouped data, such as multi-site experiments or nested study designs. - Conduct prior sensitivity analysis and posterior predictive checks to validate model assumptions. - Estimate missing values in datasets using transparent imputation within a probabilistic framework. - Compare competing Bayesian models using posterior predictive distributions and information criteria. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. PyMC is a Python package for Bayesian statistical modeling and probabilistic programming, providing advanced MCMC and variational inference algorithms for parameter estimation and posterior inference. Yes. PyMC is production-stable (Development Status 5), actively maintained with a recent release, carries no known vulnerabilities, and uses a permissive Apache 2.0 license. It has low install friction and broad adoption (top 5000 on PyPI). Install it if you need to fit Bayesian models with flexible inference algorithms; avoid it only if you require Python versions below 3.12 or have no need for probabilistic modeling. ## Install pip install pymc uv add pymc poetry add pymc ## Installing pymc Before you install: Low install friction with a pure-Python wheel distribution. Active maintenance with a release 2 days old and 9710 repository stars. Requires Python 3.12 or later and depends on 10 runtime packages including numpy, scipy, pytensor, and arviz. License in practice: Licensed under Apache License 2.0 (permissive), allowing commercial and private use with minimal restrictions beyond attribution and liability disclaimers. Quickstart: import pymc as pm import numpy as np # Define a simple Bayesian model with pm.Model() as model: mu = pm.Normal('mu', mu=0, sigma=1) obs = pm.Normal('obs', mu=mu, sigma=1, observed=np.array([1, 2, 3])) idata = pm.sample(random_seed=42) print(pm.stats.summary(idata)) Requires Python 3.12 or later; computationally intensive models may benefit from a system with multiple CPU cores due to threadpoolctl dependency. Verify before relying: - Whether JAX compilation support is available out-of-the-box or requires additional setup beyond the listed dependencies. - Performance characteristics and scalability limits for models with thousands of parameters mentioned in the description. ## Package facts - License: Apache License, Version 2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 5.5M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags bayesian statistical modeling, markov chain monte carlo sampling, variational inference python, probabilistic programming, posterior inference mcmc, bayesian regression modeling, parameter estimation sampling, bayesian-inference, mcmc-sampling, probabilistic-programming [View on SkillFed](https://skillfed.io/packages/pymc) · [View on PyPI](https://pypi.org/project/pymc/)