The Randomized Dependence Coefficient

David López-Paz, Philipp Hennig, Bernhard Schölkopf

In statistics and machine learning, measuring how much two variables "depend" on each other is a foundational task. While classic tools like Pearson’s correlation are fast, they only capture linear relationships. If your data follows a circle, a sine wave, or a complex manifold, Pearson’s will often tell you there is zero correlation.

Existing non-linear measures like the Hilbert-Schmidt Independence Criterion (HSIC) or Distance Correlation (dCor) are powerful but suffer from high computational costs—usually $O(n^2)$ or worse—making them impractical for the "Big Data" era. Other methods, like the Maximal Information Coefficient (MIC), are limited to looking at pairs of single numbers (scalars) rather than vectors.

To address this, researchers introduced the Randomized Dependence Coefficient (RDC), a computationally efficient measure of non-linear dependence between random variables of any dimension. By combining copula transformations, random non-linear projections, and Canonical Correlation Analysis (CCA), it achieves theoretical rigor with a much lighter $O(n \log n)$ computational footprint.

How RDC Works

The RDC is designed as a practical estimator for the Hirschfeld-Gebelein-Rényi (HGR) Maximum Correlation Coefficient. Theoretically, HGR is the "perfect" measure, but it requires searching over an infinite-dimensional space of functions, making it impossible to compute directly.

RDC approximates this search in three elegant steps:

  1. Copula Transformation: The data is converted to its empirical ranks (e.g., the smallest value becomes 1, the second smallest 2, etc.). This makes the measure "marginal invariant," meaning it doesn't matter if your data is measured in meters or kilometers, or if it has been passed through a log function.
  2. Random Non-Linear Projections: The transformed data is mapped into a higher-dimensional space using random sinusoidal functions ($\sin(w^Tx + b)$). This is the "Random Kitchen Sinks" approach, which effectively allows the model to "see" non-linear patterns without expensive optimization.
  3. Canonical Correlation Analysis (CCA): Finally, the algorithm uses CCA to find the largest linear correlation between these two sets of random projections.
The RDC pipeline: Data is transformed via empirical copulas, mapped through random non-linear projections, and evaluated using Canonical Correlation Analysis.

The core insight here is that we don't need to find the optimal non-linear functions to measure dependence. By picking a sufficiently large number of random non-linear functions, we can approximate the HGR coefficient with high probability. Furthermore, by operating on the copula (ranks) rather than raw values, RDC automatically satisfies several of Rényi’s fundamental properties for dependence measures.

Key Results and Performance

The authors validated RDC using a mix of synthetic benchmarks (like circles and step functions) and 12 real-world datasets from the UCI repository.

Unmatched Scalability

The most significant advantage of RDC is its speed. The statistic captures complex dependencies but only costs $O(n \log n)$ to compute, primarily due to the initial sorting required for the copula transformation.

In timing tests, RDC processed 1,000,000 samples in about 4.6 seconds. In contrast, $O(n^2)$ methods like HSIC or dCor became computationally unfeasible (taking over 10 minutes) once the sample size reached 100,000.

Computation time (in seconds) for various dependence measures across different sample sizes. RDC remains highly efficient even at 1,000,000 samples.

Robustness and Feature Selection

Beyond speed, RDC proved highly effective in practice:

  • High Power: RDC demonstrated the ability to distinguish true relationships from random noise across a wide variety of non-functional shapes (like circles), where traditional correlation fails completely.
  • Feature Selection: In greedy feature selection tasks, RDC-based maximization outperformed or matched state-of-the-art methods (dCor, HSIC, CHSIC) in minimizing regression error across most real-world datasets.

Limitations and Future Work

While powerful, RDC is not without limitations. Because it uses sinusoidal projections, it assumes a certain level of "smoothness" in the underlying relationship. It performs slightly worse on "jagged" patterns like step functions compared to some other methods.

Additionally, the number of random features ($k$) and the scale for the random weights ($s$) act as hyperparameters. While the paper suggests defaults (like $k=20$), developing more robust, automated ways to set these parameters is a path for future research. Finally, on very small datasets, using too many random features ($k \ge n$) can lead to "spurious perfect correlations," requiring careful regularization.

Despite these minor limitations, RDC's simplicity is a massive feature. It is incredibly easy to implement, requiring just a few lines of code to unlock fast, scalable, non-linear correlation for modern datasets.

Summary updated

BibTeX
@inproceedings{lopezpaz2013randomized,
  author = {David López-Paz and Philipp Hennig and Bernhard Schölkopf},
  title = {{The Randomized Dependence Coefficient}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2013},
  url = {https://openreview.net/forum?id=SJ-Y4uZdZr},
}
Figure