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./len(x0)
.
- Returns
pvalues – Estimated empirical p-values.
- Return type
ndarray
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.56300000, 1.00000000, 0.83900000, 0.79820000, 0.58030000])