JuliaStats / Distributions.jl

A Julia package for probability distributions and associated functions.
Other
1.11k stars 415 forks source link

Request/Interest Empirical Distribution type similar to DiscreteNonParametric #1337

Open davibarreira opened 3 years ago

davibarreira commented 3 years ago

I'm opening this issue to see if the maintainers of this package are interested in a implementation of a Empirical Distribution type, similar to DiscreteNonParametric, but allowing the support to be multidimensional. I saw that there was a very old issue #358 where the user requested this, but there was no follow up.

I can see many situations where having this distribution could be useful. One example is in the package OptimalTransport.jl, where we make use of DiscreteNonParametric for the 1-D cases, but for multidimensional cases we have to use separate variables for the support and the probabilities. Other examples would be for performing sampling or bootstraping in datasets.

If there is interest in this new distribution, I could try implementing it.

devmotion commented 3 years ago

The discussion in https://github.com/alan-turing-institute/MLJBase.jl/issues/504 seems related.

cscherrer commented 3 years ago

If Distributions doesn't work out, we're very interested in more general distributions like this for MeasureTheory.jl

davibarreira commented 3 years ago

I have to take a look at MeasureTheory.jl. I find the project fascinating, but still haven't found an "excuse" to dive into it. But I'd be glad to contribute.

gdalle commented 3 years ago

I toyed with this concept a few months ago, and I still have some leftover code for a MultivariateCategorical, which is almost the same. Ping me if you want it!

devmotion commented 3 years ago

Ideally this should handle more general support types and not only multivariate or univariate variables if we generalize it.