NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

$k$-Variance: A Clustered Notion of Variance

Justin Solomon, Kristjan H. Greenewald, Haikady N. Nagaraja · OpenReview

Abstract

Standard variance is a fundamental tool in statistics for measuring the spread of a distribution, yet it often fails to capture the underlying geometric structure of data. We introduce $k$-variance, a generalization of variance that utilizes the framework of optimal transport to provide a "clustered" measure of dispersion. By calculating the expected cost of a bipartite matching between two independent sets of $k$ samples, $k$-variance offers a scalar summary that is sensitive to local cluster structures and intrinsic dimensionality. We demonstrate that $k$-variance can distinguish between unimodal and multimodal distributions where standard variance cannot, and we provide empirical evidence of its utility on synthetic data and the MNIST dataset.

1. Introduction

In many statistical applications, variance serves as the primary metric for quantifying the "spread" of a distribution. However, variance is a relatively blunt instrument. For instance, a single wide Gaussian distribution and a mixture of two distant, tightly packed clusters can possess identical variances, despite their vastly different underlying geometries. While higher-order moments like skewness and kurtosis offer additional detail, they are often difficult to interpret and scale poorly in high-dimensional or multimodal settings.

This paper introduces $k$-variance, a novel scalar measurement designed to capture "distributional shape" more effectively than standard variance. By focusing on how mass is partitioned across a space rather than just its distance from a global mean, $k$-variance provides a tool for understanding local cluster structures.

2. The k-Variance Framework

The definition of $k$-variance is rooted in the machinery of Optimal Transport (OT). The process for calculating $k$-variance involves three primary steps:

  1. Sampling: Draw two independent sets of $k$ samples from a distribution.
  2. Matching: Solve a bipartite matching problem to find the "cheapest" way to match every point in the first set to a point in the second set. The cost is defined as the squared Euclidean distance between matched points.
  3. Expectation and Scaling: The $k$-variance is the expected cost of this matching, multiplied by a dimension-dependent scaling factor $\rho(k, d)$.

A key property of this definition is its backward compatibility: when $k=1$, the formula reduces exactly to standard variance. As $k$ increases, the matching becomes increasingly "localized." Points in one cluster are more likely to be matched to points in the same cluster in the second set, making $k$-variance a measure of intra-cluster variability. The scaling factor $\rho(k, d)$ is essential to account for the "curse of dimensionality" in optimal transport, ensuring that the metric converges to a stable value or follows a predictable rate as $k$ approaches infinity.

3. Theoretical Insights

The behavior of $k$-variance is deeply tied to the dimensionality of the data. In low dimensions ($d \le 2$), the metric can exhibit non-monotonic behavior. However, in higher dimensions ($d \ge 3$), $k$-variance for clustered data is significantly lower than for unimodal data with the same global variance.

In the one-dimensional case, $k$-variance has a particularly intuitive interpretation: it is equivalent to the sum of the variances of the order statistics (the sorted values of the samples). Furthermore, the rate at which $k$-variance decays as $k$ increases is directly linked to the intrinsic dimensionality of the data, suggesting its potential utility in manifold learning.

4. Experimental Evaluation

The authors evaluated $k$-variance across a variety of synthetic and real-world datasets:

  • Gaussian Mixtures: In experiments with mixtures of isotropic Gaussians, $k$-variance successfully distinguished between a single large cloud and two smaller clusters, even when their standard variances were identical.
  • MNIST Digit Analysis: When applied to the MNIST dataset, the authors found that the digit "1" has a $k$-variance that decays approximately 1.5 times faster than other digits. This provides a quantitative basis for the intuition that there is significantly less variation in the structure of a handwritten "1" compared to more complex digits like "2" or "8".
  • Statistical Efficiency: A significant finding is that the variance of the empirical estimator for $k$-variance decreases as the ambient dimension increases. This implies that fewer trials are required to achieve an accurate estimate in high-dimensional spaces, effectively turning the curse of dimensionality into a benefit for estimation.

5. Conclusion and Future Work

$k$-variance offers a promising new lens through which to view distributional spread, providing a bridge between simple scalar summaries and complex geometric structures. Despite its reliance on optimal transport, it remains computationally accessible through the solution of small $k \times k$ linear programs.

Several avenues for future research remain. It is currently unknown if a distribution can be uniquely reconstructed from its sequence of $k$-variances. Additionally, the authors suggest exploring the development of a "k-covariance matrix" for $d > 1$ and investigating "gradient flows" of $k$-variance, which could potentially lead to new clustering algorithms or methods for distributional transformation.

Summary updated

BibTeX
@article{solomon2022k,
  author = {Justin Solomon and Kristjan H. Greenewald and Haikady N. Nagaraja},
  title = {{$k$-Variance: A Clustered Notion of Variance}},
  journal = {SIAM J. Math. Data Sci.},
  year = {2022},
  doi = {10.1137/20m1385895},
}
Figure