-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Adding Generalized Extreme Value Distribution #4
Conversation
Definitely!
I don't have a strong opinion here. Feel free to set the standard
Seems fine to me to use explicit imports in every file
As you wish. The advantage of keeping a similar strategy is that it would make upgrading experimental features to PyMC easier
Have you ran the tests locally?
I think you are exactly on the right track
Awesome 👍 |
@ricardoV94 I've updated per discussion and One thing: the tests won't run locally because of pydata/xarray#6039 - not sure if you can replicate? Please review - I suppose there are two reviews in a way...1) the more general |
Something went wrong with my last commit - this new one has those comments addressed. Thanks! |
def get_moment(value_var, size, mu, sigma, xi): | ||
r""" | ||
Using the mode, as the mean can be infinite when :math:`\xi > 1` | ||
""" | ||
mode = at.switch( | ||
at.isclose(xi, 0), mu, mu + sigma * (at.pow(1 + xi, -xi) - 1) / xi | ||
) | ||
return at.full(size, mode, dtype=aesara.config.floatX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the last thing, can you add tests for the moment? You can borrow the helper from test_distribution_moments
in the main repo
) | ||
|
||
|
||
class TestMatchesScipyX(TestMatchesScipy): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this rerun all the tests in the baseclass? In a discussion with @canyon289 it seemed like that was the case
@ricardoV94 After a delay, I'm trying to close this out. To the outstanding questions:
There's been quite a few changes across both repos since March and the tests aren't succeeding locally now for me. If they fail on push, then reckon I'll need your help to close it out. More broadly; we've been using this distribution a lot in our work and this implementation is very stable once data is properly centered. It would be a good addition to the main repo. |
c21da86
to
f560e1e
Compare
Continued as #84 due to rebase. |
Follows from pymc-devs/pymc#5085
@ricardoV94 This is an initial not-working commit to see if you agree with the structure. There are a couple of things worth discussing:
pymc
itself here - any existing distributions/functions/utilities there should just be imported here.__init__
GenExtreme
; however, I wonder if it would be better to have a generic set of imports that all/most experimental distributions could just use (even if the rather blunt star import).pymc
and perhaps just a lower level pytest format is acceptable?pymc
installed, right?Can you review what I've done so far, and if it's on the right track I'll get it working.
Once we agree the plumbing, I'll update the Case Study example PR accordingly.
Cheers!