Skip to content

Conversation

@andreasnoack
Copy link
Member

This revealed some bugs in the untested bivariate T cdf. I've fixed the bugs and also added a few tests.

This revealed some bugs in the untested bivariate T cdf. I've fixed
the bugs and also added a few tests.
Comment on lines +245 to +247
# The source call the commented out line below. Instead we error out
throw(DomainError(nu, "degrees of freedom parameter must be positive"))
# return bvnuppercdf(-dh, -dk, r)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is, in tvpack.f this branch is supported? And we error since bvnuppercdf does not exist/was not copied?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do have bvnuppercdf but I think it's weird behavior to call it when the degrees of freedom parameter is non-positive.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see and I agree, it seems strange to support non-positive degrees. Maybe in tvpack it is just a way to encode the limit case of infinte degrees of freedom?

In any case, shouldn't tcdf be changed as well for consistency? That supports non-positive degrees of freedom as well it seems.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should. I hadn't noticed that. Will push an update.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading this again. The branch is for nu < 1. I'd read it as < 0. It doesn't makes sense at all to use the normal cdf when the degrees of freedom parameter is between zero and one. Not sure what the idea here was.

Co-authored-by: David Widmann <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Nov 10, 2022

Codecov Report

Base: 59.85% // Head: 75.34% // Increases project coverage by +15.48% 🎉

Coverage data is based on head (4728716) compared to base (e5699db).
Patch coverage: 60.00% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #148       +/-   ##
===========================================
+ Coverage   59.85%   75.34%   +15.48%     
===========================================
  Files          14       21        +7     
  Lines         568      653       +85     
===========================================
+ Hits          340      492      +152     
+ Misses        228      161       -67     
Impacted Files Coverage Δ
src/tvpack.jl 44.36% <60.00%> (+28.01%) ⬆️
src/rmath.jl 100.00% <0.00%> (ø)
src/StatsFuns.jl 100.00% <0.00%> (ø)
src/distrs/beta.jl 100.00% <0.00%> (ø)
src/distrs/pois.jl 100.00% <0.00%> (ø)
src/distrs/chisq.jl 100.00% <0.00%> (ø)
src/distrs/fdist.jl 100.00% <0.00%> (ø)
src/distrs/tdist.jl 100.00% <0.00%> (ø)
src/distrs/ntdist.jl 100.00% <0.00%> (ø)
src/distrs/hyper.jl 100.00% <0.00%> (ø)
... and 9 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@devmotion
Copy link
Member

It seems this PR is almost ready? Only https://github.com/JuliaStats/StatsFuns.jl/pull/148/files#r1019101826 is missing, it seems?

@andreasnoack
Copy link
Member Author

I'm not completely sure what to do with the issue mentioned in #148 (comment)

if VERSION >= v"1.7"
using JET
@testset "Static analysis" begin
@test isempty(JET.get_reports(report_package("StatsFuns", target_modules=(StatsFuns,))))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One could also use JET.test_package, e.g.,

Suggested change
@test isempty(JET.get_reports(report_package("StatsFuns", target_modules=(StatsFuns,))))
JET.test_package("StatsFuns", target_defined_modules=true)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or

Suggested change
@test isempty(JET.get_reports(report_package("StatsFuns", target_modules=(StatsFuns,))))
JET.test_package("StatsFuns", target_defined_modules=true)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants