# Random variables in Julia (working list)

**URL:** <https://discourse.julialang.org/t/random-variables-in-julia-working-list/48762>\
**Category:** Statistics\
**Tags:** distributions\
**Created:** [October 21, 2020, 5:18pm UTC](https://discourse.julialang.org/t/random-variables-in-julia-working-list/48762 "2020-10-21T17:18:20Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Albert\_Zevelev](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albert_zevelev/32/11844_2.png) [@Albert\_Zevelev](https://discourse.julialang.org/u/Albert_Zevelev)\
**Post date:** [October 21, 2020, 5:18pm UTC](https://discourse.julialang.org/t/random-variables-in-julia-working-list/48762/1 "2020-10-21T17:18:20Z")

</div>

Here is my summary of probability distributions in Julia.  
This is a Julia version of [CRAN Task View: Probability Distributions](https://cran.r-project.org/web/views/Distributions.html).

Packages with distributions:

| Package | Description | Note |
| --- | --- | --- |
| [Distributions](https://github.com/JuliaStats/Distributions.jl).jl | fit(), rand(), truncated(), mixture(), convolve(), product\_distribution(). 100+ distributions | Maintained. 585 stars. @ johnczito @ mbesancon |
| [StatsFuns](https://github.com/JuliaStats/StatsFuns.jl).jl | Wraps R. 14 distributions, 10 properties each | Maintained. |
| [Rmath](https://github.com/JuliaStats/Rmath.jl).jl | Wraps R. d-p-q-r | Maintained. |
| [GSL](https://github.com/JuliaMath/GSL.jl).jl | Wraps C. [38 distributions](https://www.gnu.org/software/gsl/doc/html/randist.html), 2 properties each rand() & cdf() | Maintained. |
| [SkewDist](https://github.com/STOR-i/SkewDist.jl).jl | fit() & rand(): SkewNormal, SkewTDist, MvSkewNormal, MvSkewTDist | Not registered. 4 years |
| [AlphaStableDistributions](https://github.com/org-arl/AlphaStableDistributions.jl).jl | fit() & rand(): AlphaStable, AlphaSubGaussian | Maintained. @baggepinnen |
| [PearsonDistribution](https://github.com/bdeonovic/PearsonDistribution.jl).jl | fit(): PearsonI - PearsonVII | Not registered. 2 years. @bdeonovic |
| [GeneralizedLambdaDistribution](https://github.com/bdeonovic/GeneralizedLambdaDistribution.jl).jl | fit(): GLD | Not registered. 2 years. @bdeonovic |
| [GKDistribution](https://github.com/bdeonovic/GKDistribution.jl).jl | fit(): GK | Not registered. 5 years. @bdeonovic |
| [PowerLaws](https://github.com/johnybx/PowerLaws.jl).jl | fit(): continuous/discrete power laws | 5 years. |
| [PowerLaw](https://github.com/afternone/PowerLaw.jl).jl | fit(): continuous/discrete power laws | 5 years. |
| [GenInvGaussian](https://github.com/LMescheder/GenInvGaussian.jl).jl | rand(): Generalized Inverse Gaussian | 5 years. |
| [MNIG](https://github.com/dylanfesta/MNIG.jl).jl | Multivariate Normal Inverse Gaussian | 2 years. |
| [QuadraticFormsMGHyp](https://github.com/s-broda/QuadraticFormsMGHyp.jl).jl | cdf(), E(): qfmgh | Maintained. @s-broda |
| [ProjectManagement](https://github.com/oxinabox/ProjectManagement.jl).jl | rand(): PertBeta | Maintained. @ oxinabox |
| [TweedieDistributions](https://github.com/jkbest2/TweedieDistributions.jl).jl | rand(): Tweedie, CompoundPoissonGamma | Maintained. @jkbest2 |
| [ConditionalMvNormals](https://github.com/jkbest2/ConditionalMvNormals.jl/tree/dev).jl | condition() | Not registered. 3 years. @jkbest2 |
| [RandomMatrices](https://github.com/JuliaMath/RandomMatrices.jl).jl | matrix-valued random variables | [Not maintained](https://github.com/JuliaMath/RandomMatrices.jl/issues/58). |
| [RandomMatrixDistributions](https://github.com/damian-t-p/RandomMatrixDistributions.jl).jl | matrix-valued random variables | Maintained |

Packages for numerical Expectations of functions of random variables:

| Package | Description | Note |
| --- | --- | --- |
| [Distributions](https://github.com/JuliaStats/Distributions.jl).jl | `expectation(dist, g)` use [QuadGK](https://github.com/JuliaMath/QuadGK.jl).jl, generic | Maintained. 585 stars on Github. |
| [Expectations](https://github.com/QuantEcon/Expectations.jl).jl | Use [FastGaussQuadrature](https://github.com/JuliaApproximation/FastGaussQuadrature.jl).jl, for certain distributions | Maintained |
| [DistQuads](https://github.com/pkofod/DistQuads.jl).jl | Use [FastGaussQuadrature](https://github.com/JuliaApproximation/FastGaussQuadrature.jl).jl, generic | 2 years @ pkofod |

Packages for fitting distributions:

| Package | Description | Note |
| --- | --- | --- |
| [FittingDistributions](https://github.com/dylanfesta/FittingDistributions.jl).jl | fit by reducing KL divergence | 2 years |
| [GaussianMixtures](https://github.com/davidavdav/GaussianMixtures.jl).jl | fit Gaussian Mixtures w/ EM | Maintained. @ davidavdav |
| [MixtureModels](https://github.com/lindahua/MixtureModels.jl).jl | Finite mixture models | 7 years |
| [MixFit](https://github.com/the-sushi/MixFit.jl).jl | fit mixtures w/ random-swap EM | Maintained |
| [BayesianNonparametrics](https://github.com/OFAI/BayesianNonparametrics.jl).jl | | 2 years |
| [BayesianMixtures](https://github.com/jwmi/BayesianMixtures.jl).jl | nonparametric Bayesian mixture models | 3 years |
| [DPMM](https://github.com/ekinakyurek/DPMM.jl).jl | | 1 year |
| [BIAS](https://github.com/adham/BIAS.jl).jl | | 5 years |

Packages for working with distributions:

| Package | Description | Note |
| --- | --- | --- |
| [ConditionalDists](https://github.com/aicenter/ConditionalDists.jl).jl | Conditional probability distributions powered by Flux.jl and Distributions.jl. | Maintained @vitskvara |
| [AlgebraPDF](https://github.com/mmikhasenko/AlgebraPDF.jl).jl | Create/fit/sample custom distributions | Maintained @ misha\_mikhasenko |
| [DensityRatioEstimation](https://github.com/JuliaEarth/DensityRatioEstimation.jl).jl | Estimate the density ratio | Maintained |
| [ZeroInflatedDistributions](https://github.com/jkbest2/ZeroInflatedDistributions.jl).jl | Construct & work w/ [Zero-inflated distributions](https://en.wikipedia.org/wiki/Zero-inflated_model) | Maintained @jkbest2 |
| [ExtremeStats](https://github.com/JuliaEarth/ExtremeStats.jl).jl | Fit heavy-tail distributions | Maintained |
| [GeoStats](https://github.com/JuliaEarth/GeoStats.jl).jl | Spatial distributions | Maintained |
| [MeasureTheory](https://github.com/cscherrer/MeasureTheory.jl).jl | make any Distribution easily usable as a Measure | Maintained. @ cscherrer |
| [MultivariateMoments](https://github.com/JuliaAlgebra/MultivariateMoments.jl).jl | moments of multivariate measures | Maintained. @blegat |

PPLs from [Chad’s list](https://discourse.julialang.org/t/julia-ppl-survey-paper/44879/3):

| Package | Description | Note |
| --- | --- | --- |
| [Gen](https://github.com/probcomp/Gen.jl).jl | PPL | 1.5k stars |
| [Turing](https://github.com/TuringLang/Turing.jl).jl | PPL | 1k stars |
| [Stheno](https://github.com/willtebbutt/Stheno.jl).jl | PPL | 209 stars @ willtebbutt |
| [Soss](https://github.com/cscherrer/Soss.jl).jl | PPL | 186 stars @ cscherrer |
| [Stan](https://github.com/StanJulia/Stan.jl).jl | Wrapper | 154 stars |
| [ForneyLab](https://github.com/biaslab/ForneyLab.jl).jl | PPL | 81 stars |
| [Omega](https://github.com/zenna/Omega.jl).jl | PPL | 70 stars @zennatavares |
| [Poirot](https://github.com/MikeInnes/Poirot.jl).jl | PPL | 58 stars @MikeInnes |
| [Jaynes](https://github.com/femtomc/Jaynes.jl).jl | PPL | 34 stars |

To be categorized:

| Package | Description | Note |
| --- | --- | --- |
| [EmpiricalDistributions](https://github.com/oschulz/EmpiricalDistributions.jl).jl | EmpiricalDistributions | Maintained @ oschulz |
| [EmpiricalCDFs](https://github.com/jlapeyre/EmpiricalCDFs.jl).jl | | Maintained @ jlapeyre |
| [InterpolatedPDFs](https://github.com/m-wells/InterpolatedPDFs.jl).jl | | Maintained @m-wells |
| [KDEstimation](https://github.com/m-wells/KDEstimation.jl).jl | | Maintained @m-wells |
| [ConjugatePriors](https://github.com/JuliaStats/ConjugatePriors.jl).jl | | Maintained @ oschulz |
| [CalibrationErrorsDistributions](https://github.com/devmotion/CalibrationErrorsDistributions.jl).jl | | Maintained @ devmotion |
| [BayesianTools](https://github.com/gragusa/BayesianTools.jl).jl | product() & link() | Not maintained |
| [Divergences](https://github.com/gragusa/Divergences.jl).jl | Divergences between two dist | Not maintained |
| [GaussianDistributions](https://github.com/mschauer/GaussianDistributions.jl).jl | | Maintained @ mschauer |
| [BAT](https://github.com/bat/BAT.jl).jl | Bayesian analysis toolkit | Maintained |
| [SMC](https://github.com/FRBNY-DSGE/SMC.jl).jl | Sequential Monte Carlo alternative to MH MCMC | Maintained |
| [DynamicHMC](https://github.com/tpapp/DynamicHMC.jl).jl | | Maintained @ Tamas\_Papp |
| [HigherOrderKernels](https://github.com/Godisemo/HigherOrderKernels.jl).jl | | Maintained |

1. please comment w/ relevant links I missed
2. note how much more [fragmented distributions in R](https://cran.r-project.org/web/views/Distributions.html) are compared to Julia.
3. note how much easier it is to work w/ random variables in Julia than R.  
See my [cheatsheet comparing Julia/Matlab/Base R/STATA](https://github.com/azev77/QuantEcon.cheatsheet/blob/master/stats-cheatsheet.rst).
4. A [PR](https://github.com/JuliaStats/Distributions.jl/pull/1104) to port SkewNormal to the maintained Distributions.jl from the unmaintained SkewDist.jl has been merged.  
When functionality from unmaintained packages are fully subsumed into well maintained packages, unmaintained packages will be removed from this working list.

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [October 21, 2020, 5:35pm UTC](https://discourse.julialang.org/t/random-variables-in-julia-working-list/48762/2 "2020-10-21T17:35:10Z")

</div>

Extreme distributions: [https://github.com/JuliaEarth/ExtremeStats.jl](https://github.com/JuliaEarth/ExtremeStats.jl)  
Spatial distributions: [https://github.com/JuliaEarth/GeoStats.jl](https://github.com/JuliaEarth/GeoStats.jl)

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [October 21, 2020, 5:44pm UTC](https://discourse.julialang.org/t/random-variables-in-julia-working-list/48762/3 "2020-10-21T17:44:39Z")

</div>

Measure theory: [https://github.com/cscherrer/MeasureTheory.jl](https://github.com/cscherrer/MeasureTheory.jl)

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [October 21, 2020, 5:46pm UTC](https://discourse.julialang.org/t/random-variables-in-julia-working-list/48762/4 "2020-10-21T17:46:06Z")

</div>

Density ratio estimation: [GitHub - JuliaML/DensityRatioEstimation.jl: Density ratio estimation in Julia](https://github.com/JuliaEarth/DensityRatioEstimation.jl)

---

<div class="post-metadata">

**Author:** ![cscherrer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cscherrer/32/7631_2.png) [@cscherrer](https://discourse.julialang.org/u/cscherrer)\
**Post date:** [October 21, 2020, 8:30pm UTC](https://discourse.julialang.org/t/random-variables-in-julia-working-list/48762/5 "2020-10-21T20:30:24Z")

</div>

A [Soss.jl](https://github.com/cscherrer/Soss.jl) model is a distribution over named tuples. We support `rand`, `logpdf`, all the usual PPL stuff, and also causal interventions.

I’d say @zennatavares’s [Omega.jl](https://github.com/zenna/Omega.jl) is also in this neighborhood.

And @mschauer has [GaussianDistributions.jl](https://github.com/mschauer/GaussianDistributions.jl).

---

<div class="post-metadata">

**Author:** ![Albert\_Zevelev](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albert_zevelev/32/11844_2.png) [@Albert\_Zevelev](https://discourse.julialang.org/u/Albert_Zevelev)\
**Post date:** [October 21, 2020, 9:49pm UTC](https://discourse.julialang.org/t/random-variables-in-julia-working-list/48762/6 "2020-10-21T21:49:29Z")

</div>

Thanks Chad.  
Originally my Task View list was only going to include packages w/ probability distributions.  
-\>My intention was to ease discovery & reduce fragmentation.

Then I reluctantly made a second list w/ packages for “working” w/ random variables.  
Then @juliohm & you gave some additional links. I’m not sure if there should be a separate Task View on PPL in Julia. I’ll include them in the mean time (but I don’t really use PPLs).

---

<div class="post-metadata">

**Author:** ![cscherrer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cscherrer/32/7631_2.png) [@cscherrer](https://discourse.julialang.org/u/cscherrer)\
**Post date:** [October 21, 2020, 10:13pm UTC](https://discourse.julialang.org/t/random-variables-in-julia-working-list/48762/7 "2020-10-21T22:13:05Z")

</div>

Thanks @Albert_Zevelev, I think having a list like this is a really great idea.

In terms of a taxonomy, things are already pretty fuzzy, and will only get fuzzier from here.

The Distributions.jl approach to this is more along the lines of classical statistics. There’s a big collection of “distributions people might want to use”, and the idea is mostly to just grab one and use it. There are just a few combinators like `Truncated`, but they’re mostly just kind of a bonus feature.

But then there are things like [Bijectors.jl](https://github.com/TuringLang/Bijectors.jl) from the Turing team (mostly @mohamed82008 , @torfjelde, and @devmotion) and [TransformVariables.jl](https://github.com/tpapp/TransformVariables.jl) from @Tamas_Papp. These define transforms from a “base distribution”. Whether or not the result is a Distribution, it’s certainly a distribution.

There are other PPLs of course; I mentioned Soss in particular because a Soss model is a distribution. So even if you never do Bayesian inference, you could use it as a handy way to define a distribution over named tuples.

My point is, it’s nice to have a list of commonly-used distributions, but this view is very limited. The real potential is in having flexible ways to create new distributions from existing ones. This goal has a nice intersection with PPL (in the common usage), but they’re not the same thing.

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [October 22, 2020, 1:37am UTC](https://discourse.julialang.org/t/random-variables-in-julia-working-list/48762/8 "2020-10-22T01:37:55Z")

</div>

@Albert_Zevelev just a heads up that Discourse blocks editing a post after some time. Maybe it would be a good idea to convert it into a GitHub repo, and share the link of the table you are constructing. People could then contribute to it with PRs.

We had [Julia.jl](https://github.com/svaksha/Julia.jl) as a community effort for a while, but it is not up-to-date unfortunately. Ideally, we would have a community-driven repository of working/maintained packages for different subjects.

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [October 22, 2020, 1:39am UTC](https://discourse.julialang.org/t/random-variables-in-julia-working-list/48762/9 "2020-10-22T01:39:28Z")

</div>

In particular, I tried to update the Prob & Stats section some time ago, I think I am the current maintainer: [https://github.com/svaksha/Julia.jl/blob/master/Probability-Statistics.md](https://github.com/svaksha/Julia.jl/blob/master/Probability-Statistics.md) We definitely need updates.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [October 22, 2020, 8:51am UTC](https://discourse.julialang.org/t/random-variables-in-julia-working-list/48762/10 "2020-10-22T08:51:15Z")

</div>

> [@cscherrer](#):
>
> My point is, it’s nice to have a list of commonly-used distributions, but this view is very limited. The real potential is in having flexible ways to create new distributions from existing ones.

I think that “canonical” distributions (more or less those available in Distributions.jl) are special because they have

1. O(1) IID sampling,
2. fairly accurate implementations for pdf/cdf/quantiles, where applicable,
3. in most cases, moments and other properties implemented.

Transformations of random variables are still random variables, but unless the result is another canonical distribution (eg affine transformations of a normal) they usually break 1 or 2, and almost always break 3. Eg MCMC is pretty much about the question of how to proceed in this case.

Personally I don’t see the problem with “fragmentation”. Smaller packages are easier to maintain and manage, and a lot Julia packages pulled this off neatly — eg Tables.jl & friends. I am even pushing for something similar for Distributions:

> <https://github.com/JuliaStats/Distributions.jl/issues/1139>
>
> Distributions.jl is a high-quality implementation of many commonly used distribu…tions, benefiting from continuous contributions and peer review from the members of the Julia community.
> 
> While it is natural to contribute commonly used distributions to this package, some distributions may not be generic enough to warrant this (eg distributions used in a very narrow subfield, invented for a specific application and not in widespread use yet, etc). We should nevertheless make it easy for distributions living in other packages to share the API without incurring the cost of dependencies that are used by Distributions.jl. Of course, distributions from such packages could be migrated to this one later on if necessary.
> 
> I am proposing that a minimal API is extracted to a small, lightweight package, which could be called DistributionsBase.jl, defining the 
> 
> 1. \*functions\* \`cdf\`, \`pdf\`, ... that operate on Distributions (from \[the current export list\](https://github.com/JuliaStats/Distributions.jl/blob/20c91d9efcc5f96913bf8e38be2e3fb14b21942b/src/Distributions.jl#L28-L254),
> 
> 2. a \`@reexport\_DistributionsBase\` macro that reexports these, for use by packages to make it easy to maintain a consistent common exported interface.
> 
> I am not sure that I would export the type hierarchy in the first pass, as I don't think would be used commonly by packages defining custom distributions. In any case, I would start with the bare minimum, more can be added on demand later.
> 
> (related: #525)

---

<div class="post-metadata">

**Author:** ![mschauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mschauer/32/13946_2.png) [@mschauer](https://discourse.julialang.org/u/mschauer)\
**Post date:** [October 22, 2020, 9:03am UTC](https://discourse.julialang.org/t/random-variables-in-julia-working-list/48762/11 "2020-10-22T09:03:20Z")

</div>

My thought is to have common infrastructure for generating dependent and independent samples from some law and query _known_ properties of the law of the random numbers and be able to formulate their known algebraic properties.

Distributions is too specialised (almost byzantine) to do this, so `MeasureTheory.jl` explores a space of something simpler but “with more connectors”, where the richer infrastructure can be build on top of it.  
Distributions has for example not a nice way giving the convolution of laws even in the cases where the convolution is known and has a closed form, e.g. `GaussianDistributions.jl` addresses this.

Think of it as the common denominator of `Distributions.jl` and `RandomExtensions.jl`?

---

<div class="post-metadata">

**Author:** ![johnczito](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@johnczito](https://discourse.julialang.org/u/johnczito)\
**Post date:** [October 22, 2020, 10:07am UTC](https://discourse.julialang.org/t/random-variables-in-julia-working-list/48762/12 "2020-10-22T10:07:06Z")

</div>

I always liked these remarks:

> [@Reworking Distributions.jl](https://discourse.julialang.org/t/reworking-distributions-jl/32339/33):
>
> All I was suggesting is that I prefer Distributions.jl to be an implementation of the distributions which have some sort of a closed-form characterization (this is obviously subjective, but let’s say you need at least a pdf and IID sampling; CDF/quantiles are optional, having at least a mean is nice when known in closed form, other moments as available). So, to me, the ideal Distributions.jl is just code implementing formulas and tables usually found in the appendix of some classical stats text…

It’s useful to have a package with the modest ambition of providing `Julia`’s answer to the `p-`, `q-`, `r-` functions for the standard distributions, which `Distributions.jl` currently does more or less well.

When it comes to all the fancy probabilistic programming stuff, is the overarching vision that `Julia`’s implementation of “the gamma distribution” is ultimately a special case of the same framework that addresses posterior sampling over tree spaces and things like that?

---

<div class="post-metadata">

**Author:** ![mschauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mschauer/32/13946_2.png) [@mschauer](https://discourse.julialang.org/u/mschauer)\
**Post date:** [October 22, 2020, 10:20am UTC](https://discourse.julialang.org/t/random-variables-in-julia-working-list/48762/13 "2020-10-22T10:20:47Z")

</div>

No, the goals are more modest of having something simple which doesn’t tend to go in the way by making a lot of specific traditional assumptions (e.g. all distributions are either float-continues, or integer-discrete, and all samples are either `<: Number' or `\<: Array`). You cannot even nicely represent a Spike and Slab or weighted samples in distributions.This allows to do more fancy things, that is nice of course, but posterior sampling over tree spaces is not the pressing motivation.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [October 22, 2020, 11:41am UTC](https://discourse.julialang.org/t/random-variables-in-julia-working-list/48762/14 "2020-10-22T11:41:27Z")

</div>

> [@mschauer](#):
>
> Distributions is too specialised (almost byzantine) to do this, so `MeasureTheory.jl` explores a space of something simpler

Yes, I think it is a very neat package and I am following it with interest.

---

<div class="post-metadata">

**Author:** ![bdeonovic](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bdeonovic/32/3928_2.png) [@bdeonovic](https://discourse.julialang.org/u/bdeonovic)\
**Post date:** [October 23, 2020, 1:24pm UTC](https://discourse.julialang.org/t/random-variables-in-julia-working-list/48762/15 "2020-10-23T13:24:58Z")

</div>

Hey look someone found my packages! If there is interest I will update them and make them more accessible. They were just quick implementations I made because I needed the functionality for another project.

---

<div class="post-metadata">

**Author:** ![bdeonovic](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bdeonovic/32/3928_2.png) [@bdeonovic](https://discourse.julialang.org/u/bdeonovic)\
**Post date:** [October 23, 2020, 1:25pm UTC](https://discourse.julialang.org/t/random-variables-in-julia-working-list/48762/16 "2020-10-23T13:25:21Z")

</div>

Also…my God where has the time gone…2 years?

---

<div class="post-metadata">

**Author:** ![Albert\_Zevelev](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albert_zevelev/32/11844_2.png) [@Albert\_Zevelev](https://discourse.julialang.org/u/Albert_Zevelev)\
**Post date:** [February 12, 2021, 6:36am UTC](https://discourse.julialang.org/t/random-variables-in-julia-working-list/48762/17 "2021-02-12T06:36:52Z")

</div>

A few updates:  
[Lognormals](https://github.com/bgctw/Lognormals.jl).jl  
[MVN CDF](https://discourse.julialang.org/t/mvn-cdf-have-it-coded-need-help-getting-integrating-into-distributions-jl/38631/15): Distributions.jl doesn’t yet have multi-var CDFs  
[ThorinDistributions](https://github.com/lrnv/ThorinDistributions.jl).jl

---

<div class="post-metadata">

**Author:** ![yoninazarathy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yoninazarathy/32/10086_2.png) [@yoninazarathy](https://discourse.julialang.org/u/yoninazarathy)\
**Post date:** [February 12, 2021, 11:40am UTC](https://discourse.julialang.org/t/random-variables-in-julia-working-list/48762/18 "2021-02-12T11:40:52Z")

</div>

Co-authors and I are working (slowly) on a package for multi-variate truncated distributions. Initially multi-variate normal. Also with the ability to fit parameters in cases where desired moments are specified, extending some early univariate idea [in this paper](https://people.smp.uq.edu.au/YoniNazarathy/pub/LiquetNazarathy2015.pdf). Related (although it doesn’t do moment matching) is this [R package, MomTrunc](https://cran.rstudio.com/web/packages/MomTrunc/MomTrunc.pdf).

Any suggestions or comments on how to best squeeze this in the current eco-system would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [February 14, 2021, 10:24am UTC](https://discourse.julialang.org/t/random-variables-in-julia-working-list/48762/19 "2021-02-14T10:24:17Z")

</div>

Put the primitives in their own package, under an MIT license, with extensive unit tests, and paclages that want this functionality can just use that.

---

<div class="post-metadata">

**Author:** ![Albert\_Zevelev](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albert_zevelev/32/11844_2.png) [@Albert\_Zevelev](https://discourse.julialang.org/u/Albert_Zevelev)\
**Post date:** [February 15, 2021, 12:15am UTC](https://discourse.julialang.org/t/random-variables-in-julia-working-list/48762/20 "2021-02-15T00:15:53Z")

</div>

> [@yoninazarathy](#):
>
> Any suggestions or comments on how to best squeeze this in the current eco-system would be greatly appreciated.

1. A pattern we see (at the top of this) is that when separate packages are created for individual distributions, they are less likely to be registered and more likely to stop being maintained when the creators no longer need them.  
[SkewDist](https://github.com/STOR-i/SkewDist.jl).jl, [PearsonDistribution](https://github.com/bdeonovic/PearsonDistribution.jl).jl, [GeneralizedLambdaDistribution](https://github.com/bdeonovic/GeneralizedLambdaDistribution.jl).jl, [GKDistribution](https://github.com/bdeonovic/GKDistribution.jl).jl, [PowerLaws](https://github.com/johnybx/PowerLaws.jl).jl, [PowerLaw](https://github.com/afternone/PowerLaw.jl).jl, [GenInvGaussian](https://github.com/LMescheder/GenInvGaussian.jl).jl, [MNIG](https://github.com/dylanfesta/MNIG.jl).jl, [ConditionalMvNormals](https://github.com/jkbest2/ConditionalMvNormals.jl/tree/dev).jl, [RandomMatrices](https://github.com/JuliaMath/RandomMatrices.jl).jl

2. Smaller packages are also harder to discover.  
Eg Users have searched for [SkewNormal](https://discourse.julialang.org/t/skew-normal-distribution/21549) w/o knowing about [SkewDist](https://github.com/STOR-i/SkewDist.jl).jl

3. There are far more eyes on bigger packages such as [Distributions](https://github.com/JuliaStats/Distributions.jl).jl. When a distribution is added there, other users regularly [report bugs](https://github.com/JuliaStats/Distributions.jl/issues/1276) & [submit PRs](https://github.com/JuliaStats/Distributions.jl/pulls) w/ bug fixes & improvements.  
For example, the Beta was added years ago by one set of users, but was improved/updated w/ [various PRs](https://github.com/JuliaStats/Distributions.jl/pull/1281) by other users over the years.  
Looking at the data above, users seem less likely to try to maintain & submit PRs to small private packages.

4. We’ve discussed the pros & cons of this on [Discourse](https://discourse.julialang.org/t/questions-about-contributing-to-distributions-jl/41530) & elsewhere.

Good luck w/ your decision & I can’t wait to try out your package.

[Next page](https://discourse.julialang.org/t/random-variables-in-julia-working-list/48762.md?page=2)
