Fast and light-weight energy statistics using the R package estats

Abstract

Energy statistics (--statistics) enable powerful non-linear dependence measures such as distance correlation, but their computational burden has limited application to large datasets. We present memory-efficient algorithms that compute --statistics related quantities by calculating pairwise distances on-the-fly rather than storing full distance matrices. Our methods achieve 5-156× speed improvements over existing implementations while reducing memory requirements from O(n2) to O(n). These advances enable energy statistics computation with sample sizes exceeding tens of thousands observations-previously infeasible with standard implementations-facilitating their use in modern applications across statistics, bioinformatics, and machine learning where large-scale datasets are frequently met. The following cases are demonstrated: energy distance, univariate and multivariate distance variance, distance covariance, (partial) distance correlation and hypothesis testing for the equality of univariate distributions. Functions to compute the aforementioned energy statistics, among others, are available in the R package estats.

0

Turn this paper into a full lesson

ArcXiv compiles a staged curriculum from this paper: 8-12 lessons across beginner → advanced, synthesised section guides, visuals, flashcards, a quiz, exercises, and on-demand deep dives per section. Grounded in the abstract, never invented.

Discussion (0)

Sign in to join the discussion.

Loading comments…