Skip to content

Instantly share code, notes, and snippets.

View linnabrown's full-sized avatar
🎯
Focusing

Lena Huang linnabrown

🎯
Focusing
View GitHub Profile
@linnabrown
linnabrown / distcorr.py
Created July 13, 2020 19:40 — forked from wladston/distcorr.py
Distance correlation with p-value
from scipy.spatial.distance import pdist, squareform
import numpy as np
import copy
def distcorr(Xval, Yval, pval=True, nruns=500):
""" Compute the distance correlation function, returning the p-value.
Based on Satra/distcorr.py (gist aa3d19a12b74e9ab7941)
>>> a = [1,2,3,4,5]
@linnabrown
linnabrown / distcorr.py
Created July 13, 2020 19:40 — forked from wladston/distcorr.py
Distance correlation with p-value
from scipy.spatial.distance import pdist, squareform
import numpy as np
import copy
def distcorr(Xval, Yval, pval=True, nruns=500):
""" Compute the distance correlation function, returning the p-value.
Based on Satra/distcorr.py (gist aa3d19a12b74e9ab7941)
>>> a = [1,2,3,4,5]