mHG.statistic.calc {mHG}R Documentation

Calculate the minimum-hypergeometric (mHG) statistic.

Description

Calculates the minimum-hypergeometric (mHG) statistic.
mHG definition: mHG(\lambda)=min_{1<=n<N} HGT(b_n(\lambda))
Where HGT is the hypergeometric tail: HGT(b;N,B,n)=Probability(X>=b),
and b_n=\sum\limits_{i=1}^n \lambda_i.

Usage

mHG.statistic.calc(lambdas, n_max = length(lambdas))

Arguments

lambdas

\{0,1\}^N, sorted from top to bottom.

n_max

the algorithm will only consider the first n_{max} partitions.

Details

O(n_{max}+B^2*log(B)) running time, O(B) space.

Value

Instance of the class mHG.statistic.info (stores the statistics, and for which n and b_n it was obtained). If several n give the same mHG, the smallest one is chosen.

Author(s)

Kobi Perl

References

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 10-11, 18-19)

See Also

mHG.statistic.info-class

Examples

N <- 50
B <- 15
lambdas <- numeric(50)
lambdas[sample(N, B)] <- 1
mHG.statistic.info <- mHG.statistic.calc(lambdas)@mHG

[Package mHG version 1.1 Index]