Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Rician distribution #1387

Merged
merged 26 commits into from
Sep 30, 2021
Merged

Add Rician distribution #1387

merged 26 commits into from
Sep 30, 2021

Conversation

mchitre
Copy link
Contributor

@mchitre mchitre commented Aug 29, 2021

Rician distribution added as per #1290

@mchitre mchitre mentioned this pull request Aug 29, 2021
Copy link
Member

@devmotion devmotion left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! I added some comments and suggestions 🙂

src/univariate/continuous/rician.jl Show resolved Hide resolved
src/univariate/continuous/rician.jl Show resolved Hide resolved
src/univariate/continuous/rician.jl Outdated Show resolved Hide resolved
src/univariate/continuous/rician.jl Outdated Show resolved Hide resolved
src/univariate/continuous/rician.jl Outdated Show resolved Hide resolved
src/univariate/continuous/rician.jl Outdated Show resolved Hide resolved
src/univariate/continuous/rician.jl Outdated Show resolved Hide resolved
src/univariate/continuous/rician.jl Outdated Show resolved Hide resolved
src/univariate/continuous/rician.jl Outdated Show resolved Hide resolved
src/univariate/continuous/rician.jl Show resolved Hide resolved
@mchitre
Copy link
Contributor Author

mchitre commented Aug 30, 2021

@devmotion thanks for the comments. Will fix them after the parametrization approach is discussed and agreed on.

mchitre and others added 10 commits August 30, 2021 19:47
Co-authored-by: David Widmann <devmotion@users.noreply.github.com>
Co-authored-by: David Widmann <devmotion@users.noreply.github.com>
Co-authored-by: David Widmann <devmotion@users.noreply.github.com>
Co-authored-by: David Widmann <devmotion@users.noreply.github.com>
Co-authored-by: David Widmann <devmotion@users.noreply.github.com>
@mchitre
Copy link
Contributor Author

mchitre commented Aug 30, 2021

@devmotion All comments addressed. Accepted changes are marked resolved. Other comments are left open for you to take a look at my changes and then to mark resolved. Thanks.

@mchitre mchitre requested a review from devmotion August 30, 2021 13:14
@mchitre mchitre requested a review from devmotion August 31, 2021 15:57
src/univariate/continuous/rician.jl Outdated Show resolved Hide resolved
src/univariate/continuous/rician.jl Outdated Show resolved Hide resolved
src/univariate/continuous/rician.jl Outdated Show resolved Hide resolved
src/univariate/continuous/rician.jl Outdated Show resolved Hide resolved
src/univariate/continuous/rician.jl Outdated Show resolved Hide resolved
src/univariate/continuous/rician.jl Outdated Show resolved Hide resolved
src/univariate/continuous/rician.jl Outdated Show resolved Hide resolved
mchitre and others added 7 commits September 2, 2021 01:25
Co-authored-by: David Widmann <devmotion@users.noreply.github.com>
Co-authored-by: David Widmann <devmotion@users.noreply.github.com>
Co-authored-by: David Widmann <devmotion@users.noreply.github.com>
Co-authored-by: David Widmann <devmotion@users.noreply.github.com>
Co-authored-by: David Widmann <devmotion@users.noreply.github.com>
Co-authored-by: David Widmann <devmotion@users.noreply.github.com>
Copy link
Member

@devmotion devmotion left a comment

Choose a reason for hiding this comment

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

The PR looks very good, thanks a lot! I just had some minor suggestions, if tests pass I think we can merge it 🙂

I opened a PR to StatsFuns that fixes the Float32 issues (JuliaStats/StatsFuns.jl#124), so we shouldn't worry about them in this PR.

src/univariate/continuous/rician.jl Outdated Show resolved Hide resolved
src/univariate/continuous/rician.jl Outdated Show resolved Hide resolved
src/univariate/continuous/rician.jl Outdated Show resolved Hide resolved
src/univariate/continuous/rician.jl Outdated Show resolved Hide resolved
test/truncate.jl Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Sep 3, 2021

Codecov Report

Merging #1387 (99b74f9) into master (9ceb9a0) will increase coverage by 0.13%.
The diff coverage is 94.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1387      +/-   ##
==========================================
+ Coverage   82.86%   82.99%   +0.13%     
==========================================
  Files         116      117       +1     
  Lines        6676     6751      +75     
==========================================
+ Hits         5532     5603      +71     
- Misses       1144     1148       +4     
Impacted Files Coverage Δ
src/univariates.jl 74.46% <ø> (ø)
src/univariate/continuous/rician.jl 94.66% <94.66%> (ø)

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 9ceb9a0...99b74f9. Read the comment docs.

test/rician.jl Outdated Show resolved Hide resolved
mchitre and others added 6 commits September 5, 2021 14:04
Co-authored-by: David Widmann <devmotion@users.noreply.github.com>
Co-authored-by: David Widmann <devmotion@users.noreply.github.com>
Co-authored-by: David Widmann <devmotion@users.noreply.github.com>
Co-authored-by: David Widmann <devmotion@users.noreply.github.com>
@mchitre
Copy link
Contributor Author

mchitre commented Sep 5, 2021

But two still fail...

 MethodError: no method matching nchisqinvcdf(::Float64, ::Float64, ::Rational{Int64})
  Closest candidates are:
    nchisqinvcdf(::Union{Float64, Int64}, ::Union{Float64, Int64}, ::Union{Float64, Int64}) at /home/runner/.julia/packages/StatsFuns/vyFzQ/src/rmath.jl:89

because nchisqinvcdf doesn't support rationals.

To fix in StatsFuns too, or convert from rational to float while calling quantile on NoncentralChisq from Rician?

@devmotion
Copy link
Member

I extended the StatsFuns PR, it covers Rationals as well now.

@mchitre
Copy link
Contributor Author

mchitre commented Sep 9, 2021

@devmotion is there anything else needed from my end before we're ready to merge this?

@devmotion
Copy link
Member

No, the PR looks great 👍 I just wanted to wait for JuliaStats/StatsFuns.jl#125, I still hope that it can be merged within the next days/week. If it takes longer, I think we can just mark the median tests as broken for now.

@devmotion devmotion merged commit 9b98caa into JuliaStats:master Sep 30, 2021
@devmotion
Copy link
Member

Thanks for the PR, with StatsFuns 0.9.12 all tests pass now 🙂

@mchitre mchitre deleted the rician branch October 1, 2021 07:03
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.

3 participants