Why Effective Dimension Controls Variance
Kernel ridge regression fits a function using noisy responses while penalizing its RKHS norm. Its variance depends not just on the noise level and sample size, but also on how many directions the kernel can use at the chosen regularization level. Effective dimension summarizes that regularized number of directions. This tutorial derives an expected variance bound in the empirical prediction norm.
The distinction in that last phrase matters. The bound below concerns the fitted noise evaluated at the training inputs. It is not, without additional arguments, a bound on prediction error at a fresh input. We make the norm explicit so the result states exactly what has been proved.
The kernel bound implies \(E\|K_X\|_{\mathcal H}^2=E[k(X,X)]\leq\kappa^2\), so \(T\) is a positive trace-class operator. Thus \(N(\lambda)\) is finite, and \(N(\lambda)\leq \operatorname{Tr}(T)/\lambda\leq\kappa^2/\lambda\). The trace is the sum of eigenvalues, counted with multiplicity; equivalently, if \(T\) has eigenvalues \(\mu_j\), then \(N(\lambda)=\sum_j\mu_j/(\mu_j+\lambda)\).
The Noise-Only Fit and the Main Bound
For squared-loss kernel ridge regression, the part of the fitted function that is linear in the errors is
This follows from the regularized normal equation: replacing every response by its noise contribution leaves the empirical covariance on the left and the noise-feature average on the right. Define the empirical prediction norm by \(\|h\|_{T_n}^2=\langle h,T_nh\rangle_{\mathcal H}=n^{-1}\sum_{i=1}^n h(X_i)^2\). The next result bounds the conditional variance in this norm.
Proof of the conditional bound. Fix the inputs and let \(b=n^{-1}\sum_i\varepsilon_iK_{X_i}\). Conditional independence and zero conditional means make the cross-covariances vanish. Therefore, in positive-semidefinite operator order,
Set \(R=(T_n+\lambda I)^{-1}\), so that \(\widehat f_\varepsilon=Rb\). For a centered random vector with covariance \(C\), the expected squared norm after applying an operator \(A\) is \(\operatorname{Tr}(ACA^*)\); this identity follows by expanding in an orthonormal basis. Applying it with the empirical norm gives
The inequality uses the covariance bound and the fact that taking the trace against a positive operator preserves positive-semidefinite order. Since \(R\) is a function of \(T_n\), these operators commute. If \(t\geq0\) is an eigenvalue of \(T_n\), its contribution to the last trace is \(t^2/(t+\lambda)^2\), and
Summing over the eigenvalues proves the stated conditional bound. The empirical covariance has finite rank, so these traces are finite. \(\square\)
Why the Expected Empirical Dimension Is Bounded
It remains to compare the empirical effective dimension with \(N(\lambda)\). The key fact is that \(A\mapsto A(A+\lambda I)^{-1}\) is operator concave for positive operators. Here is the needed Jensen inequality and its justification.
Justification. For a positive definite operator \(B\), the quadratic form of its inverse has the variational expression
Indeed, subtracting the expression inside the supremum from the left side gives \(\langle v-B^{-1}u,B(v-B^{-1}u)\rangle\geq0\), with equality at \(v=B^{-1}u\). A supremum of affine functions of \(B\) is convex. Applying scalar Jensen to this quadratic-form representation gives
Since \(g(A)=I-\lambda(A+\lambda I)^{-1}\), this is the asserted operator concavity inequality. For finite-dimensional operators, taking traces gives the trace inequality directly. In the trace-class setting here, apply that result on increasing finite-dimensional projections and pass to the limit: \(A(A+\lambda I)^{-1}\) has trace at most \(\operatorname{Tr}(A)/\lambda\), so the projected traces converge to the full trace. This establishes the stated inequality in the setting used below. \(\square\)
Apply this result to \(A=T_n\). Because the inputs are identically distributed, \(E[T_n]=T\). Consequently,
Taking expectations in the conditional variance bound and using \(\operatorname{Tr}\{[T_n(T_n+\lambda I)^{-1}]^2\}\leq\operatorname{Tr}\{T_n(T_n+\lambda I)^{-1}\}\) proves the theorem. \(\square\)
Worked Examples
Worked Example: A Constant Kernel
Suppose \(k(x,x')=1\) for all inputs, and use the noise-only fit with conditional error variance exactly \(\sigma^2\). The RKHS is one-dimensional, consisting of constant functions. The feature vector has norm one, so \(T=T_n=1\) on that dimension, regardless of the observed inputs.
Thus \(N(\lambda)=1/(1+\lambda)\). The fitted noise function is the constant \(\bar\varepsilon/(1+\lambda)\), where \(\bar\varepsilon=n^{-1}\sum_i\varepsilon_i\). Its empirical squared norm has expectation
The inequality holds because \(1+\lambda\geq1\). This example displays both the \(1/n\) noise averaging and the regularization’s reduction of variance.
Worked Example: A Uniform Distribution on Four Points
Let the input take values \(1,2,3,4\), each with probability \(1/4\), and use the kernel \(k(i,j)=1\) if \(i=j\) and \(0\) otherwise. Its feature vectors are the four coordinate vectors, so \(T\) is diagonal with each diagonal entry \(1/4\). At \(\lambda=1/4\), each eigenvalue contributes
to effective dimension. Therefore \(N(1/4)=4(1/2)=2\), and the theorem gives \(E\|\widehat f_\varepsilon\|_{T_n}^2\leq2\sigma^2/n\). The sample covariance has diagonal entries equal to the four observed proportions, which can vary substantially across samples; the result controls their expected regularized dimension without requiring them to equal their population values.
Worked Example: Comparing the Squared and Unsquared Trace Terms
Consider a fixed empirical covariance with eigenvalues \(2\) and \(1/2\), and take \(\lambda=1/2\). The trace term from the conditional covariance calculation is
The empirical effective dimension is instead
Thus the conditional variance is bounded by \(0.89\sigma^2/n\), and hence also by the looser but simpler \(1.3\sigma^2/n\). This numerical comparison illustrates the eigenvalue inequality used in the proof; it does not require the sample covariance to have these particular eigenvalues in every application.
Interpretation and a Common Pitfall
The bound has the familiar form “noise variance times effective dimension divided by sample size.” Each regularized eigen-direction contributes \(\mu_j/(\mu_j+\lambda)\) to \(N(\lambda)\): directions with eigenvalues much smaller than \(\lambda\) contribute little, while directions much larger than \(\lambda\) contribute nearly one. Increasing \(\lambda\) therefore reduces this variance bound by suppressing more directions. This result is a variance statement; it does not quantify the bias caused by regularization.
- Pitfall: silently changing the prediction norm. The proof controls \(n^{-1}\sum_i\widehat f_\varepsilon(X_i)^2\). It does not establish the same bound for \(E_X[\widehat f_\varepsilon(X)^2]\), where \(X\) is a fresh input. Those quantities use different covariance operators, and the fitted function depends on the training inputs.
- Correction: State the norm in the claim. A population prediction bound requires additional control that connects the sample-dependent fit and the population covariance; it does not follow just by renaming \(\|\cdot\|_{T_n}\) as \(\|\cdot\|_T\).
- Pitfall: assuming only an unconditional mean-zero error is enough. The conditional covariance calculation uses zero conditional means and conditional independence given the inputs.
- Correction: Check the noise assumptions at the design level. A uniform conditional variance upper bound is sufficient here; the errors need not have identical conditional variances.
Check Your Understanding
Try these questions before moving on.
- Why does the bounded-kernel assumption imply that \(T\) has finite trace?
- In the conditional covariance calculation, where are conditional independence and the zero conditional means used?
- For an eigenvalue \(t\geq0\), verify that \(t^2/(t+\lambda)^2\leq t/(t+\lambda)\).
- What does the factor \(\mu_j/(\mu_j+\lambda)\) contribute when \(\mu_j\) is much smaller than \(\lambda\)?
- Why does the theorem not by itself bound prediction variance at a fresh input?