JuliaStats / StatsFuns.jl

Mathematical functions related to statistics.
Other
235 stars 40 forks source link

Julia implementations for `poiscdf` and `poislogcdf` #112

Closed torfjelde closed 3 years ago

torfjelde commented 3 years ago

This PR adds Julia implementations for poiscdf and poislogcdf.

I'm a bit uncertain where tests for these should go, so I would appreciate some advice on that:)

codecov-io commented 3 years ago

Codecov Report

Merging #112 (a4a58dc) into master (bc45e18) will decrease coverage by 0.24%. The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #112      +/-   ##
==========================================
- Coverage   39.74%   39.50%   -0.25%     
==========================================
  Files          12       12              
  Lines         478      481       +3     
==========================================
  Hits          190      190              
- Misses        288      291       +3     
Impacted Files Coverage Δ
src/distrs/pois.jl 50.00% <0.00%> (-50.00%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update bc45e18...a4a58dc. Read the comment docs.

devmotion commented 3 years ago

The generic implementations of (log)pdf are compared with Rmath in https://github.com/JuliaStats/StatsFuns.jl/blob/master/test/generic.jl. Similarly, one should check the implementations of (log)cdf.

torfjelde commented 3 years ago

The generic implementations of (log)pdf are compared with Rmath in https://github.com/JuliaStats/StatsFuns.jl/blob/master/test/generic.jl. Similarly, one should check the implementations of (log)cdf.

Cool :+1: But there are some that already have these implemented, e.g. normcdf, but there doesn't exist a test similar to genericcomp for cdf already?

EDIT: If that's not the case, I'll imlement one ofc. I was just making sure given that there are already similar methods which I assumed were already tested.

devmotion commented 3 years ago

No, I think it is missing.

andreasnoack commented 3 years ago

Regarding the testing then see https://github.com/JuliaStats/StatsFuns.jl/pull/113. I think we should just start to use the native implementations unconditionally. Then they'll be tested automatically against the Rmath versions with the current test setup.

andreasnoack commented 3 years ago

@torfjelde It would be great to have this one completed. Do you expect to have the cycles to complete it soon?

torfjelde commented 3 years ago

It would be great to have this one completed. Do you expect to have the cycles to complete it soon?

Sorry, been quite busy lately. I'm travelling this weekend so won't be able to do much, but I'll try to get it done early next week if that's okay?

andreasnoack commented 3 years ago

No worries. I ended up doing it as part of #113

torfjelde commented 3 years ago

Btw, should we just close this PR then?

andreasnoack commented 3 years ago

Yeah. Let's do that (and then I'll have to get #113 completed)