When working with distributions it is very useful to have access to their density, their distribution function and their quantile function in addition to being able to sample from them. Furthermore, it is nice to be able to calculate their (theoretical, exact) moments. I think it makes sense to have all this functionality in a common interface.
This is implemented in the statrs crate. There is some overlap with rand, sampling is implemented there as well, but for a lot more distributions.
I see the following options:
- Only implement sampling in
rand. Port the missing distributions from statrs to rand.
- Also implement the theoretical properties of the distributions mentioned above in
rand, essentially duplicating statrs.
- Remove the distributions from
rand and suggest to use statrs instead.
What do you think?
When working with distributions it is very useful to have access to their density, their distribution function and their quantile function in addition to being able to sample from them. Furthermore, it is nice to be able to calculate their (theoretical, exact) moments. I think it makes sense to have all this functionality in a common interface.
This is implemented in the
statrscrate. There is some overlap withrand, sampling is implemented there as well, but for a lot more distributions.I see the following options:
rand. Port the missing distributions fromstatrstorand.rand, essentially duplicatingstatrs.randand suggest to usestatrsinstead.What do you think?