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 noncentral hypergeometric distribution #255

Merged
merged 2 commits into from
Jul 7, 2014

Conversation

BigCrunsh
Copy link
Contributor

There are two noncentral hypergeometric distributions (Fisher and
Wallenius). Fisher's distribution is used for tests based on contigency
tables as the Fisher exact test (necessary for e.g. computing confidence
intervals).

@BigCrunsh BigCrunsh changed the title WIP Add noncentral hypergeometric distribution WIP: Add noncentral hypergeometric distribution Jun 30, 2014
@BigCrunsh BigCrunsh changed the title WIP: Add noncentral hypergeometric distribution WIP: Noncentral hypergeometric distribution Jun 30, 2014
@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 360f133 on BigCrunsh:add_noncentral_hypergeo into 9b897a2 on JuliaStats:master.

BigCrunsh added a commit to BigCrunsh/HypothesisTests.jl that referenced this pull request Jun 30, 2014
Distinction between central and minlike Fisher test
---
There are mulitple ways to define a p-value for the Fisher, or more
general, for 2 x 2 table test.  In order to implement
strongly consistent confidence intervals w.r.t the corresponding test,
we need to invert the corresponding test. Unfortunately, inverting the
minlike test does not necessarily lead to an interval. Thus, the default
version should be the central p-value with the corresponding interval.

Noncentral hypergeometric distribution
---
We need Fisher's noncentral hypergeometric distribution to compute
confidence intervals. See
JuliaStats/Distributions.jl#255.
BigCrunsh added a commit to BigCrunsh/HypothesisTests.jl that referenced this pull request Jun 30, 2014
Distinction between central and minlike Fisher test
---
There are mulitple ways to define a p-value for the Fisher, or more
general, for 2 x 2 table test.  In order to implement
strongly consistent confidence intervals w.r.t the corresponding test,
we need to invert the corresponding test. Unfortunately, inverting the
minlike test does not necessarily lead to an interval. Thus, the default
version should be the central p-value with the corresponding interval.

Noncentral hypergeometric distribution
---
We need Fisher's noncentral hypergeometric distribution to compute
confidence intervals. See
JuliaStats/Distributions.jl#255.
## Properties
binomial(n::Int64, kR::UnitRange{Int64}) = [binomial(n,k) for k in kR]
function logP(d::FisherNoncentralHypergeometric, k)
y = support(d)
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the difference between logP and logpdf?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

logP is perhaps not the right name. It is actually a helper function (see the box right in http://en.wikipedia.org/wiki/Fisher%27s_noncentral_hypergeometric_distribution) used, e.g., for calculating the mean.

@BigCrunsh BigCrunsh changed the title WIP: Noncentral hypergeometric distribution Add noncentral hypergeometric distribution Jul 3, 2014
There are two noncentral hypergeometric distributions (Fisher and
Wallenius). Fisher's distribution is used for tests based on contigency
tables as the Fisher exact test (necessary for e.g. computing confidence
intervals).
@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) when pulling 695fa77 on BigCrunsh:add_noncentral_hypergeo into 9b897a2 on JuliaStats:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.07%) when pulling d8f6e22 on BigCrunsh:add_noncentral_hypergeo into 9b897a2 on JuliaStats:master.

lindahua added a commit that referenced this pull request Jul 7, 2014
Add noncentral hypergeometric distribution
@lindahua lindahua merged commit cf5728b into JuliaStats:master Jul 7, 2014
@lindahua
Copy link
Contributor

lindahua commented Jul 7, 2014

Thanks!

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