A fast algorithm for computing distance correlation
Preprint
Abstract
Classical dependence measures such as Pearson correlation, Spearman's $\rho$, and Kendall's $\tau$ can detect only monotonic or linear dependence. To overcome these limitations, \cite{szekely2007measuring} proposed distance covariance as a weighted $L_2$ distance between the joint characteristic function and the product of marginal distributions. The distance covariance is $0$ if and only if two random vectors ${X}$ and ${Y}$ are independent. This measure has the power to detect the presence of a dependence structure when the sample size is large enough. They further showed that the sample distance covariance can be calculated simply from modified Euclidean distances, which typically requires $\mathcal{O}(n^2)$ cost. The quadratic computing time greatly limits the application of distance covariance to large data. In this paper, we present a simple exact $\mathcal{O}(n\log(n))$ algorithm to calculate the sample distance covariance between two univariate random variables. The proposed method essentially consists of two sorting steps, so it is easy to implement. Empirical results show that the proposed algorithm is significantly faster than state-of-the-art methods. The algorithm's speed will enable researchers to explore complicated dependence structures in large datasets.
Keywords
All Related Versions
This publication has 9 references indexed in Scilit:
- Phylo_dCor: distance correlation as a novel metric for phylogenetic profilingBMC Bioinformatics, 2017
- Kernel-Based Tests for Joint IndependenceJournal of the Royal Statistical Society Series B: Statistical Methodology, 2017
- Large-scale kernel methods for independence testingStatistics and Computing, 2017
- Fast Computing for Distance CovarianceTechnometrics, 2016
- Inferring Nonlinear Gene Regulatory Networks from Gene Expression Data Based on Distance CorrelationPLOS ONE, 2014
- Equivalence of distance-based and RKHS-based statistics in hypothesis testingThe Annals of Statistics, 2013
- Feature Screening via Distance Correlation LearningJournal of the American Statistical Association, 2012
- Measuring and testing dependence by correlation of distancesThe Annals of Statistics, 2007
- The Art of Computer Programming, Vol. 3: Sorting and SearchingMathematics of Computation, 1974