Skip to content
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

Added Dirac Distribution [Feature Request] #111

Merged
merged 2 commits into from Jun 5, 2020

Conversation

JulianKnodt
Copy link
Contributor

Hi, I wanted to use this library in a small side-project that I was thinking about, and I noticed that it was missing the Dirac distribution, https://en.wikipedia.org/wiki/Dirac_delta_function#As_a_distribution, which would've been useful for my use case.

Please let me know if there's anything I can do to fix this PR up to meet your standards, or anything at all!

Thanks for all your work on the library!

I was also curious if you've ever explored using the quickcheck crate for property based testing, as it seems that some of the tests for distributions are testing some basic property and could be reduced?

The dirac distribution is a trivial distribution but is useful for modelling certainty in
situations. This implementation is fairly simple in that most outputs are either 0, 1, Infinity,
or the point of the distribution.
Copy link
Collaborator

@boxtown boxtown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent PR! Love the documentation and looks clean, just let me know if you're all good for it to be merged

@JulianKnodt
Copy link
Contributor Author

I just started off with the normal distribution as a base, so I kept the format/comments there while I modified the functions. I didn't know how to implement the inverse_cdf/pdf functions, but I hope that's fine.

I noticed that I forgot to change some of the names in the documentation from normal, so I updated that. It should be good to go otherwise

@boxtown boxtown merged commit e929775 into statrs-dev:master Jun 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants