-
-
Notifications
You must be signed in to change notification settings - Fork 198
fix incorrect order of inputs within grad_reg_lower_inc_gamma
#3265
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
Conversation
grad_reg_lower_inc_gamma
syclik
left a comment
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.
LGTM!
| T1 tg = tgamma(a); | ||
| T1 dig = digamma(a); | ||
| return -grad_reg_inc_gamma(a, z, tg, dig, max_steps, precision); | ||
| return -grad_reg_inc_gamma(a, z, tg, dig, precision, max_steps); |
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.
Thanks! I double checked the function signature in grad_reg_inc_gamma.hpp.
Jenkins Console Log Machine informationNo LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.3 LTS Release: 20.04 Codename: focalCPU: G++: Clang: |
Summary
Fix swapped arguments. This impacts any distribution gradient that calls grad_reg_lower_inc_gamma.
As I'm fixing
gamma_lccdfI noticed some issues with extreme inputs. The swapped arguments meant the tail branch effectively used a huge “precision” (the old max_steps) and max_steps ≈ 0 (the old precision cast to int), which can cause incorrect/non-convergent behavior in the region where this branch is selected.Tests
Release notes
In
grad_reg_lower_inc_gamma()there is a call to 'grad_reg_inc_gamma()` this had swapped arguments for precision and max_steps. This impacts any distribution gradient that calls grad_reg_lower_inc_gamma.Checklist
Copyright holder: Publicis Groupe
The copyright holder is typically you or your assignee, such as a university or company. By submitting this pull request, the copyright holder is agreeing to the license the submitted work under the following licenses:
- Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)
- Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
the basic tests are passing
./runTests.py test/unit)make test-headers)make test-math-dependencies)make doxygen)make cpplint)the code is written in idiomatic C++ and changes are documented in the doxygen
the new changes are tested