mHG.test: Perform Minimum-Hypergeometric test.

Description Usage Arguments Details Value Author(s) References Examples

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

1
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 over 1 <= i <= n of lambdas[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

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

Example output



mHG documentation built on May 2, 2019, 2:14 p.m.