mHG.test {mHG}R Documentation

Perform Minimum-Hypergeometric test.

Description

Performs a minimum-hypergeometric (mHG) test. The null-hypothesis is that provided list was randomly and equiprobable selected from all lists containing N entries, B of which are 1s. The alternative hypothesis is that the 1s tend to appear at the top of the list.

Usage

mHG.test(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(NB) running time, O(NB) space.

Value

A list with class "htest" containing the following components:

statistic

The mHG statistic.

p.value

The p-value for the test.

parameters
  • N - total number of white and black balls.

  • B - number of black balls.

  • n_max - Max partition considered by the algorithm.

n

The index for which the mHG was obtained (smallest one if several n give the same mHG).

b

\sum\limits_{i=1}^n \lambda_i.

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-12, 18-20)

Examples

N <- 50
B <- 15
lambdas <- numeric(50)
lambdas[sample(N, B)] <- 1
t <- mHG.test(lambdas)
t <- mHG.test(lambdas, n_max = 20)

[Package mHG version 1.1 Index]