prophys.distributions

prophys.distributions#

Probability distributions whose parameters are symbolic expressions.

Univariate families (Gaussian, Weibull, Gumbel, …), circular and directional distributions, multivariate and data driven distributions, and dependence structures (GaussianCopula, Correlation, Independent). Every family builds log_prob and, where available, cdf, quantile, reparameterized sample and moments as differentiable expressions, so their parameters can be fitted or depend on other model quantities.

Classes

Distribution

Base class of all probability distributions.

TransformedDistribution

Distribution of f(X) for X ~ base and an invertible transform f.

Gaussian

Normal distribution with mean mean and standard deviation sigma.

Weibull

Weibull distribution in scale and shape form: p(x) = (k/lam) (x/lam)^(k-1) exp(-(x/lam)^k).

Exponential

Exponential distribution with rate rate: p(x) = rate exp(-rate x) for x >= 0.

LogNormal

Log normal distribution: log X is Gaussian with mean mu and standard deviation sigma.

Gamma

Gamma distribution with shape concentration and rate rate.

Beta

Beta distribution on (0, 1) with shape parameters alpha and beta.

Uniform

Continuous uniform distribution on [low, high].

Gumbel

Gumbel (type I extreme value) distribution for maxima, with location loc and scale scale.

TruncatedGaussian

Gaussian with a log density renormalized to the interval [low, high].

Bernoulli

Bernoulli distribution over {0, 1} with success probability prob.

Categorical

Categorical distribution over k categories, indexed from 0, with probabilities probs.

Poisson

Poisson distribution over nonnegative integer counts with mean rate.

VonMises

Von Mises distribution on the circle (radians), the circular analog of a Gaussian.

WrappedGaussian

Gaussian wrapped onto the circle, for angular quantities in radians.

DirectionalMixture

Joint distribution of a direction and a conditional intensity, such as a wind rose.

MultivariateGaussian

Multivariate normal distribution parameterized by its mean and the Cholesky factor of its covariance.

Mixture

Finite mixture of component distributions with (possibly learnable) weights.

Empirical

Data driven distribution defined by a fixed sample set, such as observed wind speeds.

Histogram

Piecewise constant density over histogram bins.

GaussianCopula

Joint distribution coupling arbitrary marginals through a Gaussian copula.

Correlation

Bivariate Gaussian copula between two marginals, with correlation rho = tanh(rho_raw).

Independent

Joint distribution of independent marginals (a product density).

Functions

corr_cholesky_from_raw

Return the lower Cholesky factor of a correlation matrix built from an unconstrained vector.

correlated_uniforms

Map independent standard normals to correlated uniforms of a Gaussian copula.