Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion permute/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def two_sample(x, y, reps=10**5, stat='mean', alternative="greater",
the test statistic could be written:

f = lambda u, v: np.max( \
[abs(sum(u<=v)/len(u)-sum(v<=val)/len(v)) for val in np.concatenate([u, v])]\
[abs(sum(u<=val)/len(u)-sum(v<=val)/len(v)) for val in np.concatenate([u, v])]\
)

alternative : {'greater', 'less', 'two-sided'}
Expand Down
4 changes: 2 additions & 2 deletions permute/npc.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def fisher(pvalues):
float
Fisher's combined test statistic
"""
return -2 * np.log(np.prod(pvalues))
return -2 * np.sum(np.log(pvalues))


def liptak(pvalues):
Expand Down Expand Up @@ -287,4 +287,4 @@ def fwer_minp(pvalues, distr, combine='fisher', alternatives='greater'):
pvalues_adjusted[jj] = np.max([next_pvalue, pvalues_adjusted[jj-1]])
pvalues_adjusted[j-1] = np.max([pvalues_ord[j-1], pvalues_adjusted[j-2]])
pvalues_adjusted = pvalues_adjusted[np.argsort(pvalues)]
return pvalues_adjusted
return pvalues_adjusted