Repository navigation
Move the beta, neg_binomial and student_t cdfs to the new grad_reg_inc_beta (part 3 of #3409) - #3490
Draft
SteveBronder wants to merge 1 commit into
Draft
SteveBronder wants to merge 1 commit into
SteveBronder wants to merge 1 commit into
Conversation
… cdfs beta_cdf computes both shape partials in one root call. The lcdf and lccdf functions call the GRAD_RIB overload for only the partials needed.
This was referenced Oct 26, 2026
SteveBronder
added a commit
that referenced
this pull request
Oct 26, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 3 of 3 of the split of #3409. Stacked on part 2, #3489 (base
stable-inc-beta-rev). #3433 follows this PR.Summary
Moves the downstream cdfs onto the
grad_reg_inc_betaof #3409. Each file gets the same edit: drop the precomputed digamma buffers and thebeta(a, b)argument, and callgrad_reg_inc_beta<GRAD_RIB::G1>,<GRAD_RIB::G2>or<GRAD_RIB::BOTH>for only the partials that are needed.beta_cdfnow computes both shape partials in one root call instead of callinginc_beta_ddaandinc_beta_ddb.neg_binomial_cdfis larger than the others: it is rewritten in vectorized form, so review it on its own.The values of the distributions do not change. Only the gradients change. The accuracy study and the benchmarks are in the description of #3409.
Files
beta_cdf,beta_lcdf,beta_lccdfbeta_proportion_lcdf,beta_proportion_lccdfneg_binomial_cdf,neg_binomial_lcdf,neg_binomial_lccdf,neg_binomial_2_cdfstudent_t_cdf,student_t_lcdf,student_t_lccdftest/unit/math/rev/prob/beta_cdf_test.cpp(new):beta_cdfshape partials at theb ≫ apoint, with both shapes as autodiff variables and with each shape alone.test/unit/math/rev/prob/beta_cdf_log_test.cpp(new):beta_lcdfshape gradients at the NaN point, at the dropped-term point and at an integer shape.Release notes
See #3409.
Checklist
Copyright holder: Aalto University
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
the code is written in idiomatic C++ and changes are documented in the doxygen
the new changes are tested