Tutorials › Statistical Learning (Graduate) › Uniform Convergence of Bounded-Support Quantization Risks

Clustering Risk and Consistency · Tutorial 647 of 989

Uniform Convergence of Bounded-Support Quantization Risks

Learn how bounded support and compactness yield uniform convergence of empirical quantization risk, including a finite-sample bound and an almost-sure proof.

Advanced 9 min read

What You'll Learn

  • Define population and empirical quantization risks over a compact codebook class.
  • Derive a Lipschitz bound for squared-distance distortion as centers move.
  • Use finite nets and Hoeffding’s inequality to bound the uniform deviation.
  • Prove almost-sure uniform convergence using finite nets and the strong law.
  • Identify why pointwise convergence alone does not establish uniform convergence.

Why Uniform Convergence Matters

For a fixed codebook, the empirical K-means risk is an average of independent observations, so standard laws of large numbers describe its behavior. But a data-based procedure can select its codebook after seeing the sample. To control the risk of such a selected codebook, it is useful to control the empirical-to-population discrepancy simultaneously over the whole candidate class, not just at one fixed codebook.

Bounded support makes squared-distance distortion bounded, while compactness of the codebook class lets us approximate every candidate by a finite collection of representatives. A Lipschitz bound controls the approximation error. Together, these facts give a finite-sample probability bound and an almost-sure uniform convergence result.

Risks and the Codebook Class

Let \(X,X_1,X_2,\ldots\) be independent and identically distributed random vectors in \(\mathbb{R}^d\). Assume \(P(\|X\|\le R)=1\) for some finite \(R\), where \(\|\cdot\|\) is the Euclidean norm. Fix a positive integer \(k\). A codebook is an ordered tuple \(C=(c_1,\ldots,c_k)\) of centers in \(\mathbb{R}^d\). Let \(\Theta\) be a nonempty compact set of codebooks, and suppose every center in every \(C\in\Theta\) satisfies \(\|c_j\|\le A\) for a finite \(A\).

Definition: The squared-distance distortion of a codebook \(C\) at \(x\) is \(g_C(x)=\min_{1\le j\le k}\|x-c_j\|^2\). Its population risk is \(R(C)=E[g_C(X)]\), and its empirical risk based on \(X_1,\ldots,X_n\) is \(R_n(C)=n^{-1}\sum_{i=1}^n g_C(X_i)\). Uniform convergence of the risks means \(\sup_{C\in\Theta}|R_n(C)-R(C)|\xrightarrow{a.s.}0\).

Equip codebooks with the distance \(d_\infty(C,D)=\max_{1\le j\le k}\|c_j-d_j\|\). Compactness ensures that for each \(\varepsilon>0\), there is a finite \(\varepsilon\)-net: a finite set \(\mathcal{N}_\varepsilon\subseteq\Theta\) such that every \(C\in\Theta\) is within distance \(\varepsilon\) of some \(D\in\mathcal{N}_\varepsilon\). Write \(N(\varepsilon)=|\mathcal{N}_\varepsilon|\) for the size of a chosen net.

A Lipschitz Bound for Distortion

The key regularity fact is that moving every center a small amount changes the distortion by at most a constant times that amount. For any \(x\) with \(\|x\|\le R\) and any centers \(c,d\) with norms at most \(A\), the difference of squared distances obeys

$$ \left|\|x-c\|^2-\|x-d\|^2\right| =\left|(d-c)^\top(2x-c-d)\right| \le 2(R+A)\|c-d\|. $$

For two lists of real numbers \((a_j)\) and \((b_j)\), \(|\min_j a_j-\min_j b_j|\le\max_j|a_j-b_j|\): each list's minimum is no farther from the other minimum than the largest coordinatewise difference. Applying this fact to the squared distances gives the bound below.

Lemma: For all \(C,D\in\Theta\) and all \(x\) with \(\|x\|\le R\), \[ |g_C(x)-g_D(x)|\le Ld_\infty(C,D), \qquad L=2(R+A). \] Consequently, \(|R(C)-R(D)|\le Ld_\infty(C,D)\) and \(|R_n(C)-R_n(D)|\le Ld_\infty(C,D)\).

The last two inequalities follow by taking expectations and sample averages, respectively, of the pointwise bound. The distortion is also bounded: since \(\|x-c_j\|\le R+A\), we have \(0\le g_C(x)\le B\), where \(B=(R+A)^2\).

Worked Example: Checking the Center-Perturbation Bound

Take \(d=1\), \(R=1\), and two codebooks \(C=(0,0.5)\) and \(D=(0.1,0.6)\). Their largest center displacement is \(d_\infty(C,D)=0.1\). We may use \(A=0.6\), so \(L=2(1+0.6)=3.2\). The lemma therefore bounds the distortion difference by \(3.2(0.1)=0.32\) at every \(x\in[-1,1]\).

At \(x=0\), \(g_C(0)=\min(0^2,0.5^2)=0\), while \(g_D(0)=\min(0.1^2,0.6^2)=0.01\); the difference is \(0.01\le0.32\). At \(x=1\), \(g_C(1)=\min(1^2,0.5^2)=0.25\), while \(g_D(1)=\min(0.9^2,0.4^2)=0.16\); the difference is \(0.09\le0.32\). The common bound applies to every point in the support, not just these two checks.

Finite-Net Bound and Uniform Convergence

For a fixed net, deviations at its finitely many codebooks can be controlled with Hoeffding's inequality. In the form used here, if \(Y_1,\ldots,Y_n\) are independent, identically distributed random variables in \([0,B]\), then for \(u>0\), \(P(|n^{-1}\sum_iY_i-E[Y_1]|>u)\le2\exp(-2nu^2/B^2)\). For each fixed \(D\), the variables \(g_D(X_i)\) meet these conditions.

Theorem: Suppose \(B>0\). For every \(\varepsilon>0\) and \(u>0\), with \(\mathcal{N}_\varepsilon\) any finite \(\varepsilon\)-net of \(\Theta\), \[ P\left(\sup_{C\in\Theta}|R_n(C)-R(C)|>2L\varepsilon+u\right) \le 2N(\varepsilon)\exp\left(-\frac{2nu^2}{B^2}\right). \] If \(B=0\), all distortions are zero almost surely and uniform convergence is immediate.

To prove the bound, fix \(C\in\Theta\) and choose \(D\in\mathcal{N}_\varepsilon\) with \(d_\infty(C,D)\le\varepsilon\). The Lipschitz lemma and the triangle inequality give

$$ |R_n(C)-R(C)| \le |R_n(D)-R(D)|+|R_n(C)-R_n(D)|+|R(C)-R(D)| \le |R_n(D)-R(D)|+2L\varepsilon. $$

Thus, if the supremum over \(C\) exceeds \(2L\varepsilon+u\), some net point \(D\) must have \(|R_n(D)-R(D)|>u\). Apply Hoeffding's inequality at each net point and add the resulting probabilities over the \(N(\varepsilon)\) points. This proves the displayed bound.

The bound separates two sources of error. The term \(2L\varepsilon\) is the price of replacing the full class by a net; the exponential term controls random deviations on that finite net. For convergence in probability, choose \(\varepsilon\) small enough to make \(2L\varepsilon\) small, then let \(n\) grow so the finite-net probability tends to zero.

Worked Example: Evaluating a Finite-Sample Bound

Let \(d=1\), \(k=2\), support \([-1,1]\), and \(\Theta=[-1,1]^2\). Here \(R=A=1\), \(L=4\), and \(B=4\). Under \(d_\infty\), a grid with spacing \(0.2\) in each coordinate is a \(0.1\)-net: every point in \([-1,1]\) is within \(0.1\) of a grid point, and there are 11 grid points per coordinate. Hence \(N(0.1)=11^2=121\).

For \(n=10000\) and \(u=0.2\), the theorem gives a threshold \(2L\varepsilon+u=2(4)(0.1)+0.2=1\). The exponent is \[ -\frac{2(10000)(0.2)^2}{4^2} =-\frac{20000(0.04)}{16} =-50. \] Therefore \[ P\left(\sup_{C\in\Theta}|R_n(C)-R(C)|>1\right) \le 2(121)e^{-50} =242e^{-50} \approx 4.67\times 10^{-20}. \] This is a bound on the probability that the uniform discrepancy exceeds 1; it is not a claim that the discrepancy itself equals 1.

The same assumptions also yield almost-sure uniform convergence. We give the argument because it explains why pointwise laws of large numbers can be upgraded to a statement over the entire compact class.

Theorem: If \(X_1,X_2,\ldots\) are iid, \(P(\|X\|\le R)=1\), and \(\Theta\) is compact with all centers bounded in norm by \(A\), then \[ \sup_{C\in\Theta}|R_n(C)-R(C)|\xrightarrow{a.s.}0. \]

Proof. For each positive integer \(m\), choose a finite \(1/m\)-net \(\mathcal{N}_m\). The union of these nets is countable. For each fixed \(D\) in this union, \(g_D(X_i)\) are iid and bounded, so the strong law of large numbers gives \(R_n(D)\to R(D)\) almost surely. A countable intersection of probability-one events still has probability one; on that event, convergence holds simultaneously for every net point in every \(\mathcal{N}_m\).

Fix an outcome in this event and an integer \(m\). For any \(C\in\Theta\), choose a net point \(D\in\mathcal{N}_m\) within \(1/m\). The same triangle inequality as above gives

$$ \sup_{C\in\Theta}|R_n(C)-R(C)| \le \max_{D\in\mathcal{N}_m}|R_n(D)-R(D)|+\frac{2L}{m}. $$

Because \(\mathcal{N}_m\) is finite and convergence holds at each of its points, the maximum on the right tends to zero as \(n\to\infty\). Therefore the limit superior of the left side is at most \(2L/m\) for every positive integer \(m\). Letting \(m\to\infty\) shows that this nonnegative limit superior is zero. The uniform discrepancy consequently converges to zero almost surely. \(\square\)

The supremum in this statement is measurable: for each sample, \(R_n(C)-R(C)\) is Lipschitz in \(C\), and compact \(\Theta\) has a countable dense subset. The supremum of its absolute value over \(\Theta\) equals the supremum over that countable subset, which is a measurable random variable.

Worked Example: An Exact One-Center Calculation

Let \(X_i\) take values \(-1\) and \(1\), each with probability \(1/2\), and let the one-center class be \(\Theta=[-1,1]\). For any \(c\in\Theta\), \[ R(c)=E[(X-c)^2]=E[X^2]-2cE[X]+c^2=1+c^2. \] Writing \(\bar X=n^{-1}\sum_iX_i\), the empirical risk is \[ R_n(c)=\frac1n\sum_i(X_i-c)^2 =\frac1n\sum_iX_i^2-2c\bar X+c^2 =1-2c\bar X+c^2. \] Thus \(R_n(c)-R(c)=-2c\bar X\). Since \(\sup_{c\in[-1,1]}|c|=1\), the exact uniform discrepancy is \[ \sup_{c\in[-1,1]}|R_n(c)-R(c)|=2|\bar X|. \] The strong law gives \(\bar X\to0\) almost surely, so this exact expression verifies uniform convergence directly in this example. For the sample \((1,1,-1,1)\), \(\bar X=1/2\), and the uniform discrepancy is \(2(1/2)=1\).

Common Pitfall and Practical Meaning

Pitfall: Proving \(R_n(C)\to R(C)\) for every fixed \(C\) and then concluding that \(\sup_{C\in\Theta}|R_n(C)-R(C)|\to0\) is not justified by pointwise convergence alone. The codebook at which the largest discrepancy occurs may vary with the sample and with \(n\). The correction is to control the whole class: compactness supplies finite nets, and the Lipschitz bound transfers control from net points to every codebook.

The result is useful whenever a candidate codebook is chosen by minimizing the empirical objective: uniform risk control applies even when that candidate depends on the observed data. It does not, by itself, identify which population minimizer is selected or establish convergence of the codebook centers; those require additional arguments. The assumptions also matter: unbounded support removes the simple uniform bound \(B\), and a noncompact candidate class need not have finite nets at a fixed resolution.

Key takeaway: Bounded observations make distortion bounded, center perturbations change distortion in a controlled Lipschitz way, and compactness reduces the class to finitely many representatives at any chosen resolution. These ingredients yield uniform convergence, not merely convergence at each fixed codebook.

Check Your Understanding

Try these questions before moving on.

  1. Why does the distortion bound use \(B=(R+A)^2\), rather than \(R^2+A^2\)?
  2. Derive the factor \(2L\varepsilon\) in the finite-net inequality.
  3. In the finite-sample example, what threshold and exponential factor result if \(u\) is changed from \(0.2\) to \(0.1\), with all other quantities fixed?
  4. Why is a finite net not enough on its own to control the whole codebook class?
  5. Which step in the almost-sure proof requires the net to be finite, and which step uses bounded distortion?
Clinical Biostats