Skip to content

Simplify wald logcdf method #4496

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

Merged
merged 4 commits into from
Mar 2, 2021
Merged

Conversation

ricardoV94
Copy link
Member

Closes #4436

return bound(
tt.switch(
~(right_limit | degenerate_dist),
a + tt.log1p(tt.exp(b - a)),
tt.lt(value, np.inf),
Copy link
Member Author

Choose a reason for hiding this comment

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

For example pm.Wald.dist(mu=1, lam=1).logcdf(1e310), will return 0 instead of nan this way. This behavior seems in line with other distributions I tested.

@twiecki twiecki requested a review from Spaak March 1, 2021 18:21
@Spaak
Copy link
Member

Spaak commented Mar 2, 2021

LGTM! Hang on a second, I resolved a conflict in the web browser but missed the tt to aet change. Will do it locally and push before I'll merge.

@ricardoV94
Copy link
Member Author

LGTM! Hang on a second, I resolved a conflict in the web browser but missed the tt to aet change. Will do it locally and push before I'll merge.

Thanks!

@Spaak Spaak merged commit ba186e3 into pymc-devs:master Mar 2, 2021
@Spaak
Copy link
Member

Spaak commented Mar 2, 2021

Thanks @ricardoV94!

@Spaak
Copy link
Member

Spaak commented Mar 2, 2021

Hmm we get a failed test:
FAILED pymc3/tests/test_distributions.py::TestMatchesScipy::test_wald_scipy

which still succeeded before the theano > aesara rename, and which also succeeds on my local master (which includes merging this PR). Let's see what happens on master CI.

@Spaak
Copy link
Member

Spaak commented Mar 2, 2021

OK on master CI all is good, except the known flaky test (#4323).

@ricardoV94
Copy link
Member Author

Thanks for checking. Will keep an eye on future runs to see if it ever reemerges

@ricardoV94 ricardoV94 deleted the simplify_wald_logcdf branch March 16, 2021 12:40
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.

Simplify Wald's logcdf method
2 participants