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

Use StatsAPI.pvalue + StatsAPI.HypothesisTest #297

Merged
merged 4 commits into from
May 31, 2023
Merged

Use StatsAPI.pvalue + StatsAPI.HypothesisTest #297

merged 4 commits into from
May 31, 2023

Conversation

devmotion
Copy link
Member

Fixes #290.

The PR requires JuliaStats/Distributions.jl#1719. Keeping these definitions in HypothesisTests would be type piracy when pvalue is not owned by HypothesisTests anymore. Alternatively, the definitions for UnivariateDistributions could be moved to an internal _pvalue function but IMO they seem more generally useful, so I moved them to Distributions.

Project.toml Show resolved Hide resolved
src/power_divergence.jl Outdated Show resolved Hide resolved
test/bartlett.jl Outdated Show resolved Hide resolved
Co-authored-by: Alex Arslan <ararslan@comcast.net>
@codecov-commenter
Copy link

codecov-commenter commented May 9, 2023

Codecov Report

Patch coverage: 98.52% and project coverage change: -0.04 ⚠️

Comparison is base (a1713cf) 93.78% compared to head (b20efcd) 93.75%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #297      +/-   ##
==========================================
- Coverage   93.78%   93.75%   -0.04%     
==========================================
  Files          28       28              
  Lines        1739     1729      -10     
==========================================
- Hits         1631     1621      -10     
  Misses        108      108              
Impacted Files Coverage Δ
src/white.jl 97.43% <50.00%> (ø)
src/HypothesisTests.jl 78.57% <100.00%> (-4.77%) ⬇️
src/anderson_darling.jl 88.43% <100.00%> (ø)
src/augmented_dickey_fuller.jl 93.15% <100.00%> (ø)
src/bartlett.jl 100.00% <100.00%> (ø)
src/binomial.jl 92.22% <100.00%> (+0.55%) ⬆️
src/box_test.jl 93.75% <100.00%> (ø)
src/breusch_godfrey.jl 100.00% <100.00%> (ø)
src/circular.jl 77.77% <100.00%> (ø)
src/correlation.jl 100.00% <100.00%> (ø)
... and 15 more

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

@devmotion
Copy link
Member Author

Tests pass with the latest release of Distributions.

@@ -25,76 +25,23 @@
module HypothesisTests

using Statistics, Random, LinearAlgebra
using Distributions, Roots, StatsBase
Copy link
Member

Choose a reason for hiding this comment

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

Why change this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Initially it seemed as if we could get rid of the StatsBase dependency completely. It turned out that this is not the case but the five functions loaded below are needed + StatsBase.PValue for printing. Nevertheless, as with the imports of Combinatorics and Rmath in the lines below, explicitly importing these five functions seemed a bit clearer.

Copy link
Member

Choose a reason for hiding this comment

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

I don't personally find listing out every symbol to be particularly clarifying or useful but I know not everyone shares that opinion. :) In this case I'd prefer not to change the StatsBase bit as part of this PR as it seems like an unrelated change but I don't feel too strongly.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't have a completely strong opinion on this matter either. I wasn't 100% sure what changes you had in mind exactly, but I reverted this line and some related changes below. Is it better now?

Copy link
Member

Choose a reason for hiding this comment

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

It looks ✨ a m a z i n g ✨, apologies for the pedantry and for the delay, this got lost amidst a bunch of other notifications

@devmotion
Copy link
Member Author

Bump 🙂

Project.toml Show resolved Hide resolved
@ararslan ararslan merged commit 932eaac into master May 31, 2023
@ararslan ararslan deleted the dw/statsapi branch May 31, 2023 20:51
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.

Please extend pvalue from StatsAPI.jl
3 participants