skillfed

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.

pymc-extras v0.14.0 257.7K downloads/30d#8,438 on PyPI142
Permissive 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) Active released

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-extras

uv

uv add pymc-extras

poetry

poetry add pymc-extras

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/EngineeringTopic :: Scientific/Engineering :: Mathematics

Tags

pymc extensions distributionsbayesian inference methodstime series statespace modelsmarkov chain samplinglaplace approximationpathfinder inferencediscrete distributions bayesian
bayesian-inferencetime-series-modelingprobabilistic-programming

More Scientific/Engineering packages