UniDist.jl

Experimental

This package is experimental. The API may change without notice in future versions.

UniDist.jl is a Julia package for working with univariate probability distributions. It provides a consistent, intuitive API for computing probability density functions, cumulative distribution functions, quantiles, random sampling, and more.

Key Features

  • 70+ distributions: 19 discrete and 54 continuous distributions
  • Vectorized parameters: Pass arrays as distribution parameters for batch computations
  • Familiar API: Follows Julia's Distributions.jl conventions
  • R-style shortcuts: Optional d, p, q, r functions for users familiar with R
  • Survival analysis: Built-in survival function, hazard, and cumulative hazard
  • Statistical intervals: Equal-tailed intervals and highest density intervals (HDI)

Package Overview

using UniDist

# Create a distribution
d = Normal(0.0, 1.0)

# Compute probabilities
pdf(d, 0.0)       # 0.3989...
cdf(d, 1.96)      # 0.975...

# Generate samples
samples = r(d, 1000)

# Statistical intervals
interval(d, 0.05)  # 95% confidence interval
hdi(d, 0.95)       # 95% highest density interval

Documentation Structure

Quick Comparison with Other Packages

FeatureUniDist.jlDistributions.jl
Core API (pdf, cdf, quantile)YesYes
R-style shortcuts (d, p, q, r)YesNo
Survival functionsYesPartial
HDI intervalsYesNo
Vectorized parametersYesLimited

References

This package is inspired by and based on the comprehensive survey of univariate distribution relationships:

Leemis, L. M., & McQueston, J. T. (2008). Univariate Distribution Relationships. The American Statistician, 62(1), 45–53. https://doi.org/10.1198/000313008X270448

The paper provides a detailed chart showing the relationships between 76 univariate distributions, including transformations, special cases, and limiting relationships.

License

UniDist.jl is released under the MIT License. See LICENSE for details.