Higher-order $U$-statistics abound in fields such as statistics, machine learning, and computer science, but are known to be highly time-consuming to compute in practice. Despite their widespread appearance, a comprehensive study of their computational complexity is surprisingly lacking. This paper aims to fill this gap by presenting several results related to the computational aspect of $U$-statistics. First, we derive a useful decomposition from a $m$-th order $U$-statistic to a linear combination of $V$-statistics with orders not exceeding $m$, which are generally more feasible to compute. Second, we explore the connection between exactly computing $V$-statistics and Einstein summation, a tool often used in computational mathematics and quantum computing to accelerate tensor computations. Third, we provide an optimistic estimate of the time complexity for exactly computing $U$-statistics, based on the treewidth of a particular graph associated with the $U$-statistic kernel. The above ingredients lead to (1) a new, much more runtime-efficient algorithm to exactly compute general higher-order $U$-statistics, and (2) a more streamlined characterization of runtime complexity of computing $U$-statistics. We develop an accompanying open-source package called \texttt{u-stats} in both Python (https://github.com/zrq1706/U-Statistics-Python) and R (https://github.com/cxy0714/U-Statistics-R). We demonstrate through three examples in statistics that \texttt{u-stats} achieves impressive runtime performance compared to existing benchmarks. This paper also aspires to achieve two goals: (1) to capture the interest of researchers in both statistics and other related areas to further advance the algorithmic development of $U$-statistics and (2) to lift the burden of implementing higher-order $U$-statistics from practitioners.
翻译:高阶$U$-统计量广泛存在于统计学、机器学习和计算机科学等领域,但实践中已知其计算非常耗时。尽管其应用普遍,但对其计算复杂度的系统性研究却出奇地匮乏。本文旨在填补这一空白,提出多项与$U$-统计量计算相关的结果。首先,我们推导出一种有用的分解方法,将$m$阶$U$-统计量表示为阶数不超过$m$的$V$-统计量的线性组合,后者通常更易于计算。其次,我们探讨了精确计算$V$-统计量与爱因斯坦求和(一种常用于计算数学和量子计算中加速张量计算的工具)之间的联系。第三,我们基于与$U$-统计量核相关联的特定图的树宽,给出了精确计算$U$-统计量的乐观时间复杂度估计。上述要素催生了两项成果:(1)一种全新的、运行时效率显著提高的通用高阶$U$-统计量精确计算算法;(2)对$U$-统计量计算运行时复杂度的更精简刻画。我们开发了相应的开源软件包\texttt{u-stats},同时提供Python版本(https://github.com/zrq1706/U-Statistics-Python)和R版本(https://github.com/cxy0714/U-Statistics-R)。通过统计学中的三个实例,我们证明\texttt{u-stats}在运行时性能上优于现有基准。本文还力求实现两个目标:(1)吸引统计学及相关领域研究者的兴趣,以进一步推进$U$-统计量的算法发展;(2)减轻实践者在实现高阶$U$-统计量时的负担。