Registry / ai-ml / pymc-extras

pymc-extras

JSON →
library0.12.1pypypi✓ verified 87d ago

PyMC-Extras (version 0.10.0) serves as an experimental extension library for PyMC, providing a sandbox for new probability distributions, advanced model fitting algorithms, and other specialized code not yet integrated into the main PyMC repository. It aims to offer bleeding-edge features to users, with a flexible release cadence tied to the development cycle of its experimental components.

pip install pymc-extras
INSTALL
IMPORT
SIG · PYMC-EXTRAS
P
pymc-extras
ai-mlpythonv0.12.1
Install
27.1s avg
Import
9468ms
Disk
695MB
Pass rate
4/ 10
Env Coverage4 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.2.7 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ build_error
✓ 29.6s
py 3.11
✕ build_error
✓ 27.45s
py 3.12
✕ build_error
✓ 25.58s
py 3.13
✕ build_error
✓ 25.9s
py 3.9
✕ build_error
✕ build_error
695MB installed
● package 695MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

distributions
from pymc_extras import distributions
from pymc_extras.distributions import *
Prefer explicit module imports (e.g., `import pymc_extras.distributions as pmx_dist`) or direct symbol imports for better code readability and avoiding name clashes.
samplers
from pymc_extras import samplers
Access advanced MCMC samplers and related tools, such as robust HMC algorithms.

Demonstrates defining a PyMC model using a specialized distribution, `LogitNormal`, from `pymc-extras`. This illustrates how to seamlessly integrate `pymc-extras` components into a standard PyMC workflow, typically followed by sampling if observed data is provided.

import pymc as pm from pymc_extras import distributions as pmx_dist import numpy as np # Define a custom distribution from pymc-extras, e.g., the LogitNormal with pm.Model() as model: # Example using LogitNormal, suitable for modeling proportions proportion_latent = pm.Normal("proportion_latent", mu=0, sigma=1) proportion = pmx_dist.LogitNormal("proportion", mu=proportion_latent, sigma=1) # In a real scenario, you would typically add observed data for inference. # Example: obs = pm.Binomial("obs", n=10, p=proportion, observed=np.array([5, 6, 7])) # For this quickstart, we just demonstrate model definition. # trace = pm.sample(draws=1000, tune=1000, chains=2) print(f"Model created with LogitNormal distribution: {model.named_vars['proportion']}")
Debug
Known issues
gotchaFeatures in `pymc-extras` are experimental and subject to change or removal without strict adherence to semantic versioning. They may not be stable for production use.
fix
Treat `pymc-extras` components as potentially unstable; review release notes for updates and consider migrating critical production code to stable PyMC features where available.
affects: All versions
gotchaEnsure compatibility with your PyMC installation. `pymc-extras` is generally developed against the latest stable PyMC version, and older PyMC versions might lead to API mismatches or runtime errors.
fix
Always use a recent, stable version of PyMC (`pip install --upgrade pymc`) alongside `pymc-extras`. Check the `pymc-extras` README or documentation for specific PyMC version requirements.
affects: All versions
gotchaSome features from `pymc-extras` might eventually be integrated into core PyMC. While this offers stability, it means the `pymc-extras` version of a feature might become redundant or deprecated.
fix
Regularly check PyMC release notes and `pymc-extras` updates. If a feature moves to core PyMC, consider updating your code to use the official PyMC implementation for long-term stability and maintenance.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pymc_extras'
The `pymc-extras` library is not installed in the current Python environment.
fix
Install the library using pip: `pip install pymc-extras`
AttributeError: module 'pymc_extras.distributions' has no attribute 'MyCustomDistribution'
Attempted to access a distribution that does not exist or has a different name within `pymc_extras.distributions`.
fix
Verify the correct spelling and existence of the distribution in the `pymc-extras` documentation or by inspecting the module contents (e.g., `dir(pmx_dist)` if imported as `pmx_dist`).
TypeError: unsupported operand type(s) for +: 'TensorVariable' and 'NoneType' (or similar PyTensor/Aesara runtime errors when using custom distributions)
Often indicates an incompatibility between `pymc-extras` and the installed PyMC/PyTensor versions, or incorrect usage of a distribution's parameters (e.g., passing `None` where a tensor is expected).
fix
Ensure both PyMC and `pymc-extras` are up-to-date (`pip install --upgrade pymc pymc-extras`). Review the documentation for the specific distribution's parameter requirements. If issues persist, consider isolating the problem in a minimal reproducible example.
Upgrade
Version history
0.12.1latest on PyPI · released Jun 9, 2026
Audit
Dependencies
pymcrequiredCore probabilistic programming framework; pymc-extras builds upon it.
Agent activity
7 hits · last 30 days
node
6
OpenAI (training)
1
Resources
pymc-extras — pip install pymc-extras · libregistry