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

$k$-Variance: A Clustered Notion of Variance

Justin Solomon, Kristjan Greenewald, Haikady N. Nagaraja

TL;DR

$k$-variance is a novel generalization of standard variance that uses the machinery of optimal transport to capture the "local" spread of a distribution. By measuring the cost of matching two sets of $k$ samples rather than measuring deviation from a global mean, it provides a powerful tool for identifying clustered structures and estimating the intrinsic dimensionality of high-dimensional data.

What Problem Does This Paper Address?

In basic statistics, variance is the go-to scalar for describing the "spread" of a dataset. However, variance is a global metric—it measures how far points fall from a single central mean. This makes it a blunt instrument for complex, multi-modal distributions. For example, a distribution with two tight clusters far apart might have the same variance as a single, widely dispersed cloud, even though their underlying geometries are completely different.

While higher-order moments (like skewness and kurtosis) can provide more detail, they remain tied to the global mean and become increasingly difficult to interpret in high-dimensional or multi-modal settings. The authors seek a summary statistic that transitions from global to local information as a parameter $k$ increases, effectively measuring "intra-cluster" variability.

Methods

The authors define $k$-variance by drawing two independent sets of $k$ samples from a distribution $\mu$. They then calculate the 2-Wasserstein distance (a concept from optimal transport) between the empirical measures of these two sets.

Key technical components include:

  • Bipartite Matching: For empirical samples, the Wasserstein distance reduces to a linear assignment problem—finding the minimum cost to match each point in the first set to a unique point in the second set.
  • Scaling Factors: As $k$ increases, the distance between samples naturally shrinks. To prevent the metric from vanishing, the authors introduce a scaling factor $\rho(k, d)$ that depends on the ambient dimension $d$.
  • Stochastic Estimation: $k$-variance can be estimated by repeatedly drawing $2k$ samples, solving the matching problem, and averaging the results. The authors use McDiarmid’s inequality to prove that this estimator is well-behaved, especially in high dimensions.

Datasets

The paper evaluates $k$-variance using both synthetic and real-world data:

  • Synthetic Gaussian Mixtures: Mixtures of two isotropic Gaussians used to compare unimodal vs. bimodal behavior across different dimensions.
  • Geometric Measures: Uniform distributions on unit cubes, squares, and spheres, as well as measures concentrated on low-dimensional hyperplanes.
  • MNIST: The classic dataset of handwritten digits (0-9). Each digit is treated as a distribution in $\mathbb{R}^{784}$ to see how $k$-variance characterizes the "shape" of different numbers.

Key Insights and Ideas

  • The $k=1$ Connection: When $k=1$, $k$-variance is mathematically equivalent to standard variance. As $k$ grows, the metric becomes "localized," as points are matched to their nearest neighbors in the opposing set rather than being compared to a global average.
  • The Dimensionality Threshold: A fascinating finding is that the behavior of $k$-variance changes significantly around $d=4$. In high dimensions ($d \ge 5$), clustered distributions have much lower $k$-variance than unimodal ones with the same global variance. In low dimensions ($d=1, 2$), the behavior is non-monotonic and more complex.
  • Intrinsic Dimensionality: The rate at which $k$-variance decays as $k$ increases serves as a proxy for the intrinsic dimensionality of the data. If data lies on a low-dimensional manifold, $k$-variance will reflect that structure regardless of the ambient space's dimension.
  • MNIST Geometry: In the MNIST experiments, the digit "1" showed a significantly faster decay in $k$-variance compared to other digits. This suggests that the "manifold of 1s" is intrinsically lower-dimensional or more tightly clustered than, say, the "manifold of 8s."

Key Results

  • Theoretical Bounds: The authors provide a limiting formula for 1D $k$-variance based on the theory of order statistics, showing it converges to an integral involving the probability density and cumulative distribution functions.
  • Cluster Identification: The paper demonstrates that $k$-variance can quantitatively distinguish between a single broad Gaussian and a mixture of tight Gaussians, even when their standard variances are identical.
  • Estimator Efficiency: Theorem 9.1 shows that as the dimension $d$ and sample size $k$ increase, fewer independent trials ($n$) are needed to reach an accurate estimate, suggesting $k$-variance is surprisingly robust to the "curse of dimensionality."

Limitations and Future Work

  • Computational Complexity: Calculating the optimal matching for $k$ samples takes $O(k^3)$ time. While manageable for moderate $k$, it could become a bottleneck for very large-scale applications.
  • Reconstruction: A major open question is whether a distribution can be uniquely reconstructed if you know its mean and its entire sequence of $k$-variance values for all $k$.
  • Generalization: The authors suggest exploring "k-covariance" to capture directional relationships and investigating how $k$-variance behaves under gradient flows (i.e., how a distribution would "evolve" to minimize its $k$-variance).

Summary updated

BibTeX
@article{solomon2022k,
  author = {Justin Solomon and Kristjan 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