libmir / mir-stat

Dlang Statistical Package
http://mir-stat.libmir.org/
Other
12 stars 3 forks source link

Add negative binomial distribution #60

Closed jmh530 closed 2 years ago

jmh530 commented 2 years ago

negativeBinomialInvCDF is a little time-consuming for extreme values in a naive implementation, even with a good guess. I took some inspiration from R's version of it to get it working in a more efficient manner for some extreme values, but it's not exactly the same. A simple copy of R's version also wouldn't pass the unittests, I think, even if I wanted it to. Some adjustments versus R's version enable it to pass UTs here.

codecov-commenter commented 2 years ago

Codecov Report

Merging #60 (6349867) into master (f61a82f) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff            @@
##           master      #60    +/-   ##
========================================
  Coverage   99.92%   99.93%            
========================================
  Files          21       22     +1     
  Lines        2804     2930   +126     
========================================
+ Hits         2802     2928   +126     
  Misses          2        2            
Impacted Files Coverage Δ
source/mir/stat/distribution/negative_binomial.d 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us.