mcx
mcx copied to clipboard
Support for other distributions
Hi,
Looks like there is support for lots of common distribution. There are a handful of other distributions which are not presently supported but could (fingers crossed) be easily implemented. Looking at [Stan's Function Reference] I see...
- [x] Beta Binomial
- [ ] Chi-Square
- [ ] Scaled Inverse Chisquare
- [ ] Inverse Chisquare
- [ ] Exponentially Modified Normal
- [ ] Skew Normal
- [ ] Logisitc
- [ ] Gumbel
- [x] Inverse Gamma
- [x] Weibull
- [ ] Frechet
- [ ] Pareto
- [ ] Rayleigh
- [x] HalfNormal
- [ ] Cauchy (implemented but not exposed: needs testing)
- [ ] HalfCauchy
- [x] Gamma (implemented but not exposed: needs testing)
- [ ] Laplace (implemented but not exposed: needs testing)
- [ ] StudentT (implemented but not exposed: needs testing)
Some multivariate distributions:
- [ ] Multinomial
- [ ] Wishart
- [ ] LKJCorr
- [ ] LKJCholesky
among other even more exotic distributions.
There are also some composite distributions:
- [ ] Bounded distributions (HalfNormal, HalfCauchy, etc)
- [ ] Mixture distributions
- [ ] Random Walks
Is there interest in implementing some of these distributions? A good portion of them are special cases (e.g. the chi-square is a special case of the gamma) and so it might be worth implementing them out of convenience, even if they just wrap their more general distributions.
Is there interest in implementing some of these? If so, I'd be up to implement a portion of them (if not only to familiarize myself the the PDFs but then also to work with JAX some more).
There definitely is an interest in implementing as many distributions as is possible!
I would first rank roughly by how often you think they're used, if that's not the case already (who am I to know?). Then you can pick whichever you like and open a PR to signal you're working on it.
Also, do you mind if I edit your post to add distributions I think are important and pin it in the issue tracker so others can see what's up for grabs?
Yea, go ahead and edit if you like.
I recently opened up a PR on jax to add the chisquare. If that goes well, I will make a PR here for chisquare and just go through the list.
I'd try my hand at the Beta-Binomial, i'll open a PR for it.
I'd also try my hand at the Pareto, I'll also open a PR for it.
I'll go ahead and try to do Weibull next. Will open another WIP PR
Update:
I just noticed that the min_weibull
function has been implemented in jax.random
but the pdf/logpdf of the distributions hasn't been implemented in jax.scipy.stats
yet. I could either a) implement it here in mcx
or b) open a PR in jax
to add it there before adding the distribution here. I suppose b is probably the better option.
I would open a PR in JAX.