|
5 | 5 | [](https://github.com/Santymax98/AdditionalDistributions.jl/actions/workflows/CI.yml?query=branch%3Amain) |
6 | 6 | [](https://codecov.io/gh/Santymax98/AdditionalDistributions.jl) |
7 | 7 |
|
8 | | -The [*AdditionalDistributions*](https://github.com/Santymax98/AdditionalDistributions.jl) package is a comprehensive extension of [*Distributions.jl*](https://github.com/JuliaStats/Distributions.jl). |
9 | | -It is designed to expand the functionality of the base package by incorporating both discrete and continuous probability distributions that are not included in `Distributions`, either due to their specialized nature or because they are less commonly used. |
10 | | -*AdditionalDistributions* aims to provide a broader range of statistical tools for data analysis, simulation, and probabilistic modeling, catering to both academic and scientific needs where these additional distributions are essential. |
11 | | - |
12 | 8 | --- |
13 | 9 |
|
14 | | -## Motivation and Relationship with Distributions.jl |
15 | | - |
16 | | -Although several additional distributions have been proposed for inclusion in `Distributions.jl` as early as [JuliaStats/Distributions.jl#124](https://github.com/JuliaStats/Distributions.jl/issues/124) (2013), many of them have not yet been integrated into the main package. |
17 | | -The motivation behind *AdditionalDistributions.jl* is therefore to provide a **flexible yet rigorous, API-compatible environment** for developing and testing both classical and new distribution families — **without compromising statistical quality, numerical stability, or consistency** with the `Distributions.jl` interface. |
| 10 | +**AdditionalDistributions.jl** extends the [Distributions.jl](https://github.com/JuliaStats/Distributions.jl) |
| 11 | +ecosystem by providing additional discrete, continuous, and multivariate probability |
| 12 | +distributions that are not yet available in the base package. |
18 | 13 |
|
19 | | -This package also serves as a foundation for future **multivariate** and **computationally optimized distributions**, designed for efficient integration with [`Copulas.jl`](https://github.com/lrnv/Copulas.jl), where the author is an active co-developer. |
20 | | -These implementations aim to offer faster, more stable probability evaluations for dependence modeling and simulation, while remaining interoperable with the broader JuliaStats ecosystem. |
| 14 | +It maintains full API compatibility (`pdf`, `cdf`, `rand`, etc.) and emphasizes |
| 15 | +**accuracy, efficiency, and completeness** — integrating advanced cumulative |
| 16 | +probability algorithms for multivariate Gaussian and Student’s *t* models. |
21 | 17 |
|
22 | 18 | --- |
23 | 19 |
|
24 | | -## Purpose and Scope |
| 20 | +## 🔹 Key Features |
25 | 21 |
|
26 | | -The purpose of `AdditionalDistributions.jl` is to serve as a well-maintained repository for distributions that are too exotic or specialized to be included in the main `Distributions.jl` package. |
27 | | -This includes distributions that are frequently required in specific fields of research but are not yet available in Julia, as well as new or experimental distributions that may not be widely used but have significant potential applications. |
| 22 | +- 📈 **Extensive library of distributions** — zero-inflated, generalized, and heavy-tailed families. |
| 23 | +- ⚡ **High-performance QMC algorithms** for multivariate CDFs (`MvGaussian`, `MvTStudent`), |
| 24 | + significantly faster than [MvNormalCDF.jl](https://github.com/JuliaStats/MvNormalCDF.jl) |
| 25 | + with minimal loss in absolute precision (typically within `1e-5`–`1e-6`). |
| 26 | +- 🧮 **Full API compatibility** with `Distributions.jl`. |
| 27 | +- 🧩 **Research-oriented architecture**, extensible to new distributional forms. |
| 28 | +- 🧠 **Reproducibility-focused testing**, with benchmarks aligned with *mvtnorm* (R, Genz & Bretz 2002). |
| 29 | + |
| 30 | +--- |
28 | 31 |
|
29 | | -For instance, you can define the following distributions (among many others): |
| 32 | +## 🚀 Example |
30 | 33 |
|
31 | 34 | ```julia |
32 | | -julia> using Distributions, AdditionalDistributions |
33 | | -julia> BetaNegBinomial(r, α, β) # Discrete univariate |
34 | | -julia> Lomax(α, λ) # Continuous univariate |
35 | | -julia> ZINB(r, θ, p) # Discrete univariate |
36 | | -julia> Gompertz(η, b) # Continuous univariate |
| 35 | +using AdditionalDistributions |
| 36 | + |
| 37 | +# Univariate and multivariate distributions |
| 38 | +d1 = Lomax(α=2.0, λ=3.0) |
| 39 | +d2 = ZINB(r=4, θ=0.7, p=0.2) |
| 40 | + |
| 41 | +pdf(d1, 1.5), cdf(d2, 3) |
| 42 | + |
| 43 | +# Accurate CDF for a multivariate t distribution |
| 44 | +Σ = [1.0 0.5; 0.5 1.0] |
| 45 | +d3 = MvTStudent(ν=5, Σ) |
| 46 | +cdf(d3, [-1.0, -1.0], [1.0, 1.0]) |
37 | 47 | ``` |
38 | 48 |
|
39 | | -These distributions, along with others like the ARGUS or Zero-Inflated Poisson (ZIP), are essential in various fields of research but are not included in the base `Distributions.jl` package. |
40 | | -`AdditionalDistributions.jl` provides these and more, ensuring that users have access to a broad spectrum of statistical tools. |
| 49 | +--- |
| 50 | + |
| 51 | +## 🧩 Performance Highlights |
| 52 | + |
| 53 | +| Algorithm | Library | Mean Error | Relative Speed | |
| 54 | +| ------------------------ | ---------------------------- | ---------- | ------------------ | |
| 55 | +| QMC–Sobol (this package) | `AdditionalDistributions.jl` | `≈ 1e-5` | **1.5×–3× faster** | |
| 56 | +| Adaptive Genz–Bretz | `MvNormalCDF.jl` | `≈ 1e-6` | slower | |
| 57 | +| QRSVN (R `mvtnorm`) | Reference | `≈ 1e-6` | — | |
| 58 | + |
| 59 | +Our implementation sacrifices a marginal amount of absolute precision |
| 60 | +for a substantial speedup in moderate to high dimensions (3–25). |
41 | 61 |
|
42 | 62 | --- |
43 | 63 |
|
44 | | -## Key Features |
| 64 | +## 🧭 Roadmap |
45 | 65 |
|
46 | | -* **Extensive Range of Distributions:** Includes a wide variety of distributions, some of which are not commonly found in standard statistical libraries. |
47 | | -* **Seamless Integration:** Fully compatible with `Distributions.jl`, allowing joint use with other packages in the Julia ecosystem. |
48 | | -* **Detailed Documentation:** Comprehensive references and examples for each implemented distribution. |
49 | | -* **Community-Driven Development:** Contributions are welcome — from new distributions to documentation improvements. |
| 66 | +* [ ] Add `Generalized Hyperbolic` and `Skew-t` families. |
| 67 | +* [ ] Implement flexible parameter fitting (`fit_mle`, `fit_map`). |
| 68 | +* [ ] Integrate symbolic representations for documentation. |
| 69 | +* [ ] Parallelize with threads |
| 70 | +* [ ] Maybe GPU-parallelized QMC backend (planned). |
50 | 71 |
|
51 | 72 | --- |
52 | 73 |
|
53 | | -## Maintaining Relevance and Utility |
| 74 | +## 🤝 Contributing |
54 | 75 |
|
55 | | -Given the importance of these additional distributions in various academic and scientific applications, we are committed to the ongoing maintenance and development of `AdditionalDistributions.jl`. |
56 | | -Our goal is to ensure that the package remains a valuable resource for the Julia community. |
57 | | -To support this, we are considering moving the package under the `JuliaStats` organization, which would provide additional support and visibility, ensuring its long-term sustainability. |
| 76 | +We welcome contributions! |
| 77 | +All code follows the design and testing conventions of |
| 78 | +[`Distributions.jl`](https://github.com/JuliaStats/Distributions.jl), |
| 79 | +ensuring consistency and interoperability. |
58 | 80 |
|
59 | | -With *AdditionalDistributions*, you can: |
| 81 | +### Guidelines |
60 | 82 |
|
61 | | -* **Sample from distributions:** Draw random samples from a variety of distributions. |
62 | | -* **Calculate moments and other properties:** Obtain moments (mean, variance, skewness, kurtosis), entropy, and other statistical metrics. |
63 | | -* **Evaluate probability density/mass functions:** Compute `pdf`, `logpdf`, and related functions. |
64 | | -* **Utilize moment-generating, quantile, and characteristic functions:** Access `mgf`, `quantile`, and `cf` for in-depth statistical analysis. |
| 83 | +* Open an issue to discuss bugs or ideas. |
| 84 | +* Use `@testitem`-based testsets (same as `Distributions.jl`). |
| 85 | +* Follow `Documenter.jl` docstring style and type annotations. |
65 | 86 |
|
66 | | ---- |
| 87 | +Pull requests improving: |
| 88 | + |
| 89 | +* distribution coverage, |
| 90 | +* algorithmic efficiency, |
| 91 | +* or documentation clarity are particularly encouraged. |
67 | 92 |
|
68 | | -## Future Directions |
| 93 | +--- |
69 | 94 |
|
70 | | -In future releases, we plan to implement **maximum-likelihood estimators**, expand **multivariate coverage**, and introduce **optimized numerical backends** to support efficient use within `Copulas.jl` and other packages in the JuliaStats and SciML ecosystems. |
| 95 | +**Author:** Santiago Jiménez |
| 96 | +**License:** MIT |
| 97 | +**Repository:** [Santymax98/AdditionalDistributions.jl](https://github.com/Santymax98/AdditionalDistributions.jl) |
0 commit comments