-
Notifications
You must be signed in to change notification settings - Fork 88
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 ddof to PowerDivergenceTest and ChisqTest to allow changes to degrees of freedom #288
base: master
Are you sure you want to change the base?
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).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
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 ReportPatch coverage:
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
... and 27 files with indirect coverage changes 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 in Codecov by Sentry. |
Resolves #266
This change adds a new keyword parameter
ddof
toPowerDivergenceTest
andChisqTest
allowing users to change the number of degrees of freedom used for calculating p-values. This works the same as theddof
parameter in scipy.stats.chisquare. See the documentation for that function athttps://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.chisquare.html.
The
ddof
value defaults to 0 (no changes to the degrees of freedom). A supplied value forddof
decreases 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
PowerDivergenceTest
andChisqTest
and added a test forChisqTest
withddof=2
totest/power_divergence.jl
. (It passes.)