mHG.pval.calc {mHG} | R Documentation |
Calculates the p-value associated with the (minimum-hypergeometric) mHG statistic.
mHG.pval.calc(p, N, B, n_max = N)
p |
the mHG statistic. It is marked as p as it represents an "uncorrected" p-value. |
N |
total number of white and black balls (according to the hypergeometric problem definition). |
B |
number of black balls. |
n_max |
the algorithm will calculate the p-value under the assumption that only the
first |
O(NB)
running time, O(NB)
space.
the p-value of the test.
Kobi Perl
Eden, E. (2007). Discovering Motifs in Ranked Lists of DNA Sequences. Haifa. Retrieved from http://bioinfo.cs.technion.ac.il/people/zohar/thesis/eran.pdf (pages 11-12, 19-20)
N <- 50
B <- 15
lambdas <- numeric(50)
lambdas[sample(N, B)] <- 1
p <- mHG.statistic.calc(lambdas)@mHG
p.corrected <- mHG.pval.calc(p, N, B) # Could have used mHG.test directly