pymc-extras
A home for new additions to PyMC, which may include unusual probability distribitions, advanced model fitting algorithms, or any code that may be inappropriate to include in the pymc repository, but may want to be made available to users.
What it is and what it does
PyMC Extras is a companion library to PyMC that houses specialized statistical methods and distributions too niche for the core library but mature enough to be useful. It provides alternative inference algorithms (Pathfinder, DADVI, INLA, Laplace approximation, better MAP estimation), additional probability distributions (DiscreteMarkovChain, GeneralizedPoisson, GenExtreme), and statespace models with Kalman filtering (SARIMAX, VARMAX, ETS, structural time series). The library mirrors PyMC's namespaces so distributions and methods integrate seamlessly into existing PyMC models.
It is maintained by the PyMC team and designed as an incubator: functionality that proves widely useful may graduate to the main PyMC repository. The package depends on pymc, pytensor, arviz, pydantic, preliz, and better-optimize, and targets modern Python versions (3.12, 3.13, 3.14). It carries no known vulnerabilities and is actively developed.
Use it for:
- Fit time-series models like SARIMAX or structural time series with Kalman filtering when standard PyMC distributions are insufficient.
- Use alternative inference methods such as Pathfinder or INLA for faster or more accurate posterior approximation in specialized models.
- Apply automatic marginalization to handle finite discrete or conjugate variables exactly or via Laplace approximation.
- Model rare or extreme-value phenomena using specialized distributions like GenExtreme or GeneralizedPoisson.
- Implement Markov chain distributions for state-space or sequential modeling tasks.
- Experiment with advanced Bayesian techniques before they mature into the core PyMC library.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Extends PyMC with specialized distributions, alternative inference methods, and statespace models that are too specialized for the core library but useful enough to avoid reimplementing.
Yes. PyMC Extras is actively maintained by the PyMC team, carries no known vulnerabilities, installs with low friction, and is licensed permissively. Install it if you need specialized distributions, alternative inference methods, or statespace models beyond what PyMC core offers. It is production-ready (Development Status 5) and well-integrated with the PyMC ecosystem.
Install
pymc-extras on PyPI
pip
pip install pymc-extrasuv
uv add pymc-extraspoetry
poetry add pymc-extrasInstalling pymc-extras
Before you install
Low install friction with a pure-Python wheel. Actively maintained by the PyMC team with a release 17 days ago and recent commits. Depends on pymc, pytensor, arviz, pydantic, preliz, and better-optimize—all established packages in the scientific Python ecosystem.
License in practice
Apache License 2.0 is permissive; you can use, modify, and distribute this package freely in commercial and private projects as long as you include a copy of the license and document any changes you make.
Quickstart
pip install pymc-extras
import pymc as pm
import pymc_extras as pmx
with pm.Model():
xi = pm.HalfNormal("xi", 0.2)
pmx.GenExtreme("llik", mu=1, sigma=0.5, xi=xi, observed=data)
Requires Python 3.12 or later and an existing PyMC installation.
Verify before relying
- Whether automatic marginalization via Laplace approximation is exact or approximate in practice for your use case.
- Performance characteristics of SARIMAX, VARMAX, and ETS models on typical time-series datasets.
- Compatibility of Pathfinder and DADVI methods with custom PyMC model structures.
Package facts
| License | ======= License ======= PyMC is distributed under the Apache License, Version 2.0 Copyright (c) 2006 Christopher J. Fonnesbeck (Academic Free License) Copyright (c) 2007-2008 Christopher J.… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.12) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 6 — arviz, better-optimize, preliz, pydantic, pymc, pytensor |
| Maintenance | actively maintained — 17 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 257,653/month — #8,438 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pymc_extras-0.14.0-py3-none-any.whl
Keywords: bayesian, machine learning, mcmc, probability, sampling, statistics
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
pymc3PyMC3 is a Python package for Bayesian…
permissive · top 15,000 on PyPI
pymcPyMC is a Python package for Bayesian…
permissive · top 5,000 on PyPI
nutpienutpie provides a fast NUTS sampler for…
permissive · top 15,000 on PyPI
pymc-marketingPyMC-Marketing provides Bayesian statistical…
permissive · top 15,000 on PyPI
pyjptpyjpt learns and reasons about joint…
unclear · top 15,000 on PyPI
emceeemcee implements affine-invariant ensemble…
permissive · top 5,000 on PyPI
pytensor-distributionsPyTensor-distributions provides a collection of…
permissive · top 15,000 on PyPI
prelizPreliZ helps you specify prior distributions…
permissive · top 15,000 on PyPI
numpyroNumPyro is a probabilistic programming library…
permissive · top 15,000 on PyPI
statsmodelsstatsmodels provides statistical models,…
permissive · top 1,000 on PyPI