Skip to main content
QUICK REVIEW

[Paper Review] Computing the Bergsma Dassios sign-covariance

Yair Heller, Ruth Heller|arXiv (Cornell University)|May 27, 2016
Random Matrices and ApplicationsMathematics11 citations
TL;DR

This paper presents an optimized algorithm to compute the Bergsma-Dassios sign-covariance in O(n²) time, improving upon prior O(n² log n) and O(n⁴) methods. By leveraging efficient cumulative distribution computation via rank-based preprocessing and constant-time range queries, the method achieves quadratic time complexity while maintaining exactness for both tied and untied data.

ABSTRACT

Bergsma and Dassios (2014) introduced an independence measure which is zero if and only if two random variables are independent. This measure can be naively calculated in $O(n^4)$. Weihs et al. (2015) showed that it can be calculated in $O(n^2 \log n)$. In this note we will show that using the methods described in Heller et al. (2016), the measure can easily be calculated in only $O(n^2)$.

Motivation & Objective

  • To reduce the computational complexity of computing the Bergsma-Dassios sign-covariance from O(n⁴) and O(n² log n) to O(n²).
  • To enable fast, exact computation of the independence measure for both tied and untied data.
  • To demonstrate that the method from Heller et al. (2016) can be adapted to achieve optimal time complexity for this statistic.
  • To provide a practical, scalable algorithm suitable for large-scale independence testing in multivariate statistics.

Proposed method

  • Transform original data into ranks to reduce the problem to a combinatorial counting task over discrete ordered pairs.
  • Construct a 2D empirical cumulative distribution function A(r,s) over rank pairs in O(n²) time using dynamic programming on a grid.
  • Use the cumulative distribution A(r,s) to compute M< and M> counts in O(1) time per pair (k,l) via range queries.
  • For tied data, extend the cumulative structure to handle multiple observations at the same rank using row-wise cumulative sums.
  • Compute the discordant quadruple count Nd(k,l) using auxiliary counts (top, mid, bot, eqMin, eqMax) derived from A(r,s) in O(1) per pair.
  • Handle the complex last term in the discordance formula using a secondary cumulative structure A(r,s) that tracks squared counts of tied observations.

Experimental results

Research questions

  • RQ1Can the Bergsma-Dassios sign-covariance be computed in O(n²) time for both tied and untied data?
  • RQ2What is the minimal computational overhead required to compute this independence measure beyond the naive O(n⁴) approach?
  • RQ3Can the rank-based cumulative distribution technique from Heller et al. (2016) be adapted to support the full Bergsma-Dassios statistic?
  • RQ4How does the performance of this O(n²) method compare to existing O(n² log n) approaches in practice?
  • RQ5What is the impact of ties on the structure of discordant quadruples and how can they be efficiently counted?

Key findings

  • The Bergsma-Dassios sign-covariance can be computed in O(n²) time using rank-based preprocessing and constant-time range queries on a cumulative distribution grid.
  • The number of concordant quadruples Nc is computed via O(1) range queries on a precomputed A(r,s) matrix, reducing the total cost to O(n²).
  • For tied data, the method correctly computes the discordant quadruple count Nd by decomposing the contribution into top, mid, bot, and equality terms, each retrievable in O(1) time.
  • The final correction term in the discordance formula is computed using a secondary cumulative structure that tracks squared counts of tied observations, enabling O(1) evaluation per pair.
  • The algorithm maintains exactness and handles all edge cases including tied ranks and identical values, ensuring correctness across all data types.
  • The overall time complexity is optimal at O(n²), representing a significant improvement over the previous O(n² log n) bound established by Weihs et al. (2015).

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.