skillfed

pytensor-distributions

PyTensor powered distributions.

pytensor-distributions v0.2.0 248.1K downloads/30d#8,675 on PyPI5
Permissive license Active released

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

uv

uv add pytensor-distributions

poetry

poetry add pytensor-distributions

Installing 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

Development Status :: 3 - AlphaIntended Audience :: EducationIntended 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.14

Tags

probability distributions pytensorstatistical functions pytensorpdf cdf ppf implementationsprobabilistic computing distributionspytensor probability expressionsdistribution statistics numpybayesian inference distributions
probabilistic-computingsymbolic-math

More Mathematics packages