Add ddof to PowerDivergenceTest and ChisqTest to allow changes to degrees of freedom#288
Open
sprague252 wants to merge 10 commits intoJuliaStats:masterfrom
Open
Add ddof to PowerDivergenceTest and ChisqTest to allow changes to degrees of freedom#288sprague252 wants to merge 10 commits intoJuliaStats:masterfrom
sprague252 wants to merge 10 commits intoJuliaStats:masterfrom
Conversation
This ddof parameter specifies the decrease in the number of degrees of freedom similar to the ddof parameter in scipy.stats.chisquare allowing users to change the number of degrees of freedom used to calculate p-values. This is important when the distribution probabilities are calculated using parameters from measured data (e.g., mean and sample standard deviation).
nalimilan
reviewed
Mar 12, 2023
This addresses the comment by nalimilan that the inserted explanation of ddof breaks up the comment on the `x` and `y` vectors.
…er_divergence.jl.
It works now!
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #288 +/- ##
==========================================
+ Coverage 90.04% 93.75% +3.70%
==========================================
Files 28 28
Lines 1467 1730 +263
==========================================
+ Hits 1321 1622 +301
+ Misses 146 108 -38 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #266
This change adds a new keyword parameter
ddoftoPowerDivergenceTestandChisqTestallowing users to change the number of degrees of freedom used for calculating p-values. This works the same as theddofparameter in scipy.stats.chisquare. See the documentation for that function athttps://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.chisquare.html.
The
ddofvalue defaults to 0 (no changes to the degrees of freedom). A supplied value forddofdecreases the number of degrees of freedom by the value ofddof. This is important when the distribution probabilities are calculated using parameters from measured data (e.g., mean and sample standard deviation), reducing the number of degrees of freedom.I updated the docstrings for
PowerDivergenceTestandChisqTestand added a test forChisqTestwithddof=2totest/power_divergence.jl. (It passes.)