Feature/issue 333 fix gamma q chain - #418
Conversation
…l_math.hpp. This doesn't solve the infinite loop problem.
|
Test FAILed. |
|
Jenkins, retest this please. |
|
Just an implementation note -- I was playing around with this over the weekend On Nov 27, 2013, at 2:41 AM, Daniel Lee notifications@github.com wrote:
|
|
Test FAILed. |
|
I'm beginning to understand what a heroic effort I'm OK with just constraining the domains until we can
On 11/27/13, 4:07 AM, Michael Betancourt wrote:
|
|
It's a good thing we have so many tests in place. The chi-square I'll resubmit when I have a fix. On Wed, Nov 27, 2013 at 11:50 AM, Bob Carpenter notifications@github.comwrote:
|
|
Test PASSed. |
Summary: What does this pull request do in general terms?
Fixes #333. Prevents an infinite loop in the derivative of the
gamma_qfunction by throwing an exception. Removed duplicated code ingamma_q; calling function in src/stan/prob/internal_math.hpp instead.Intended Effect: What is the expected effect of the pull request? Specifically, indicate how the behavior will be different than before the pull request.
Instead of getting stuck in an infinite loop, throws a
std::domain_error. This is done in internal_math.hpp, in thestan::math::gradRegIncGammafunction.How to Verify: How can reviewers verify the request has the intended effect? This should include descriptions of any new tests that are added or old tests that are updated. It should also indicate how the code was tested.
Reviewer can run two tests:
make test/agrad/rev/gamma_qmake test/math/prob/internal_math2 additional tests in src/test/agrad/rev/gamma_q_test.cpp that triggered the infinite loop before the fix:
2 new tests in src/test/agrad/rev/internal_math_test.cpp
Side Effects: Does the pull request contain any side effects?
No.
Documentation: If the pull request is user facing, how is it documented? Are there examples of how to use the new behavior that users need to know about?
N/A. Internal math function.
Reviewer Suggestions: Who should look at the pull request for code review?
@bob-carpenter: a question about efficiency. Is the check too expensive?