Skip to content

Instantly share code, notes, and snippets.

Jonathan Simon jonadsimon

View GitHub Profile
View jensen_shannon_divergence.py
from scipy.stats import entropy
def jensen_shannon_div(p, q):
m = (p + q) / 2
return (entropy(p, m) + entropy(q, m)) / 2.0
@jonadsimon
jonadsimon / benjamini_hochberg_procedure.py
Created Jun 12, 2018
Perform the Benjamini-Hochberg Procedure in Python
View benjamini_hochberg_procedure.py
from statsmodels.sandbox.stats.multicomp import multipletests
reject, pvals_corrected, alphacSidak, alphacBonf = multipletests(p_values, alpha=0.2, method='fdr_bh')
@jonadsimon
jonadsimon / mann_whitney_u_test.py
Created Jun 12, 2018
Perform Mann-Whitney U Test in Python
View mann_whitney_u_test.py
from scipy.stats import mannwhitneyu
statistic, pvalue = mannwhitneyu(agent_durations, population_durations, use_continuity=True, alternative='two-sided')
You can’t perform that action at this time.