Tutorials › Statistical Learning (Graduate) › Noise Conditions Behind KRR Variance Rates

Kernel Ridge Rates and Source Conditions · Tutorial 732 of 989

Noise Conditions Behind KRR Variance Rates

See how assumptions on the conditional noise distribution yield exact or bounded kernel ridge prediction variance, and where design control is needed for population-risk rates.

Advanced 10 min read

What You'll Learn

  • Define homoscedastic, bounded, and conditionally sub-Gaussian noise precisely.
  • Derive the conditional fixed-design variance of the noise component in kernel ridge regression.
  • Relate homoscedastic variance to a spectral sum and effective dimension.
  • Show how a uniform conditional variance bound yields an effective-dimension upper bound.
  • Recognize why a noise assumption alone does not control the gap between empirical and population prediction risk.

Why the Noise Assumption Matters

Kernel ridge regression (KRR) shrinks fitted directions according to their empirical covariance and the regularization parameter. The variance of its prediction error also depends on how much noise enters those directions. A constant conditional noise variance gives an exact spectral formula; a uniform variance bound gives an upper bound; and a conditional sub-Gaussian assumption is a stronger distributional condition that, in particular, supplies such a variance bound.

The distinction is useful because these assumptions do different jobs. The fixed-design variance calculations below need only conditional second moments and independence across observations. Stronger tail assumptions are useful for probability bounds, but they do not by themselves control how the observed design represents the population. The results here concern the noise contribution to prediction error, not the regularization bias or the additional effects of random design.

Setup and Noise Conditions

Let \(\mathcal H\) be a reproducing kernel Hilbert space with kernel \(k\), and write \(k_x=k(x,\cdot)\in\mathcal H\). Conditional on observed inputs \(X_1,\ldots,X_n\), suppose the responses satisfy \(Y_i=f_*(X_i)+\varepsilon_i\), where \(E[\varepsilon_i\mid X_1,\ldots,X_n]=0\). Assume the errors are conditionally independent across \(i\), with finite conditional variances \(\sigma_i^2=\operatorname{Var}(\varepsilon_i\mid X_1,\ldots,X_n)\). The KRR estimator minimizes the average squared error plus a squared-norm penalty.

$$ \hat f_\lambda = \arg\min_{f\in\mathcal H} \left\{ \frac{1}{n}\sum_{i=1}^n (Y_i-f(X_i))^2 +\lambda\|f\|_{\mathcal H}^2 \right\}, \qquad \lambda>0. $$

Define the empirical covariance operator \(T_n:\mathcal H\to\mathcal H\) and the noise-weighted covariance operator \(T_{n,\sigma}\) by

$$ T_n=\frac{1}{n}\sum_{i=1}^n k_{X_i}\otimes k_{X_i}, \qquad T_{n,\sigma}=\frac{1}{n}\sum_{i=1}^n \sigma_i^2\, k_{X_i}\otimes k_{X_i}, $$

where \((u\otimes v)h=\langle v,h\rangle_{\mathcal H}u\). The empirical prediction norm is \(\|h\|_{T_n}^2=\langle h,T_nh\rangle_{\mathcal H}\). It measures squared prediction error averaged over the observed inputs.

Definition: Noise is homoscedastic if \(\sigma_i^2=\sigma^2\) for every observed input, for some constant \(\sigma^2\). It is uniformly bounded in variance if \(\sigma_i^2\le v\) for every \(i\), for a constant \(v\). It is conditionally sub-Gaussian with proxy \(\tau^2\) if, almost surely, for every real \(t\), \(E[\exp(t\varepsilon_i)\mid X_1,\ldots,X_n]\le \exp(\tau^2t^2/2)\).

A common way to obtain a variance bound is bounded centered noise: if \(|\varepsilon_i|\le M\) almost surely and its conditional mean is zero, then \(\sigma_i^2\le M^2\). A centered conditionally sub-Gaussian error has conditional variance at most \(\tau^2\), so it also satisfies a uniform variance bound. Neither condition requires the errors to have a common distribution across inputs.

The Fixed-Design Variance Formula

For fixed inputs, the KRR solution is linear in the responses. Its component due solely to the errors is \(\hat f_{\lambda,\varepsilon}=(T_n+\lambda I)^{-1}n^{-1}\sum_i\varepsilon_i k_{X_i}\). This is the random part whose conditional prediction variance we calculate. The formula makes clear that the noise level and the regularized directions both matter.

Theorem: Under the conditional mean-zero, conditional independence, and finite conditional variance assumptions above,
$$ E\!\left[\|\hat f_{\lambda,\varepsilon}\|_{T_n}^2 \mid X_1,\ldots,X_n\right] = \frac{1}{n}\operatorname{tr} \left[ T_n(T_n+\lambda I)^{-1} T_{n,\sigma} (T_n+\lambda I)^{-1} \right]. $$

Proof. Set \(A=(T_n+\lambda I)^{-1}\) and \(g=n^{-1}\sum_i\varepsilon_i k_{X_i}\), so that \(\hat f_{\lambda,\varepsilon}=Ag\). Conditional independence and zero conditional means make every cross term in the covariance of \(g\) vanish. Thus

$$ E[g\otimes g\mid X_1,\ldots,X_n] = \frac{1}{n^2}\sum_{i=1}^n \sigma_i^2 k_{X_i}\otimes k_{X_i} = \frac{1}{n}T_{n,\sigma}. $$

For any square-integrable Hilbert-space-valued random variable \(Z\) and positive finite-rank operator \(T_n\), \(E[\langle Z,T_nZ\rangle]=\operatorname{tr}(T_nE[Z\otimes Z])\); here this follows by expanding in an orthonormal basis of the finite-dimensional span of the observed feature vectors. Apply this identity to \(Z=Ag\). Since \(A\) is self-adjoint, \(E[(Ag)\otimes(Ag)\mid X_1,\ldots,X_n] =A\,E[g\otimes g\mid X_1,\ldots,X_n]\,A\). Substituting the covariance of \(g\) and using cyclic invariance of the finite-rank trace gives the stated formula. \(\square\)

From Noise Assumptions to Effective Dimension

In the homoscedastic case, \(T_{n,\sigma}=\sigma^2T_n\). If \(t_1,\ldots,t_r\) are the positive eigenvalues of \(T_n\), the theorem therefore gives an exact spectral sum. The effective dimension at \(\lambda\) is \(N_n(\lambda)=\operatorname{tr}[T_n(T_n+\lambda I)^{-1}]\). Each term in the exact variance sum is no larger than its corresponding effective-dimension term.

Result: Under homoscedastic noise,
$$ E[\|\hat f_{\lambda,\varepsilon}\|_{T_n}^2\mid X_1,\ldots,X_n] = \frac{\sigma^2}{n}\sum_{j=1}^r \left(\frac{t_j}{t_j+\lambda}\right)^2 \le \frac{\sigma^2}{n}N_n(\lambda). $$

To verify the inequality, \(t_j\ge0\) and \(\lambda>0\) imply \(0\le t_j/(t_j+\lambda)\le1\), and hence \((t_j/(t_j+\lambda))^2\le t_j/(t_j+\lambda)\). Summing and multiplying by \(\sigma^2/n\) proves the claim.

The same effective-dimension bound holds when noise is heteroscedastic but uniformly bounded in variance. In operator order, \(T_{n,\sigma}\preceq vT_n\), because for every \(h\in\mathcal H\),

$$ \langle h,(vT_n-T_{n,\sigma})h\rangle_{\mathcal H} = \frac{1}{n}\sum_{i=1}^n (v-\sigma_i^2)\langle h,k_{X_i}\rangle_{\mathcal H}^2 \ge 0. $$

Consequently the trace formula is bounded by the same expression with \(T_{n,\sigma}\) replaced by \(vT_n\). This replacement is valid because, for positive operators \(B\preceq C\) and positive \(A,T_n\), \(\operatorname{tr}(T_nABA)\le\operatorname{tr}(T_nACA)\): the difference is the trace of a product of positive operators, equivalently \(\operatorname{tr}(A T_n A(C-B))\ge0\). Applying the spectral inequality above gives the result.

Bound: If \(\sigma_i^2\le v\) for all observed inputs, then
$$ E[\|\hat f_{\lambda,\varepsilon}\|_{T_n}^2\mid X_1,\ldots,X_n] \le \frac{v}{n}N_n(\lambda). $$

Worked Examples

Worked Example: Homoscedastic Noise on Two Empirical Directions

Suppose the positive eigenvalues of \(T_n\) are \(1\) and \(0.25\), the regularization parameter is \(\lambda=0.25\), the sample size is \(n=100\), and the conditional noise variance is the constant \(\sigma^2=4\). The two spectral shrinkage factors are \(1/(1+0.25)=0.8\) and \(0.25/(0.25+0.25)=0.5\). Therefore the exact conditional variance is

$$ \frac{4}{100}(0.8^2+0.5^2) = 0.04(0.64+0.25) = 0.0356. $$

The effective dimension is \(N_n(0.25)=0.8+0.5=1.3\), so the upper bound is \((4/100)(1.3)=0.052\). The bound is valid but not exact: it replaces each squared shrinkage factor by the larger unsquared factor.

Worked Example: Bounded, Heteroscedastic Noise

Keep the same eigenvalues, regularization parameter, and sample size, but suppose the conditional noise is centered and bounded by \(|\varepsilon_i|\le1\). The variance may differ across inputs, but every conditional variance is at most \(1\). Thus the general bound gives

$$ E[\|\hat f_{\lambda,\varepsilon}\|_{T_n}^2\mid X_1,\ldots,X_n] \le \frac{1}{100}(0.8+0.5) = 0.013. $$

For comparison, if the noise variances are constant within each of the two empirical eigendirections and equal to \(0.5\) and \(0.25\), respectively, the exact variance is \((1/100)[0.5(0.8^2)+0.25(0.5^2)] =(0.32+0.0625)/100=0.003825\). This is below \(0.013\). The bound does not need the variances to align with eigenvectors; the aligned calculation simply illustrates how a lower noise level in a direction reduces its contribution.

Worked Example: Conditionally Sub-Gaussian Noise in One Direction

Let \(T_n\) have one positive eigenvalue \(t_1=1\), take \(n=50\) and \(\lambda=0.1\), and suppose the errors are conditionally centered sub-Gaussian with proxy \(\tau^2=9\). Their conditional variances are at most \(9\), so the effective-dimension bound is

$$ \frac{9}{50}\frac{1}{1+0.1} = \frac{9}{55} \approx 0.1636. $$

If, more specifically, the errors are conditionally normal with variance \(9\), the noise is homoscedastic and the exact variance is \((9/50)(1/1.1)^2 =9/(50\cdot1.21)\approx0.1488\). The normal example satisfies the sub-Gaussian assumption, but the exact value uses the stronger information that its variance is exactly \(9\), rather than merely at most \(9\).

What These Bounds Do—and Do Not—Say

The factor \(N_n(\lambda)/n\) describes the variance cost of fitting the observed inputs after regularization. Homoscedasticity identifies that cost precisely through a spectral sum. A uniform conditional variance bound controls it even when noise levels vary across inputs. A conditional sub-Gaussian assumption implies such a bound and also supplies tail information that can support stronger probability statements.

These are conditional, empirical prediction bounds. They do not automatically bound integrated prediction error under the population distribution of \(X\): the empirical norm weights observed inputs, whereas population risk weights inputs according to their distribution. Relating the two requires control of how the empirical covariance represents the population covariance, in addition to assumptions on the noise. A noise tail condition alone does not supply that design control.

Common Mistake

A common mistake is to treat “sub-Gaussian noise” as if it automatically proved a high-probability population-risk bound. The condition controls the conditional tails of the errors; it does not ensure that the observed inputs cover the directions important under the population distribution. Another mistake is to use a constant-variance formula when the variance changes with \(X_i\). In that case the exact expression involves \(T_{n,\sigma}\), and the simple effective-dimension bound follows only after establishing a uniform variance bound (or another suitable operator comparison).

Key takeaway: For fixed-design KRR, the conditional noise covariance determines prediction variance. Constant variance gives an exact spectral formula; a uniform conditional variance bound gives a variance-times-effective-dimension upper bound. Population-risk and high-probability conclusions require additional design or concentration control.

Check Your Understanding

Use the formulas and assumptions in this tutorial to answer the following.

  1. Why does conditional independence make the cross terms vanish when calculating the covariance of the KRR noise component?
  2. For homoscedastic noise, why is each squared spectral shrinkage factor no larger than the corresponding effective-dimension term?
  3. If \(|\varepsilon_i|\le M\) and the conditional mean is zero, what uniform upper bound does this give on the conditional variance?
  4. Can conditional sub-Gaussian noise alone turn an empirical prediction bound into a population prediction bound? Explain what else is needed.
  5. When the conditional noise variance varies across inputs, which operator replaces \(\sigma^2T_n\) in the exact variance formula?
Clinical Biostats