pytensor-distributions
PyTensor powered distributions.
What it is and what it does
PyTensor-distributions is a library of probability distribution functions and statistical properties implemented as PyTensor symbolic expressions. It provides a unified, tested source for core probability operations—pdf, cdf, ppf, logpdf, mean, variance, entropy, and others—designed to reduce redundancy across the PyMC ecosystem and allow other libraries to build specialized APIs on top of these expressions.
The package takes a minimal, function-based design approach: one file per distribution, no classes, and a focus on simplicity. It depends only on numpy and pytensor, making it lightweight to install. It is currently in active development (alpha status) and welcomes community contributions.
Use it for:
- Building probabilistic models in PyMC or other Bayesian inference frameworks that need standardized distribution expressions
- Computing probability density, cumulative distribution, and inverse functions for statistical analysis workflows
- Implementing custom probabilistic algorithms that require symbolic distribution operations via PyTensor
- Reducing code duplication by using a shared, tested library of distribution implementations across multiple projects
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
PyTensor-distributions provides a collection of probability distribution functions (pdf, cdf, ppf, logpdf, etc.) and statistical properties (mean, variance, entropy, etc.) implemented as PyTensor expressions for use in probabilistic computing.
Yes, if you are working with PyMC or building probabilistic models that benefit from PyTensor's symbolic computation. The low install friction, permissive license, and active maintenance make it a reasonable choice. However, the alpha status means the API and feature coverage may change; verify that the distributions and expressions you need are already implemented before committing to a production dependency.
Install
pytensor-distributions on PyPI
pip
pip install pytensor-distributionsuv
uv add pytensor-distributionspoetry
poetry add pytensor-distributionsInstalling pytensor-distributions
Before you install
Low install friction; the package is a pure Python wheel with only numpy and pytensor as runtime dependencies. Actively maintained with a recent release, though still in alpha development status.
License in practice
Licensed under Apache Software License (permissive), allowing commercial and private use with minimal restrictions.
Quickstart
pip install pytensor-distributions
import pytensor_distributions as ptd
import numpy as np
# Example: compute pdf of a distribution
pdf_value = ptd.normal.pdf(x=0.0, mu=0.0, sigma=1.0)
Requires Python 3.12 or later; pytensor must be installed and functional.
Verify before relying
- Which specific distributions are currently implemented and which core expressions each supports
- Performance characteristics compared to scipy or other probability libraries
- API stability guarantees given the alpha development status
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.12) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — numpy, pytensor |
| Maintenance | actively maintained — 67 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 248,129/month — #8,675 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytensor_distributions-0.2.0-py3-none-any.whl
Tags
More Mathematics packages
NetworkX provides data structures and…
permissive · top 1,000 on PyPI
kiwisolverkiwisolver is a Python binding to a fast C++…
permissive · top 1,000 on PyPI
sympySymPy is a Python library for symbolic…
permissive · top 1,000 on PyPI
contourpyContourPy calculates contours of 2D…
permissive · top 1,000 on PyPI
torchPyTorch provides GPU-accelerated tensor…
permissive · top 1,000 on PyPI
onnxruntimeonnxruntime loads and executes Open Neural…
permissive · top 1,000 on PyPI
cody-specialProvides high-precision implementations of…
permissive · top 15,000 on PyPI
momentchi2Computes the cumulative distribution function…
permissive · top 15,000 on PyPI
pytensorPyTensor is a Python library for defining,…
permissive · top 5,000 on PyPI
reliabilityReliability engineering and survival analysis…
copyleft · top 5,000 on PyPI
tensorflow-probabilityTensorFlow Probability provides probabilistic…
permissive · top 5,000 on PyPI
pymc-extrasExtends PyMC with specialized distributions,…
permissive · top 15,000 on PyPI
pyro-pplPyro is a deep probabilistic programming…
permissive · top 5,000 on PyPI
statisticsProvides basic mathematical statistics…
permissive · top 15,000 on PyPI
prelizPreliZ helps you specify prior distributions…
permissive · top 15,000 on PyPI
lifelineslifelines implements survival analysis…
permissive · top 5,000 on PyPI