-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement: Convolution for probability distributions #204
Comments
I've looked at this request occasionally and been unsure how to approach it. On one hand, this allows users of the crate to rely on closed form convolutions without looking them up elsewhere and choose the appropriate parameters for a different distribution. It effectively offers a dynamic dispatch option for the sentiment below,
Since all our (discrete|continuous) distribution structs in the I've recently been thinking about a similar sentiment for another convenience which would behave as an optimization. Some distribution (families) are special cases of more general distributions, it would be useful if the constructor for distribution A could return distribution B which is an optimized special case of A. A trivial example might be zero width Uniform, zero width Triangle, and zero width Gaussian, all of these converge to a Dirac distribution. More usefully might be StudentsT distribution which can be the Cauchy or the Normal distribution depending on DOF. Now I'm not 100% sure these are the same problem, but from the lens of traits/interfaces, they appear to be at least up to how they're constructed, |
@YeungOnion You can create a new repository branch specifically for this topic, and when I have time, I will prepare an implementation to this branch for all the respective distributions. Then we can discuss something more tangible. Such features are useful within my current project, which is centered around stochastic process modeling. However, I only use a few distributions from this crate. I just think that contributing such functionality might be helpful for someone else. Possible toy use case: Observing a frog jumping. As a modeling distribution we can take Gamma one as a frog never jumping on negative distance and a distance itself is a real number. Using convolutions, we can ask: what distance is covered by 3 jumps, or what would be the probability that 4.2 meters is covered by 3 jumps. |
I opened a branch
|
Hi!
I would like to propose an extension of this crate with implementation of Convolution of probability distributions for all distributions which supports this operation.
Within my project I already have such implementation based on following traits applied to several distributions:
Examples of implementations:
It seems to me that these traits are general enough to cover all available cases. Your thoughts?
I can contribute into this, but only after somebody put a placeholder/example.
The text was updated successfully, but these errors were encountered: