Replace Rmath noncentral beta with pure Julia implementation#206
Draft
andreasnoack wants to merge 2 commits intoan/normath-hyperfrom
Draft
Replace Rmath noncentral beta with pure Julia implementation#206andreasnoack wants to merge 2 commits intoan/normath-hyperfrom
andreasnoack wants to merge 2 commits intoan/normath-hyperfrom
Conversation
Port hypergeometric distribution functions from Ian Smith's VBA code, removing the dependency on Rmath for all 10 hyper functions (pdf, logpdf, cdf, ccdf, logcdf, logccdf, invcdf, invccdf, invlogcdf, invlogccdf). Add helper functions logfbit, lfbaccdif1, and ab_minus_cd to misc.jl for accurate Stirling correction and cross-product computation.
Port all 10 noncentral beta distribution functions from Rmath to pure Julia, based on VBA code by Ian Smith. Core CDF computation uses Poisson-weighted sum of incomplete beta function values (beta_nc1/comp_beta_nc1). Inverse CDF uses Newton-Raphson with Abramowitz & Stegun 26.6.26 initial estimate. Add reusable helpers to misc.jl: - _poisson_term: high-precision Poisson PMF via Stirling corrections - _binomial_term: high-precision binomial PMF via Stirling corrections - _logdif: accurate log(pr/prob) for Newton iteration
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #206 +/- ##
==========================================
- Coverage 72.39% 69.44% -2.95%
==========================================
Files 22 22
Lines 1007 1774 +767
==========================================
+ Hits 729 1232 +503
- Misses 278 542 +264 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
1fb08c5 to
22aa7c9
Compare
d6121e3 to
a6b520b
Compare
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.
Summary
misc.jl:_poisson_term,_binomial_term,_logdifTest plan
rmathcomp_tests🤖 Generated with Claude Code