superexacttestpy.tl.cpsets_sim

superexacttestpy.tl.cpsets_sim(x, set_len, n, lower_tail=True, logp=False, number_sim=10000)

Function to simulate the intersection probability on multisets

Parameters:
x : int

Number of elements x

nl : int

Number of sublists in data

set_len : list

List of length for all sublists in data

n : bool

Length of total background

lower_tail : bool

If True, the probability is P[overlap < m], otherwise, P[overlap >= m], where m is the number of elements shared by all sets.

logp : bool

The result should be with a log scale

number_sim : int

Number of simulations

Returns:

p – Probability

Return type:

float

Example

>>> cpsets_sim(18,[100,200,50],10000,True,False)
... 0.0002