-
-
Notifications
You must be signed in to change notification settings - Fork 188
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
add beta_neg_binomial_lcdf #3116
add beta_neg_binomial_lcdf #3116
Conversation
@lingium while it is very useful to keep each feature in a separate PR (thanks for doing this!), if you do have multiple things you want to add you can open several PRs at once, which might help with review lag-time. I think you said you also have an RNG for this distribution, and if so feel free to open a separate PR before this one is merged |
Hi @WardBrian , got you, Just thought this modification is too minor so I didn't open another PR. I'll make sure to open separate PRs for different things next time. Yes, there is a RNG. I can open it in parallel. |
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: |
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.
No notes!
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.
Blocking the merge on the test speed
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: |
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, looks good!
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
With this PR the lcdf of beta negative binomial distribution are added.
See issue #3115
Fix a few typos in beta_neg_binomial_lccdf, pr #3114.
Expressions involved (almost the same as #3114 , just add the chain rule from log ccdf to log cdf):
where$C(r,\alpha,\beta)$ is ccdf, we denote ${}_3F_2({1,r+y +1,\beta +y +1}; {y +2,r+\alpha +\beta +y +1};1)$ as ${}_3F_2(...)$
Then the partial derivatives w.r.t log ccdf:
where
By chain rule,
Therefore, the partial derivatives w.r.t log cdf:
Tests
Test is written follow the guide.
Side Effects
No.
Release notes
beta_neg_binomial_lcdf is available if merged.
Checklist
Copyright holder: Zhi Ling
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