limix.stats.empirical_pvalues

limix.stats.empirical_pvalues(xt, x0)[source]

Function to compute empirical p-values.

Compute empirical p-values from the test statistics observed on the data and the null test statistics (from permutations, parametric bootstraps, etc).

Parameters:
  • xt (array_like) – Test statistcs observed on data.
  • x0 (array_like) – Null test statistcs. The minimum p-value that can be estimated is 1./float(len(x0)).
Returns:

Estimated empirical p-values.

Return type:

array_like

Examples

>>> from numpy.random import RandomState
>>> from limix.stats import empirical_pvalues
>>>
>>> random = RandomState(1)
>>> x0 = random.chisquare(1, 5)
>>> x1 = random.chisquare(1, 10000)
>>>
>>> empirical_pvalues(x0, x1) 
array([0.563 , 1.    , 0.839 , 0.7982, 0.5803])