-
Notifications
You must be signed in to change notification settings - Fork 85
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
[Feature]: adds support for Gumbel Distribution #285
Conversation
Looks good! Could you mention where you got the test values from in this PR? |
Hi @YeungOnion , I got the values from Wolfram alpha https://www.wolframalpha.com/input/?i=gumbel+distribution |
Good reference. "As accurate as Wolfram" is absolutely acceptable. Would you be able to reference some test suites in other libraries to find tail behavior we should test? My concern is because it is doubly exponential. -- below added when edited |
additionally, two admin-esque things
|
- Added basic struct and implementation of Gumbel Distribution and GumbelError
- Added cdf, inverse_cdf and sf for Gumbel - Added Min and Max traits for Gumbel - Added documentation for the same
- Added mean, skewness, variance and entropy for Gumbel distribution - Added documentation for the same
- Added median and mode traits - Added std deviation for the Distribution trait - Minor cleanups
- Added pdf and ln_pdf for Gumbel
- Added tests for mean, median, mode, min-max, std dev, variance, entropy - Added valid and invalid creation tests
- Added test for CDF and inverse_CDF
- Added tests for pdf, inverse_pdf and sf
c45da71
to
d64c2ba
Compare
Hi @YeungOnion , some unclear points:
I am not sure what you mean by "write up a conventional commit as a
|
I am not sure of any other Rust statistics lib that does Gumbel distribution. Sorry :( |
Oh I can clear those up
Yes, if just the first of these commits could instead be something like "feat: Add support for Gumbel..." then the tooling I use for the changelog will pick it up. Thanks for the rebase!
That's okay, I don't either. Just wanting to include potential extreme values that are included in other implementations (language agnostic) of Gumbel. I didn't find values tested against in the scripy suite, just a comparison to the Kappa4 distribution. Alternatively, you can choose some values that we should expect to be extreme to test each of the functions against. Motivating how large "extreme" is would be up to you. Floating point math is mostly magic to me. |
- Improved documentation for Gumbel - Added missing examples - Added Gumbel to mod.rs
d64c2ba
to
dbbec67
Compare
Hi @YeungOnion thanks for the reply.
Ok, got it... Pushed now feat: Add support for Gumbel distribution
I have to check that. I am not sure if/how I can find it. Since most of the values were matching till at least |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #285 +/- ##
==========================================
+ Coverage 93.94% 94.03% +0.08%
==========================================
Files 52 53 +1
Lines 11783 12053 +270
==========================================
+ Hits 11070 11334 +264
- Misses 713 719 +6 ☔ View full report in Codecov by Sentry. |
Agreed, it's hard to know hard far into the tail users will need to evaluate it. |
Our CI caught a need for conditional compile on the "rand" feature, this was just added in #275 so no worries that you missed it. Rust conditional compilations allows for including/excluding code based on some predicates, there's a crate feature that allows Would you add this |
- Fix added: rand feature added to distribution to fix CI error
Ok @YeungOnion , so I added #[cfg(feature = "rand")]
impl ::rand::distributions::Distribution<f64> for Gumbel {...} |
|
Solves #189
Added support for Gumbel distribution