Skip to content

Commit

Permalink
Change pvalue to evalue
Browse files Browse the repository at this point in the history
  • Loading branch information
lionelkusch committed Jan 7, 2025
1 parent 794310e commit 9c69a8f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/hidimstat/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,17 @@ def _bhq_threshold(pvals, fdr=0.1):
return -1.0


def _ebh_threshold(pvals, fdr=0.1):
def _ebh_threshold(evals, fdr=0.1):
"""e-BH procedure for FDR control (see Wang and Ramdas 2021)"""
n_features = len(pvals)
pvals_sorted = -np.sort(-pvals) # sort in descending order
n_features = len(evals)
evals_sorted = -np.sort(-evals) # sort in descending order
selected_index = 2 * n_features
for i in range(n_features - 1, -1, -1):
if pvals_sorted[i] >= n_features / (fdr * (i + 1)):
if evals_sorted[i] >= n_features / (fdr * (i + 1)):
selected_index = i
break
if selected_index <= n_features:
return pvals_sorted[selected_index]
return evals_sorted[selected_index]
else:
return np.inf

Expand Down

0 comments on commit 9c69a8f

Please sign in to comment.