More stable implementation of neg_binomial_2_log_lpmf #1830
More stable implementation of neg_binomial_2_log_lpmf #1830bbbales2 merged 5 commits intostan-dev:developfrom
Conversation
|
Ready for review. Maybe @bbbales2 could take care of it? Hopefully we can get this in for the 2.23 release... Thanks! |
|
I am sure we can get it in. Note that this is a bugfix so the deadline is actually 20th of April. But if we can get it for the release candidate that would be even better. |
Jenkins Console Log Machine informationProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010CPU: G++: Clang: |
|
@serban-nicusor-toptal Looks like this test is popping up in downstream performance: Does that mean a computer crashed? Anything we can do to un-crash that haha? @martinmodrak this looks good to me. I'll merge after we get the tests figured out. |
|
Hey, reduced the parallel variable from 6 to 4 so we rule out that the load may crash the machine. Gonna restart the build. |
Jenkins Console Log Machine informationProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010CPU: G++: Clang: |
|
@serban-nicusor-toptal looks like it failed again. Ideas? |
Jenkins Console Log Machine informationProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010CPU: G++: Clang: |
|
Thanks @martinmodrak, it's in! And thanks for the help @serban-nicusor-toptal! |
Summary
These changes mirror those done for
neg_binomial_2_lpmfin #1497,binomial_coefficient_logis used to avoid the necessity to delegate to Poisson.Tests
neg_binomial_2_lpmf(n, exp(eta), phi)n = 0andn = 1Side Effects
The way the density is computed changed to improve stability, at the cost of tangling
etaandphitogether earlier, so less computation can be avoided whenpropto=trueandphiis fixed.Release notes
More stable implementation of neg_binomial_2_log_lpmf
Checklist
Math issue neg_binomial_2_log_lpmf is not stable for large phi #1495
Copyright holder: Institute of Microbiology of the Czech Academy of Sciences
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