Bayesian Optimization
Part II: Gaussian Processes
中文

The Analysis Behind Kernels

The three chapters before this one built a working model: a kernel says how the values of an unknown function move together (Chapter 7), conditioning turns it into predictions (Chapter 8), and the marginal likelihood picks its settings (Chapter 9). That is enough to run Bayesian optimization. It is not enough to say why it works. The guarantees of Chapter 13 are of two kinds. The Bayesian ones hold for a function drawn from the prior. The frequentist ones, and their counterparts for comparisons in Chapter 21 and Chapter 29, hold for one fixed function whose norm in a reproducing kernel Hilbert space is at most a number BB. The rates of both depend on how fast the eigenvalues of the kernel decay. These statements treat a kernel not as a recipe for covariance matrices but as an object in its own right: a linear map on functions, with eigenvalues, a spectrum of frequencies, and a space of functions it calls simple.

This chapter builds that view from what the reader already has: inner products and eigenvectors (Chapter 3) and the information a Gaussian model gains from noisy data (Section 6.5). The plan is to treat a function as a very long vector and to carry each finite fact over. It ends where the results are used, with the growth of the maximum information gain and with a precise account of what a Gaussian process is as a random object. None of it is needed to use the methods of Part III; it is needed to read their guarantees.

10.1 Functions as vectors #

A vector x∈Rn\vx \in \R^n is a list of nn numbers, which is the same thing as a function from the indices {1,…,n}\{1, \dots, n\} to R\R: give it an index ii, and it returns xix_i. A function ff on [0,1][0, 1] is the same kind of object with a continuum of indices. Section 7.4 used this reading when it drew a function as the vector of its values on a grid.

10.1.1 Inner products of functions #

Take the grid of midpoints xi=(i−12)/nx_i = (i - \tfrac12)/n and the vectors f\vf and g\vg of two functions' values there. Their inner product f⊤g\vf^\T\vg (Equation (3.1)) grows with nn, because it adds more terms. Divided by nn it settles, a Riemann sum turning into an integral as in Section 7.2.1:

1n∑i=1nf(xi) g(xi)  ⟶  ∫01f(x) g(x) dx.\frac{1}{n}\sum_{i=1}^n f(x_i)\, g(x_i) \;\longrightarrow\; \int_0^1 f(x)\, g(x)\, \dd x .

The limit is the inner product of two functions, and length, ∥f∥=(∫01f2 dx)1/2\lVert f \rVert = (\int_0^1 f^2\, \dd x)^{1/2}, and orthogonality follow as in Section 3.1.1. A weighting density q(x)>0q(x) > 0 can make some inputs count more: ⟨f,g⟩q=∫f(x) g(x) q(x) dx\langle f, g \rangle_q = \int f(x)\, g(x)\, q(x)\, \dd x. This chapter uses the uniform weighting q=1q = 1 on [0,1][0, 1] unless it says otherwise.

10.1.2 Orthonormal bases: Fourier as the example #

An orthonormal basis gives vectors coordinates, and functions too. The best-known basis on [0,1][0, 1] is Fourier's: the constant 11 and the functions 2cos⁡(2πjx)\sqrt{2}\cos(2\pi jx) and 2sin⁡(2πjx)\sqrt{2}\sin(2\pi jx) for j=1,2,…j = 1, 2, \dots, each of length 1 and orthogonal to the others. The coordinates of ff are its Fourier coefficients aja_j (cosine) and bjb_j (sine), and its squared length is the sum of their squares, Parseval's identity.

Coefficients carry smoothness. For a differentiable ff with f(0)=f(1)f(0) = f(1), integrating by parts moves the derivative onto the basis function and brings out a factor 1/(2πj)1/(2\pi j): the cosine coefficient of ff is −1/(2πj)-1/(2\pi j) times the sine coefficient of f′f', and the sine coefficient of ff is 1/(2πj)1/(2\pi j) times the cosine coefficient of f′f'. Parseval's identity for f′f' then gives

∫01f′(x)2 dx=∑j≥1(2πj)2(aj2+bj2).\int_0^1 f'(x)^2\, \dd x = \sum_{j \ge 1} (2\pi j)^2 \left(a_j^2 + b_j^2\right).
(10.1)

The energy of the slope, a natural measure of roughness, is a sum of squared coefficients with weights that grow with frequency. High frequencies are expensive and low ones cheap. The norm of Section 10.2 has this shape, with weights chosen by the kernel.

10.1.3 The kernel matrix as a view of an operator #

A matrix maps vectors to vectors. A kernel maps functions to functions:

(Kg)(x)=∫k(x,x′) g(x′) q(x′) dx′,(\mathcal{K} g)(x) = \int k(x, x')\, g(x')\, q(x')\, \dd x' ,
(10.2)

a combination of the values of gg, weighted by how strongly xx is correlated with each x′x'. On the grid the integral becomes 1n∑jk(xi,xj) g(xj)\frac1n\sum_j k(x_i, x_j)\, g(x_j), the matrix-vector product 1nKg\frac1n\mK\vg. So K/n\mK/n is the operator K\mathcal{K} seen through nn points, and its eigenvalues approximate the operator's.

Section 3.4.4 met one such matrix: the RBF kernel with lengthscale 0.1 on 100 evenly spaced inputs, with largest eigenvalues 23.9, 21.2, and 17.5. Divided by 100 they are 0.239, 0.212, and 0.175. Those inputs include both ends of [0,1][0, 1]. Placed instead at the 100 midpoints of Section 10.1.1, as in Figure 10.1 below, they give 0.241, 0.214, and 0.176, and finer grids of midpoints leave these digits unchanged. The rapid decay that broke the Cholesky factorization there belongs to the operator, not to the grid.

10.2 The space a kernel defines #

The frequentist regret theorems of Chapter 13, which bound how much an optimizer loses against the best value it could have found for one fixed function, need a class of functions large enough to contain realistic objectives and small enough that finitely many evaluations can pin a member down. A kernel defines one, and the construction starts from the weight-space view of Chapter 7.

10.2.1 Functions built from bumps #

Take a kernel that comes from features, k(x,x′)=ϕ(x)⊤ϕ(x′)k(\vx, \vx') = \boldsymbol{\phi}(\vx)^\T\boldsymbol{\phi}(\vx'), as in Equation (7.3) with prior weight covariance I\mI. Each weight vector w\vw gives a function w⊤ϕ(x)\vw^\T\boldsymbol{\phi}(\vx), and the kernel bump k(⋅,x′)k(\cdot, \vx') is the one with weights ϕ(x′)\boldsymbol{\phi}(\vx'). A sum of bumps f=∑iαik(⋅,xi)f = \sum_i \alpha_i k(\cdot, \vx_i) therefore has weights ∑iαiϕ(xi)\sum_i \alpha_i \boldsymbol{\phi}(\vx_i), and for a second sum g=∑jβjk(⋅,xj′)g = \sum_j \beta_j k(\cdot, \vx'_j) the inner product of the two weight vectors is

⟨f,g⟩k=∑i∑jαiβj k(xi,xj′).\langle f, g \rangle_k = \sum_{i}\sum_{j} \alpha_i \beta_j\, k(\vx_i, \vx'_j).
(10.3)

The right side mentions no features, so it serves as a definition for any positive semidefinite kernel. It does not depend on how ff and gg are written as sums: grouping by jj gives ∑jβjf(xj′)\sum_j \beta_j f(\vx'_j) and grouping by ii gives ∑iαig(xi)\sum_i \alpha_i g(\vx_i), which depend only on the functions' values. The squared norm of ff is ∥f∥k2=α⊤Kα≥0\lVert f \rVert_k^2 = \bm{\alpha}^\T\mK\bm{\alpha} \ge 0.

10.2.2 The reproducing property #

With g=k(⋅,x)g = k(\cdot, \vx), a single bump with coefficient 1, the same grouping gives

⟨f,k(⋅,x)⟩k=f(x).\langle f, k(\cdot, \vx) \rangle_k = f(\vx).
(10.4)

Taking the inner product with a bump evaluates the function. This is the reproducing property. With f=k(⋅,x′)f = k(\cdot, \vx') it gives ⟨k(⋅,x′),k(⋅,x)⟩k=k(x,x′)\langle k(\cdot, \vx'), k(\cdot, \vx) \rangle_k = k(\vx, \vx'): the bumps are features for the kernel. The Cauchy-Schwarz inequality, ∣⟨f,g⟩k∣≤∥f∥k∥g∥k\lvert\langle f, g\rangle_k\rvert \le \lVert f\rVert_k\lVert g\rVert_k, applied to Equation (10.4) and to the difference of two bumps, gives two bounds (Chowdhury and Gopalan, 2017):

∣f(x)∣≤∥f∥kk(x,x),∣f(x)−f(x′)∣≤∥f∥kk(x,x)−2k(x,x′)+k(x′,x′).\lvert f(\vx) \rvert \le \lVert f \rVert_k \sqrt{k(\vx, \vx)}, \qquad \lvert f(\vx) - f(\vx') \rvert \le \lVert f \rVert_k \sqrt{k(\vx, \vx) - 2k(\vx, \vx') + k(\vx', \vx')}.
(10.5)

They say what the norm controls. Under a kernel with k(x,x)≤1k(\vx, \vx) \le 1, a function of norm at most BB never exceeds BB in absolute value. And it cannot change quickly: for the RBF kernel the second square root is 2−2e−r2/2ℓ2\sqrt{2 - 2e^{-r^2/2\ell^2}} at distance rr, which is 0.0999 at r=0.01r = 0.01 when ℓ=0.1\ell = 0.1, close to r/ℓr/\ell. Over a distance short compared with the lengthscale, such a function changes by at most about B r/ℓB\,r/\ell. Large values and fast changes cost norm.

The first bound also shows that only the zero function has norm zero, so ∥⋅∥k\lVert\cdot\rVert_k is a genuine length, and that sums of bumps converging in this norm converge at every input, so their limits are functions too. Adding those limits completes the construction.

Definition 10.1 Reproducing kernel Hilbert space

Let kk be a symmetric positive semidefinite kernel on X\X. Its reproducing kernel Hilbert space (RKHS) Hk\mathcal{H}_k is the space of functions obtained by completing the sums of bumps under the norm of Equation (10.3). It is the unique Hilbert space of functions (an inner-product space in which every sequence whose terms come arbitrarily close to one another has a limit in the space) that contains every bump k(⋅,x)k(\cdot, \vx) and in which Equation (10.4) holds for every member and every input (Aronszajn, 1950; Rasmussen and Williams, 2006, thm. 6.1).

For familiar kernels the space is recognizable. The line kernel k(x,x′)=xx′k(x, x') = xx' (Example 7.1 with σ0=0\sigma_0 = 0, σ1=1\sigma_1 = 1) has the lines f(x)=wxf(x) = wx as its RKHS, with norm ∣w∣\lvert w \rvert, the slope. For a kernel from finitely many features with weight covariance I\mI, the norm of ff is the length of the shortest weight vector that produces it (Steinwart and Christmann, 2008, ch. 4). The RKHS of a Matérn kernel with smoothness ν\nu on a bounded domain in dd dimensions holds the same functions as a Sobolev space, those whose derivatives up to order ν+d/2\nu + d/2 are square-integrable, with an equivalent norm, when ν+d/2\nu + d/2 is a whole number and the boundary is regular (Kanagawa et al., 2018, ex. 2.6). The RBF kernel's RKHS holds only functions whose Fourier transforms decay exponentially fast, so they are extremely smooth (Kanagawa et al., 2018, ex. 2.7).

10.2.3 The posterior mean lives in the space #

The posterior mean of Gaussian process regression is a weighted sum of bumps, one per observation (Equation (8.4)), so it lies in Hk\mathcal{H}_k. It also solves a problem stated without probability.

Derivation The representer theorem for squared error

Find the f∈Hkf \in \mathcal{H}_k that minimizes L(f)=∑i=1n(yi−f(xi))2+σn2∥f∥k2L(f) = \sum_{i=1}^n \big(y_i - f(\vx_i)\big)^2 + \sigma_n^2 \lVert f \rVert_k^2.

  1. Let SS be the span of k(⋅,x1),…,k(⋅,xn)k(\cdot, \vx_1), \dots, k(\cdot, \vx_n), and write f=fS+f⊥f = f_S + f_\perp with f⊥f_\perp orthogonal to every bump in SS.
  2. By Equation (10.4), f(xi)=⟨fS+f⊥,k(⋅,xi)⟩k=fS(xi)f(\vx_i) = \langle f_S + f_\perp, k(\cdot, \vx_i)\rangle_k = f_S(\vx_i). The data term sees only fSf_S.
  3. By Pythagoras, ∥f∥k2=∥fS∥k2+∥f⊥∥k2\lVert f\rVert_k^2 = \lVert f_S\rVert_k^2 + \lVert f_\perp\rVert_k^2, so dropping f⊥f_\perp lowers the penalty and the minimizer lies in SS: f=∑jαjk(⋅,xj)f = \sum_j \alpha_j k(\cdot, \vx_j).
  4. Then the fitted values are Kα\mK\bm{\alpha} and L=∥y−Kα∥2+σn2α⊤KαL = \lVert\vy - \mK\bm{\alpha}\rVert^2 + \sigma_n^2\bm{\alpha}^\T\mK\bm{\alpha}.
  5. The gradient, −2K(y−(K+σn2I)α)-2\mK\big(\vy - (\mK + \sigma_n^2\mI)\bm{\alpha}\big), vanishes at α=(K+σn2I)−1y\bm{\alpha} = (\mK + \sigma_n^2\mI)^{-1}\vy, so f(x)=k(x)⊤(K+σn2I)−1yf(\vx) = \vk(\vx)^\T(\mK + \sigma_n^2\mI)^{-1}\vy: the posterior mean of Equation (8.6).

That a penalized fit over an infinite-dimensional space has a solution with nn terms is the representer theorem, first stated for squared error by Kimeldorf and Wahba (1971); the match with the Gaussian process posterior mean goes back to Kimeldorf and Wahba (1970) (see also Kanagawa et al., 2018, prop. 3.6). With the data term a plain sum, as here, the penalty weight is the noise variance, the kernel ridge regression of Section 8.2.1. In weight space the match is expected: with w∼N(0,I)\vw \sim \N(\mathbf{0}, \mI), minus twice the log posterior is σn−2∑i(yi−f(xi))2+∥w∥2\sigma_n^{-2}\sum_i(y_i - f(\vx_i))^2 + \lVert\vw\rVert^2 up to a constant, and the shortest w\vw for ff has length ∥f∥k\lVert f\rVert_k. The squared norm plays the part of minus twice the log prior.

The posterior mean of Figure 8.1 at its defaults (lengthscale 0.12, four observations, the largest 0.85 in absolute value) has ∥μ∥k2=α⊤Kα=1.39\lVert\mu\rVert_k^2 = \bm{\alpha}^\T\mK\bm{\alpha} = 1.39, so Equation (10.5) caps it at 1.18, above its actual maximum: the norm is a guarantee, not a description.

10.2.4 What a norm bound assumes #

The frequentist regret theorems (Section 13.4.4, Section 21.3, Chapter 29), in which ff is one fixed function and the only randomness is the evaluation noise, assume that ff lies in Hk\mathcal{H}_k with a known bound on its norm. By the sections above, if ∥f∥k≤B\lVert f\rVert_k \le B and k(x,x)≤1k(\vx, \vx) \le 1, then ff is no larger than BB anywhere, changes by at most about BB per lengthscale, and puts little weight where the kernel says weight is expensive. The assumption depends on the kernel and its lengthscale, not only on ff: a longer lengthscale makes fast changes more expensive, and under the RBF kernel a Gaussian bump of width ℓ/2≈0.71 ℓ\ell/\sqrt{2} \approx 0.71\,\ell or less has infinite norm (Exercise 10.1).

Two conventions are in use, and they differ by a square. Srinivas et al. (2010) assume ∥f∥k2≤B\lVert f \rVert_k^2 \le B, as Section 13.4.4 does; Chowdhury and Gopalan (2017) and the preference papers of Section 21.3 and Chapter 29 assume ∥f∥k≤B\lVert f\rVert_k \le B. In the second convention the bound enters the confidence width directly. For noise that is RR-sub-Gaussian (tails no heavier than those of a Gaussian with standard deviation RR), Chowdhury and Gopalan show that with probability at least 1−δ1 - \delta, ∣μt−1(x)−f(x)∣≤βt1/2σt−1(x)\lvert\mu_{t-1}(\vx) - f(\vx)\rvert \le \beta_t^{1/2}\sigma_{t-1}(\vx) for all x\vx and all rounds t≤Tt \le T, with βt1/2=B+R2(γt−1+1+log⁡(1/δ))\beta_t^{1/2} = B + R\sqrt{2(\gamma_{t-1} + 1 + \log(1/\delta))} (Chowdhury and Gopalan, 2017, thm. 2); their posterior and their γt−1\gamma_{t-1} use the noise variance 1+2/T1 + 2/T in place of σn2\sigma_n^2, and their βt\beta_t is the square root of the book's. Chapter 13 explains where such widths come from. In practice BB is unknown, and the kernel that sets its units is fitted from the same data (Section 13.5.2).

10.2.5 Samples are rougher than the space #

The Bayesian theorem of Section 13.4.1 assumes instead that ff is a draw from GP(0,k)\GP(0, k). It is natural to guess that a typical draw has a moderate norm in Hk\mathcal{H}_k. It has none at all.

Derivation A draw from the prior is almost never in its RKHS

Let x1,x2,…\vx_1, \vx_2, \dots be distinct inputs whose kernel matrices Kn\mK_n are all invertible; for the RBF and Matérn kernels any distinct inputs qualify (Section 10.4.1).

  1. Interpolation bound. For g∈Hkg \in \mathcal{H}_k with values gn\vg_n at x1,…,xn\vx_1, \dots, \vx_n, steps 1 to 3 above (with no data term) show that its part gSg_S in the span of the first nn bumps has the same values and no larger norm. With gS=∑jαjk(⋅,xj)g_S = \sum_j \alpha_j k(\cdot, \vx_j) and Knα=gn\mK_n\bm{\alpha} = \vg_n, this gives ∥g∥k2≥α⊤Knα=gn⊤Kn−1gn\lVert g\rVert_k^2 \ge \bm{\alpha}^\T\mK_n\bm{\alpha} = \vg_n^\T\mK_n^{-1}\vg_n.
  2. The same quantity for a draw. Write the draw's values as fn=Lnz\vf_n = \mL_n\vz, with Ln\mL_n the Cholesky factor of Kn\mK_n and z\vz standard normal (Section 4.3.1). Then Qn=fn⊤Kn−1fn=z⊤z=z12+⋯+zn2Q_n = \vf_n^\T\mK_n^{-1}\vf_n = \vz^\T\vz = z_1^2 + \dots + z_n^2.
  3. Nesting. Adding xn+1\vx_{n+1} appends a row to Ln\mL_n without changing it, so the first nn entries of z\vz stay put and Qn+1=Qn+zn+12Q_{n+1} = Q_n + z_{n+1}^2.
  4. No bound. QnQ_n has mean nn and standard deviation 2n\sqrt{2n}, so for any fixed cc the probability that Qn≤cQ_n \le c tends to zero. Since QnQ_n only grows, the probability that it stays below cc for every nn is zero.
  5. A draw in Hk\mathcal{H}_k would have Qn≤∥f∥k2Q_n \le \lVert f\rVert_k^2 for every nn by step 1, so for some whole number cc it would have Qn≤cQ_n \le c for every nn. The norm differs from draw to draw, so step 4, which is about a fixed cc, does not apply to it directly. But for each of the countably many c=1,2,3,…c = 1, 2, 3, \dots the event has probability zero by step 4, and so does their union, since the probability of a union is at most the sum of the probabilities (Equation (13.7), with countably many events).

The general statement is a zero-one law: a Gaussian process lies in a given RKHS with probability 0 or 1, and in the RKHS of its own kernel with probability 0 whenever that space is infinite-dimensional (Driscoll, 1973; Lukić and Beder, 2001; Kanagawa et al., 2018, thm. 4.9 and cor. 4.10). Read through nn inputs, a draw looks like a function of squared norm about nn, and each new input adds about 1. The posterior mean is a finite sum of bumps, and averaging removes the roughness (Rasmussen and Williams, 2006, sec. 6.1).

Draws do lie in slightly larger spaces of rougher functions. For the RBF kernel the difference rarely matters (Kanagawa et al., 2018, cor. 4.13 and remark 4.13). For a Matérn kernel it does: the RKHS asks for Sobolev smoothness ν+d/2\nu + d/2, while draws have every order below ν\nu and no more, rougher by d/2d/2 (Kanagawa et al., 2018, cor. 4.15 and remarks 4.14 and 4.15).

So the two settings of Chapter 13 assume different things. The Bayesian theorem is about draws, which no bound BB covers; the frequentist theorems are about members of Hk\mathcal{H}_k, a set to which the prior gives probability zero. Neither contains the other, as Srinivas et al. (2010) note. Choosing a Matérn 5/2 kernel in dd dimensions and then quoting a frequentist bound assumes smoothness 5/2+d/25/2 + d/2, more than the draws of the same prior have (inference).

Sources cited in Section 10.2 10
  1. Chowdhury and Gopalan (2017) On Kernelized Multi-armed Bandits
  2. Aronszajn (1950) Theory of Reproducing Kernels
  3. Rasmussen and Williams (2006) Gaussian Processes for Machine Learning
  4. Steinwart and Christmann (2008) Support Vector Machines
  5. Kanagawa et al. (2018) Gaussian Processes and Kernel Methods: A Review on Connections and Equivalences
  6. Kimeldorf and Wahba (1971) Some Results on Tchebycheffian Spline Functions
  7. Kimeldorf and Wahba (1970) A Correspondence Between Bayesian Estimation on Stochastic Processes and Smoothing by Splines
  8. Srinivas et al. (2010) Gaussian Process Optimization in the Bandit Setting: No Regret and Experimental Design
  9. Driscoll (1973) The Reproducing Kernel Hilbert Space Structure of the Sample Paths of a Gaussian Process
  10. Lukić and Beder (2001) Stochastic Processes with Sample Paths in Reproducing Kernel Hilbert Spaces

10.3 Mercer's theorem #

Bumps overlap and are not orthogonal, so they make awkward coordinates. For a symmetric matrix, Section 3.4.1 found better ones, the eigenvectors. The operator K\mathcal{K} is the continuous version of a symmetric matrix, and the same move works.

10.3.1 Eigenfunctions and the expansion of the kernel #

An eigenfunction of K\mathcal{K} is a function φ\varphi that the operator only rescales, Kφ=λφ\mathcal{K}\varphi = \lambda\varphi, with eigenvalue λ\lambda. (This chapter writes φi\varphi_i for eigenfunctions, to keep them apart from the features ϕ\boldsymbol{\phi} of Chapter 7 and the normal density ϕ\phi.)

Theorem 10.1 Mercer's theorem

Let X\X be a closed and bounded subset of Rd\R^d, kk a continuous, symmetric, positive semidefinite kernel on X\X, and qq a weighting that gives positive weight to every open region of X\X (a density with q>0q > 0, or more generally a finite measure whose support is X\X). Then K\mathcal{K} has eigenvalues λ1≥λ2≥⋯>0\lambda_1 \ge \lambda_2 \ge \dots > 0, finitely or countably many, with eigenfunctions φ1,φ2,…\varphi_1, \varphi_2, \dots orthonormal under ⟨⋅,⋅⟩q\langle\cdot,\cdot\rangle_q, and

k(x,x′)=∑iλi φi(x) φi(x′)k(\vx, \vx') = \sum_{i} \lambda_i\, \varphi_i(\vx)\, \varphi_i(\vx')
(10.6)

for all x,x′∈X\vx, \vx' \in \X, the series converging absolutely and uniformly (Mercer, 1909; Steinwart and Christmann, 2008, thm. 4.49; Kanagawa et al., 2018, thm. 4.1).

Equation (10.6) is the spectral theorem Theorem 3.1, A=∑iλiuiui⊤\mA = \sum_i \lambda_i\mathbf{u}_i\mathbf{u}_i^\T, with functions in place of vectors. The conditions matter: where the weighting gives no weight, the expansion can fail (Kanagawa et al., 2018, remark 4.2). The eigenvalues and eigenfunctions depend on the weighting, while the kernel and its RKHS do not (Kanagawa et al., 2018, remarks 4.1 and 4.3). Three consequences follow.

The eigenvalues are a variance budget. Setting x′=x\vx' = \vx in Equation (10.6) and integrating against qq gives, by orthonormality, ∑iλi=∫k(x,x) q(x) dx\sum_i \lambda_i = \int k(\vx, \vx)\, q(\vx)\, \dd\vx. For a stationary kernel and a probability density qq, the eigenvalues sum to σf2\sigma_f^2, the prior variance, and say how it is shared among directions.

Every kernel is an inner product of features. With ϕ(x)=(λ1φ1(x),λ2φ2(x),… )\boldsymbol{\phi}(\vx) = (\sqrt{\lambda_1}\varphi_1(\vx), \sqrt{\lambda_2}\varphi_2(\vx), \dots), Equation (10.6) reads k(x,x′)=ϕ(x)⊤ϕ(x′)k(\vx, \vx') = \boldsymbol{\phi}(\vx)^\T\boldsymbol{\phi}(\vx'). This is the converse quoted in Section 7.2.2.

The RKHS norm in eigen-coordinates. Expand f=∑iciφif = \sum_i c_i\varphi_i with ci=⟨f,φi⟩qc_i = \langle f, \varphi_i\rangle_q. Then f∈Hkf \in \mathcal{H}_k exactly when the following sum is finite, and

∥f∥k2=∑ici2λi\lVert f \rVert_k^2 = \sum_i \frac{c_i^2}{\lambda_i}
(10.7)

(Rasmussen and Williams, 2006, sec. 6.1; Kanagawa et al., 2018, thm. 4.2). The reproducing property checks it: by Equation (10.6) the bump k(⋅,x)k(\cdot, \vx) has coefficients λiφi(x)\lambda_i\varphi_i(\vx), so ⟨f,k(⋅,x)⟩k=∑iciλiφi(x)/λi=f(x)\langle f, k(\cdot,\vx)\rangle_k = \sum_i c_i\lambda_i\varphi_i(\vx)/\lambda_i = f(\vx). This is Equation (10.1) with weights 1/λi1/\lambda_i chosen by the kernel, and the continuous form of f⊤K−1f\vf^\T\mK^{-1}\vf written in the eigenvectors of K\mK (Rasmussen and Williams, 2006, sec. 6.1). A direction with a small eigenvalue is expensive: a coefficient cc along it costs c2/λic^2/\lambda_i.

10.3.2 The eigen-expansion of a sample #

The same coordinates describe the prior. With independent standard normal numbers z1,z2,…z_1, z_2, \dots, set

f(x)=∑iλi zi φi(x).f(\vx) = \sum_i \sqrt{\lambda_i}\, z_i\, \varphi_i(\vx).
(10.8)

Then E[f(x)f(x′)]=∑i,jλiλj E[zizj] φi(x)φj(x′)=∑iλiφi(x)φi(x′)=k(x,x′)\E[f(\vx)f(\vx')] = \sum_{i,j}\sqrt{\lambda_i\lambda_j}\,\E[z_iz_j]\,\varphi_i(\vx)\varphi_j(\vx') = \sum_i\lambda_i\varphi_i(\vx)\varphi_i(\vx') = k(\vx, \vx'), since E[zizj]\E[z_iz_j] is 1 for i=ji = j and 0 otherwise. So Equation (10.8) is a draw from GP(0,k)\GP(0, k) written in the eigenbasis, with independent coefficients of variance λi\lambda_i. This is the Karhunen-Loève expansion; the series converges in mean square, uniformly over the domain (Kanagawa et al., 2018, thm. 4.3; Berlinet and Thomas-Agnan, 2004, sec. 2.3). By orthonormality, keeping the first mm terms leaves an average squared error of

E ⁣[∫(f(x)−fm(x))2q(x) dx]=∑i>mλi,\E\!\left[\int \big(f(\vx) - f_m(\vx)\big)^2 q(\vx)\, \dd\vx\right] = \sum_{i > m} \lambda_i ,
(10.9)

the eigenvalue mass left out.

The two readings of a small eigenvalue agree: the prior gives the direction little variance, λi\lambda_i, and the norm charges it heavily, 1/λi1/\lambda_i. By Equation (10.7) the truncated draw has ∥fm∥k2=∑i≤mzi2\lVert f_m\rVert_k^2 = \sum_{i \le m} z_i^2, about mm, the picture of Section 10.2.5 in eigen-coordinates. This last step is intuition rather than proof, because the full series converges in mean square and not in the norm (Kanagawa et al., 2018, remark 4.9); Section 10.2.5 gave the proof.

10.3.3 Computing them #

Eigenfunctions rarely have a closed form. They are computed as Section 10.1.3 suggested: on a grid of nn points with uniform weighting, the eigenvalues of K/n\mK/n estimate the λi\lambda_i, and the eigenvectors times n\sqrt{n} estimate the φi\varphi_i at the grid points. This is the Nyström method; it estimates the larger eigenvalues better than the smaller ones (Rasmussen and Williams, 2006, sec. 4.3.2).

Eigenvalues λi (log axes)RBF ●Matérn 5/2Matérn 3/2Matérn 1/210⁻¹⁴10⁻¹⁰10⁻⁶10⁻²125102040index ibelow 10⁻¹⁴: rounding errorFirst four eigenfunctionsφ1φ2φ3φ4−1010.00.20.40.60.81.0input xA draw built from the first m termsfirst 10 termsall 100 terms (exact on the grid)−2−1012f(x)0.00.20.40.60.81.0input xλ1 = 0.241, λ2 = 0.214, λ3 = 0.176; the λi sum to 1.00The first 10 terms hold 99.5% of the prior variance; the draw's squared RKHS norm, Σ zi², is 8.7
Eigenvalues λi (log axes)RBF ●Matérn 5/2Matérn 3/2Matérn 1/210⁻¹⁴10⁻¹⁰10⁻⁶10⁻²125102040index ibelow 10⁻¹⁴: rounding errorFirst four eigenfunctionsφ1φ2φ3φ4−1010.00.20.40.60.81.0input xA draw built from the first m termsfirst 10 termsall 100 terms (exact on the grid)−2−1012f(x)0.00.20.40.60.81.0input xλ1 = 0.241, λ2 = 0.214, λ3 = 0.176; the λi sum to 1.00The first 10 terms hold 99.5% of the prior variance;the draw's squared RKHS norm, Σ zi², is 8.7
Figure 10.1 Mercer's theorem computed. Top left: the eigenvalues λi\lambda_i of four kernels with unit amplitude on [0,1][0, 1] under the uniform weighting, on log axes, from the Nyström method on 100 grid midpoints (Rasmussen and Williams, 2006, sec. 4.3.2); values below 10−1410^{-14} are rounding error and are not drawn. Top right: the first four eigenfunctions of the chosen kernel. Bottom: a draw built from the first mm terms of the Karhunen-Loève expansion Equation (10.8) (solid), against the draw from all 100 terms with the same random numbers, an exact draw of the process on the grid (dashed). The readout gives the share of the prior variance in the first mm terms and the squared RKHS norm ∑i≤mzi2\sum_{i \le m} z_i^2 of the truncated draw. Press Draw again for new random numbers.

Read the default. The RBF kernel with lengthscale 0.1 has largest eigenvalues 0.241, 0.214, and 0.176, the values of Section 10.1.3; all of its eigenvalues together sum to 1.00, the prior variance, and they reach the rounding floor by the 32nd. The first four eigenfunctions look like cosines with 0, 1, 2, and 3 sign changes.

Move the terms slider. One term holds 24% of the prior variance and ten hold 99.5%; the ten-term draw is hard to tell from the exact one. The squared norm of the truncated draw keeps growing, 8.7 with ten terms and 96.5 with all 100, though the draw barely changes.

Switch to Matérn 1/2. The eigenvalues fall on a straight line on log axes, a power law. Ten terms hold 80% of the variance and twenty about 90%. The truncated draw is smooth and the exact one jagged: the roughness lives in the many small eigenvalues.

Compare the slopes. The Matérn lines have slopes near −2-2, −4-4, and −6-6 for ν=1/2\nu = 1/2, 3/23/2, and 5/25/2; on a grid of 3,000 points, between the 20th and 60th eigenvalues, they are −2.03-2.03, −4.00-4.00, and −5.89-5.89. The eigenvalues decay like i−(2ν+1)i^{-(2\nu + 1)}, in line with the result of Ritter and colleagues that a process with rr mean-square derivatives on [0,1][0, 1] has eigenvalues decaying like i−(2r+2)i^{-(2r + 2)} (Rasmussen and Williams, 2006, sec. 4.3).

Lengthen the lengthscale to 0.3. The first RBF eigenvalue rises to 0.590 and four terms hold 99.6% of the variance: a longer lengthscale concentrates the prior on fewer directions.

Sources cited in Section 10.3 5
  1. Mercer (1909) Functions of Positive and Negative Type, and Their Connection with the Theory of Integral Equations
  2. Steinwart and Christmann (2008) Support Vector Machines
  3. Kanagawa et al. (2018) Gaussian Processes and Kernel Methods: A Review on Connections and Equivalences
  4. Rasmussen and Williams (2006) Gaussian Processes for Machine Learning
  5. Berlinet and Thomas-Agnan (2004) Reproducing Kernel Hilbert Spaces in Probability and Statistics

10.4 Bochner's theorem #

Mercer's eigenfunctions depend on the domain and the weighting, and must be computed. For a stationary kernel, which depends only on r=x−x′\mathbf{r} = \vx - \vx' (Section 7.5.1), there is a description that needs neither: a list of frequencies and the variance each carries.

10.4.1 Kernels as spectra #

Start from one cosine with a random amplitude. If f(x)=acos⁡(ωx)+bsin⁡(ωx)f(x) = a\cos(\omega x) + b\sin(\omega x) with a,ba, b independent standard normals, then Cov⁡[f(x),f(x′)]=cos⁡ωxcos⁡ωx′+sin⁡ωxsin⁡ωx′=cos⁡(ω(x−x′))\Cov[f(x), f(x')] = \cos\omega x\cos\omega x' + \sin\omega x\sin\omega x' = \cos\big(\omega(x - x')\big), a stationary kernel. Mixtures over frequencies give more, and Bochner's theorem says they give all.

Theorem 10.2 Bochner's theorem

A continuous function kk on Rd\R^d is a stationary kernel, meaning that k(x−x′)k(\vx - \vx') is positive semidefinite, exactly when k(r)=∫eiω⊤r Λ(dω)k(\mathbf{r}) = \int e^{i\boldsymbol{\omega}^\T\mathbf{r}}\, \Lambda(\dd\boldsymbol{\omega}) for a finite nonnegative measure Λ\Lambda over frequencies ω\boldsymbol{\omega} (Bochner, 1933; Rasmussen and Williams, 2006, thm. 4.1).

For the kernels of this book Λ\Lambda has a density s(ω)s(\boldsymbol{\omega}), the spectral density, symmetric in ω\boldsymbol{\omega}, and k(r)=∫s(ω)cos⁡(ω⊤r) dωk(\mathbf{r}) = \int s(\boldsymbol{\omega})\cos(\boldsymbol{\omega}^\T\mathbf{r})\,\dd\boldsymbol{\omega}. Frequencies here are in radians per unit of input; Rasmussen and Williams use cycles, ω=2πs\boldsymbol{\omega} = 2\pi\mathbf{s}, which rescales the density but not its shape (Rasmussen and Williams, 2006, eq. 4.6). Since ∫s=k(0)=σf2\int s = k(\mathbf{0}) = \sigma_f^2, p=s/σf2p = s/\sigma_f^2 is a probability density, and

k(r)=σf2 Eω∼p ⁣[cos⁡(ω⊤r)].k(\mathbf{r}) = \sigma_f^2\, \E_{\boldsymbol{\omega} \sim p}\!\left[\cos(\boldsymbol{\omega}^\T\mathbf{r})\right].
(10.10)

One direction of the theorem is short. For inputs x1,…,xn\vx_1, \dots, \vx_n and coefficients aia_i, the identity cos⁡(θ−θ′)=cos⁡θcos⁡θ′+sin⁡θsin⁡θ′\cos(\theta - \theta') = \cos\theta\cos\theta' + \sin\theta\sin\theta' gives

∑i,jaiaj k(xi−xj)=∫s(ω)[(∑iaicos⁡ω⊤xi)2+(∑iaisin⁡ω⊤xi)2]dω  ≥  0.\sum_{i,j} a_ia_j\, k(\vx_i - \vx_j) = \int s(\boldsymbol{\omega})\left[\Big(\sum_i a_i\cos\boldsymbol{\omega}^\T\vx_i\Big)^2 + \Big(\sum_i a_i\sin\boldsymbol{\omega}^\T\vx_i\Big)^2\right]\dd\boldsymbol{\omega} \;\ge\; 0 .

If ss is positive at every frequency, as for the RBF and Matérn kernels, the integral is positive unless all aia_i are zero, because for distinct inputs the two sums cannot vanish together at every frequency. Every kernel matrix of distinct inputs is then invertible, which Section 10.2.5 used (Wendland, 2004, ch. 6). The converse, that every stationary kernel has such a spectrum, is the deep part.

10.4.2 The spectra of the RBF and Matérn kernels #

For the RBF kernel the frequencies are Gaussian, p=N(0,ℓ−2I)p = \N(\mathbf{0}, \ell^{-2}\mI), so a typical frequency is about 1/ℓ1/\ell (Exercise 10.2). For the Matérn kernel they follow a Student-t distribution with 2ν2\nu degrees of freedom and scale 1/ℓ1/\ell,

p(ω)∝(1+ℓ2∥ω∥22ν)−(ν+d/2),p(\boldsymbol{\omega}) \propto \left(1 + \frac{\ell^2\lVert\boldsymbol{\omega}\rVert^2}{2\nu}\right)^{-(\nu + d/2)},
(10.11)

which is eq. 4.15 of Rasmussen and Williams (2006) in radians. For ν=1/2\nu = 1/2 in one dimension it is the Cauchy distribution, p(ω)=(ℓ/π)/(1+ℓ2ω2)p(\omega) = (\ell/\pi)/(1 + \ell^2\omega^2).

The tails differ. The Gaussian falls faster than any power, while Equation (10.11) falls like ∥ω∥−(2ν+d)\lVert\boldsymbol{\omega}\rVert^{-(2\nu + d)}, keeping a little variance at every high frequency, more for smaller ν\nu. The tails set the smoothness. Differentiating Equation (10.10) twice at r=0\mathbf{r} = 0 in one dimension gives −k′′(0)=σf2∫ω2p(ω) dω-k''(0) = \sigma_f^2\int\omega^2 p(\omega)\,\dd\omega, the variance of the mean-square derivative f′(x)f'(x) (Section 7.5.3). It is finite only if the tail falls faster than ∣ω∣−3\lvert\omega\rvert^{-3}, which for the Matérn kernel means 2ν+1>32\nu + 1 > 3, or ν>1\nu > 1. With higher even powers of ω\omega in place of ω2\omega^2 the same argument gives the rule of Table 9.1: a mean-square derivative of every whole order below ν\nu, and none of order ν\nu or above. And −k′′(0)/k(0)\sqrt{-k''(0)/k(0)}, the root-mean-square frequency, is what Equation (7.6) counts: for Matérn 5/2 the Student-t with 5 degrees of freedom has variance 5/35/3 in units of 1/ℓ21/\ell^2, the k′′(0)=−5/(3ℓ2)k''(0) = -5/(3\ell^2) of Exercise 7.4.

Mercer and Bochner describe the same kernel, and on a domain without ends they coincide. Join the ends of [0,1][0, 1] into a circle and wrap the kernel around it, k∘(r)=∑mk(r+m)k_\circ(r) = \sum_m k(r + m) over all integers mm. Integrating k∘(x−y)cos⁡(2πjy)k_\circ(x - y)\cos(2\pi jy) over one turn equals integrating k(x−y)cos⁡(2πjy)k(x - y)\cos(2\pi jy) over the whole line: substituting u=y−mu = y - m turns the integral of the term k(x−y+m)cos⁡(2πjy)k(x - y + m)\cos(2\pi jy) over [0,1][0, 1] into the integral of k(x−u)cos⁡(2πju)k(x - u)\cos(2\pi ju) over [−m,1−m][-m, 1 - m], since the cosine repeats with period 1, and these intervals cover the line. With r=x−yr = x - y, the cosine splits as cos⁡(2πjx)cos⁡(2πjr)+sin⁡(2πjx)sin⁡(2πjr)\cos(2\pi jx)\cos(2\pi jr) + \sin(2\pi jx)\sin(2\pi jr). The sine part integrates to zero because kk is even, and the cosine part gives 2πs(2πj)cos⁡(2πjx)2\pi s(2\pi j)\cos(2\pi jx), because the spectral density is recovered from the kernel by s(ω)=12π∫k(r)cos⁡(ωr) drs(\omega) = \frac{1}{2\pi}\int k(r)\cos(\omega r)\,\dd r (Rasmussen and Williams, 2006, eq. 4.6). Sines work the same way. So the eigenfunctions on the circle are Fourier's, and the eigenvalues are λj=2πs(2πj)\lambda_j = 2\pi s(2\pi j): the spectral density sampled at the frequencies that fit around the circle. Eigenvalue decay is spectral decay. Since the iith eigenvalue sits near frequency πi\pi i, a Matérn spectrum falling like ∣ω∣−(2ν+1)\lvert\omega\rvert^{-(2\nu+1)} gives eigenvalues falling like i−(2ν+1)i^{-(2\nu + 1)}, the slopes of Figure 10.1. The interval's ends change the values but not the tail: at lengthscale 0.1 the 80th Matérn 1/2 eigenvalue is 3.24×10−43.24 \times 10^{-4} on the interval and 3.16×10−43.16 \times 10^{-4} on the circle.

10.4.3 Random Fourier features #

Equation (10.10) turns a kernel into an expectation, which an average can estimate. Draw frequencies ω1,…,ωM\boldsymbol{\omega}_1, \dots, \boldsymbol{\omega}_M from pp and use the 2M2M features

z(x)=σfM(cos⁡ω1⊤x,…,cos⁡ωM⊤x,sin⁡ω1⊤x,…,sin⁡ωM⊤x).\mathbf{z}(\vx) = \frac{\sigma_f}{\sqrt{M}}\big(\cos\boldsymbol{\omega}_1^\T\vx, \dots, \cos\boldsymbol{\omega}_M^\T\vx, \sin\boldsymbol{\omega}_1^\T\vx, \dots, \sin\boldsymbol{\omega}_M^\T\vx\big).
(10.12)

By the cosine identity, z(x)⊤z(x′)=σf2M∑jcos⁡ωj⊤(x−x′)\mathbf{z}(\vx)^\T\mathbf{z}(\vx') = \frac{\sigma_f^2}{M}\sum_{j}\cos\boldsymbol{\omega}_j^\T(\vx - \vx'), an average whose expectation is k(x−x′)k(\vx - \vx'). These are the random Fourier features of Rahimi and Recht (2007). With σf=1\sigma_f = 1 each term lies in [−1,1][-1, 1] and has variance 12(1+k(2r))−k(r)2\tfrac12(1 + k(2r)) - k(r)^2, which tends to 12\tfrac12 at large distances (Exercise 10.3), so the error at one distance is typically about 1/2M1/\sqrt{2M}. Accuracy ε\varepsilon at all pairs of inputs in a bounded domain at once needs MM of order (d/ε2)log⁡(1/ε)(d/\varepsilon^2)\log(1/\varepsilon), with the domain's diameter and the spread of pp entering through the logarithm (Rahimi and Recht, 2007, claim 1).

A weighted sum w⊤z(x)\mathbf{w}^\T\mathbf{z}(\vx) with w∼N(0,I)\mathbf{w} \sim \N(\mathbf{0}, \mI) is the linear model of Equation (7.1) with 2M2M features: an approximate draw from GP(0,k)\GP(0, k) that is a formula, costs O(Md)O(Md) per input, and can be maximized like any function. This is one way for Thompson sampling, which evaluates where a random draw from the posterior is largest (Section 12.5), to draw whole functions on a continuous domain, as Section 8.5 mentioned (Rahimi and Recht, 2007; Wilson et al., 2020).

Spectral density p(ω), relative to p(0)Matérn 3/2RBF, for comparison10⁻⁴10⁻³10⁻²10⁻¹10246810frequency × lengthscale, ωℓKernel k(r) and its estimate from M featuresexact k(r)(1/M) Σ cos(ωj r)−0.50.00.51.00.00.20.40.60.81.0distance rA draw from M random features, and an exact drawsum of M = 20 featuresexact draw (Cholesky)−2−1012f(x)0.00.20.40.60.81.0input xRoot-mean-square gap between estimate and kernel on [0, 1]: 0.152; 1/√(2M) = 0.158
Spectral density p(ω), relative to p(0)Matérn 3/2RBF, for comparison10⁻⁴10⁻³10⁻²10⁻¹10246810frequency × lengthscale, ωℓKernel k(r) and its estimate from M featuresexact k(r)(1/M) Σ cos(ωj r)−0.50.00.51.00.00.20.40.60.81.0distance rA draw from M random features, and an exact drawsum of M = 20 featuresexact draw (Cholesky)−2−1012f(x)0.00.20.40.60.81.0input xRoot-mean-square gap on [0, 1]: 0.152;for comparison, 1/√(2M) = 0.158
Figure 10.2 Bochner's theorem and random Fourier features, for kernels with unit amplitude. Top left: the spectral density p(ω)p(\omega) of the chosen kernel relative to its peak, on a log scale, against the scaled frequency ωℓ\omega\ell, with the RBF density dashed for comparison; ticks along the bottom mark the frequencies drawn (up to 200, those beyond the axis piled at its end). Top right: the kernel k(r)k(r) (dashed) and its estimate from MM random features, the average of cos⁡(ωjr)\cos(\omega_j r) (solid). Bottom: a draw built from the MM features with standard normal weights, against an exact draw from the same kernel by the Cholesky method of Section 4.3.1. The readout gives the root-mean-square gap between estimate and kernel over distances in [0,1][0, 1]. Raising MM adds frequencies without replacing earlier ones; Draw new frequencies gives another set.

Read the default. The Matérn 3/2 density falls like a power and is still near 10−310^{-3} of its peak at ωℓ=10\omega\ell = 10, where the RBF density has vanished. With M=20M = 20 the estimated kernel wanders around the true one, with a root-mean-square gap of 0.152 against 1/2M=0.1581/\sqrt{2M} = 0.158.

Raise M to 200, then 2000. The gap falls to 0.058, then 0.023, against 0.050 and 0.016: roughly the 1/M1/\sqrt{M} rate of an average, a factor of about three per tenfold increase in MM.

Switch to Matérn 1/2 at M = 20. The heavy Cauchy tail puts a few of the twenty frequencies far out, and they show as a regular ripple, in the kernel estimate and in the feature draw, which is otherwise smooth. The exact draw is rough at every scale. A heavy-tailed spectrum spreads its roughness over many high frequencies, each with little variance, and twenty features sample only a few of them.

Switch to RBF. The frequencies all lie within a few multiples of 1/ℓ1/\ell, and the feature draw has the character of the exact one at small MM, because RBF draws are made of such frequencies. The kernel estimate is no more accurate than before: its gap at M=20M = 20 is 0.161.

Sources cited in Section 10.4 5
  1. Bochner (1933) Monotone Funktionen, Stieltjessche Integrale und harmonische Analyse
  2. Rasmussen and Williams (2006) Gaussian Processes for Machine Learning
  3. Wendland (2004) Scattered Data Approximation
  4. Rahimi and Recht (2007) Random Features for Large-Scale Kernel Machines
  5. Wilson et al. (2020) Efficiently Sampling Functions from Gaussian Process Posteriors

10.5 From eigenvalues to information gain #

The regret bounds of Chapter 13 (bounds on an optimizer's total shortfall from the best value) depend on the maximum information gain γT\gamma_T (Definition 13.3), the most that TT noisy evaluations could reveal about ff. Section 6.5 quoted its growth for the RBF and Matérn kernels. The rates come from the eigenvalues.

10.5.1 Counting resolved directions #

Write the kernel matrix of TT inputs through Equation (10.6) as KA=ΦΛΦ⊤\mK_A = \boldsymbol{\Phi}\boldsymbol{\Lambda}\boldsymbol{\Phi}^\T, where row tt of Φ\boldsymbol{\Phi} holds the eigenfunctions at xt\vx_t and Λ\boldsymbol{\Lambda} holds the eigenvalues on its diagonal. The determinant lemma (Equation (B.7)) moves the information gain Equation (6.15) from the evaluations to the eigen-directions: det⁡(I+σn−2ΦΛΦ⊤)=det⁡(I+σn−2Λ1/2Φ⊤ΦΛ1/2)\det(\mI + \sigma_n^{-2}\boldsymbol{\Phi}\boldsymbol{\Lambda}\boldsymbol{\Phi}^\T) = \det(\mI + \sigma_n^{-2}\boldsymbol{\Lambda}^{1/2}\boldsymbol{\Phi}^\T\boldsymbol{\Phi}\boldsymbol{\Lambda}^{1/2}). If the inputs are spread in proportion to qq, then 1T∑tφi(xt)φj(xt)\frac1T\sum_t\varphi_i(\vx_t)\varphi_j(\vx_t) approximates ∫φiφj q\int\varphi_i\varphi_j\, q, which is 1 or 0, as the Riemann sum of Section 10.1.1 did, so Φ⊤Φ≈TI\boldsymbol{\Phi}^\T\boldsymbol{\Phi} \approx T\mI and

I(yA;f)≈12∑ilog⁡ ⁣(1+Tλiσn2).I(\vy_A; f) \approx \frac12\sum_i \log\!\left(1 + \frac{T\lambda_i}{\sigma_n^2}\right).
(10.13)

Each eigen-direction is a separate experiment: its coefficient has prior variance λi\lambda_i, and TT spread-out evaluations measure it with noise variance about σn2/T\sigma_n^2/T, which Equation (6.12) turns into the term above. A direction with Tλi≫σn2T\lambda_i \gg \sigma_n^2 is resolved and adds about 12log⁡(Tλi/σn2)\tfrac12\log(T\lambda_i/\sigma_n^2); one with Tλi≪σn2T\lambda_i \ll \sigma_n^2 adds about Tλi/(2σn2)T\lambda_i/(2\sigma_n^2). The information is roughly the number of resolved directions times half a logarithm, plus T/(2σn2)T/(2\sigma_n^2) times the unresolved eigenvalue mass.

Equation (10.13) is an approximation. Against the exact information of TT evenly spaced evaluations on [0,1][0, 1] (lengthscale 0.1, σn=0.1\sigma_n = 0.1), it is within 0.25% at T=100T = 100 for the RBF and the Matérn 5/2 and 3/2 kernels. For Matérn 1/2 it is 46% too high at T=100T = 100, because it counts 143 resolved directions, more than 100 evaluations can resolve, and 7.4% too high at T=1000T = 1000.

10.5.2 A bound from the eigenvalues #

The count can be made rigorous for any design by cutting at mm directions and paying for the eigenvalue mass beyond them.

Theorem 10.3 Information gain from eigenvalue decay (Vakili, Khezeli, and Picheny, 2021)

Let kk satisfy the conditions of Theorem 10.1, with ∣k(x,x′)∣≤kˉ\lvert k(\vx, \vx')\rvert \le \bar k and ∣φi(x)∣≤ψ\lvert\varphi_i(\vx)\rvert \le \psi for all ii and x\vx. For every m=1,2,…m = 1, 2, \dots,

γT≤m2log⁡ ⁣(1+kˉ Tσn2 m)+T δm2σn2,δm=ψ2∑i>mλi.\gamma_T \le \frac{m}{2}\log\!\left(1 + \frac{\bar k\, T}{\sigma_n^2\, m}\right) + \frac{T\,\delta_m}{2\sigma_n^2}, \qquad \delta_m = \psi^2\sum_{i > m}\lambda_i .
(10.14)

This is Theorem 3 of Vakili et al. (2021a), whose τ\tau is σn2\sigma_n^2 and whose DD is mm.

The tail δm\delta_m is eigenvalue mass, not a failure probability like the δ\delta of Section 10.2.4; the letter follows the paper. The bound on the eigenfunctions is an assumption, which the authors state holds for the kernels used in practice; we found no proof that it holds for the RBF and Matérn kernels on every domain and weighting. The proof needs only the tools of Section 6.3.

Derivation Proof of the bound

Fix TT inputs AA and split the kernel at mm: k=kP+kOk = k_P + k_O with kP=∑i≤mλiφiφik_P = \sum_{i \le m}\lambda_i\varphi_i\varphi_i and kOk_O the rest, both positive semidefinite.

  1. Split the function. Independent fP∼GP(0,kP)f_P \sim \GP(0, k_P) and fO∼GP(0,kO)f_O \sim \GP(0, k_O) sum to a process with kernel kk (Exercise 7.3), so with y=fP+fO+ε\vy = \vf_P + \vf_O + \bm{\varepsilon} at AA, 12log⁡det⁡(I+σn−2KA)\tfrac12\log\det(\mI + \sigma_n^{-2}\mK_A) is the information in y\vy about the sum (Equation (6.12)). The sum is computed from the pair (fP,fO)(f_P, f_O), so by the data processing inequality (Equation (6.10)) this is at most the information about the pair.
  2. Chain rule. That is I(y;fP)+I(y;fO ∣ fP)I(\vy; f_P) + I(\vy; f_O \given f_P) (Section 6.5.1) (Cover and Thomas, 2006, ch. 2). Given fPf_P, the data are fOf_O plus noise, so the second term is 12log⁡det⁡(I+σn−2KO)\tfrac12\log\det(\mI + \sigma_n^{-2}\mK_{O}). The first is at most the information of fP+ε\vf_P + \bm{\varepsilon} about fPf_P, since adding the independent fO\vf_O is further processing: 12log⁡det⁡(I+σn−2KP)\tfrac12\log\det(\mI + \sigma_n^{-2}\mK_{P}).
  3. The first mm directions. KP=ΦmΛmΦm⊤\mK_P = \boldsymbol{\Phi}_m\boldsymbol{\Lambda}_m\boldsymbol{\Phi}_m^\T, so by Equation (B.7) its determinant is that of the m×mm \times m matrix I+G\mI + \mathbf{G} with G=σn−2Λm1/2Φm⊤ΦmΛm1/2\mathbf{G} = \sigma_n^{-2}\boldsymbol{\Lambda}_m^{1/2}\boldsymbol{\Phi}_m^\T\boldsymbol{\Phi}_m\boldsymbol{\Lambda}_m^{1/2}. For its eigenvalues gj≥0g_j \ge 0, concavity of the logarithm gives ∑jlog⁡(1+gj)≤mlog⁡(1+1m∑jgj)\sum_j\log(1 + g_j) \le m\log(1 + \tfrac1m\sum_j g_j). A trace is unchanged when the factors of a product are rotated, so ∑jgj=tr⁡G=σn−2tr⁡KP=σn−2∑tkP(xt,xt)\sum_j g_j = \tr\mathbf{G} = \sigma_n^{-2}\tr\mK_P = \sigma_n^{-2}\sum_t k_P(\vx_t, \vx_t). Each term satisfies kP(x,x)=k(x,x)−kO(x,x)≤k(x,x)≤kˉk_P(\vx, \vx) = k(\vx, \vx) - k_O(\vx, \vx) \le k(\vx, \vx) \le \bar k, since kO(x,x)=∑i>mλiφi(x)2≥0k_O(\vx, \vx) = \sum_{i > m}\lambda_i\varphi_i(\vx)^2 \ge 0, so ∑jgj≤σn−2Tkˉ\sum_j g_j \le \sigma_n^{-2}T\bar k.
  4. The rest. Since log⁡(1+g)≤g\log(1 + g) \le g, log⁡det⁡(I+σn−2KO)≤σn−2tr⁡KO=σn−2∑tkO(xt,xt)\log\det(\mI + \sigma_n^{-2}\mK_O) \le \sigma_n^{-2}\tr\mK_O = \sigma_n^{-2}\sum_t k_O(\vx_t, \vx_t), and kO(x,x)=∑i>mλiφi(x)2≤δmk_O(\vx, \vx) = \sum_{i > m}\lambda_i\varphi_i(\vx)^2 \le \delta_m.
  5. Add steps 3 and 4, halve, and maximize over AA.

10.5.3 Polynomial and exponential decay #

The best mm balances the two terms of Equation (10.14), directions kept times log⁡T\log T against TT times the mass beyond them, and the balance depends only on how fast the eigenvalues fall.

Derivation Rates from the two kinds of decay

Polynomial decay, λi≤Ci−β\lambda_i \le C i^{-\beta} with β>1\beta > 1.

  1. ∑i>mi−β≤∫m∞u−β du=m1−β/(β−1)\sum_{i > m} i^{-\beta} \le \int_m^\infty u^{-\beta}\,\dd u = m^{1-\beta}/(\beta - 1), so the second term is of order Tm1−βT m^{1-\beta}; the first is of order mlog⁡Tm\log T.
  2. They match for m≈(T/log⁡T)1/βm \approx (T/\log T)^{1/\beta}, where both are of order T1/β(log⁡T)1−1/βT^{1/\beta}(\log T)^{1 - 1/\beta}.

For a Matérn kernel with ν>1/2\nu > 1/2 in dd dimensions, λi=O(i−(2ν+d)/d)\lambda_i = O(i^{-(2\nu + d)/d}) (Santin and Schaback, 2016; Vakili et al., 2021a, remark 2), so 1/β=d/(2ν+d)1/\beta = d/(2\nu + d) and γT=O(Td/(2ν+d)(log⁡T)2ν/(2ν+d))\gamma_T = O\big(T^{d/(2\nu + d)}(\log T)^{2\nu/(2\nu + d)}\big).

Exponential decay, in one dimension λi≤Ce−ci\lambda_i \le Ce^{-ci}.

  1. ∑i>me−ci≤e−cm/(1−e−c)\sum_{i > m}e^{-ci} \le e^{-cm}/(1 - e^{-c}).
  2. With m=⌈(log⁡T)/c⌉m = \lceil(\log T)/c\rceil, Te−cm≤1Te^{-cm} \le 1, so the second term is bounded by a constant and the first is of order (log⁡T)2/c(\log T)^2/c.

For the RBF kernel in dd dimensions, λi=O(e−c i1/d)\lambda_i = O(e^{-c\,i^{1/d}}) (Belkin, 2018; Vakili et al., 2021a, remark 2), and mm of order (log⁡T)d(\log T)^d gives γT=O((log⁡T)d+1)\gamma_T = O\big((\log T)^{d+1}\big) (Vakili et al., 2021a, cor. 1).

These are the rates of Section 6.5.2 and Table 13.1: the Matérn rate is that of Vakili et al. (2021a), stated for ν>1/2\nu > 1/2, and the RBF rate, first proved by Srinivas et al. (2010), is recovered by the same theorem. A kernel built from dd features, such as the linear kernel in dd dimensions, has at most dd nonzero eigenvalues, the tail vanishes at m=dm = d, and the bound gives O(dlog⁡T)O(d\log T) (Exercise 10.4). In words: a polynomially decaying spectrum keeps about Td/(2ν+d)T^{d/(2\nu + d)} directions within reach as TT grows, an exponentially decaying one only about (log⁡T)d(\log T)^d, and each resolved direction costs a logarithm. Smoothness lowers the exponent; dimension raises it.

The rates are asymptotic. Figure 10.3 computes exactly the information that TT evaluations spread evenly over [0,1][0, 1] gather, a lower bound on γT\gamma_T, since γT\gamma_T takes the best design.

Information from T evaluations spread evenly over [0, 1], in natsRBFMatérn 5/2Matérn 3/2Matérn 1/2every evaluation new101001k10⁰10¹10²10³evaluations T··· slope 1/(2ν+1)RBF: 36.5 nats at T = 100; local slope 0.19; slope tends to 0Matérn 5/2: 53.4 nats at T = 100; local slope 0.26; large-T slope 1/6 ≈ 0.17Matérn 3/2: 70.2 nats at T = 100; local slope 0.32; large-T slope 1/4 ≈ 0.25Matérn 1/2: 150.4 nats at T = 100; local slope 0.73; large-T slope 1/2 ≈ 0.50
Information from T evaluations spread evenly over [0, 1], in natsRBFMatérn 5/2Matérn 3/2Matérn 1/2every evaluation new101001k10⁰10¹10²10³evaluations T··· slope 1/(2ν+1)RBF: 36.5 nats at T = 100;local slope 0.19; slope tends to 0Matérn 5/2: 53.4 nats at T = 100;local slope 0.26; large-T slope 1/6 ≈ 0.17Matérn 3/2: 70.2 nats at T = 100;local slope 0.32; large-T slope 1/4 ≈ 0.25Matérn 1/2: 150.4 nats at T = 100;local slope 0.73; large-T slope 1/2 ≈ 0.50
Figure 10.3 The information 12log⁡det⁡(I+σn−2KT)\tfrac12\log\det(\mI + \sigma_n^{-2}\mK_T) that TT evaluations at evenly spaced inputs in [0,1][0, 1] gather about ff, in nats, for four kernels with unit amplitude, on log axes. It is computed exactly and is a lower bound on γT\gamma_T. The dashed line, TT times the information of one evaluation, is what TT completely new evaluations would gather. The dotted segments between T=100T = 100 and 10001000 have the slopes 1/(2ν+1)1/(2\nu + 1) that the eigenvalue decay of each Matérn kernel predicts for large TT in one dimension. The readout gives each kernel's information at the chosen TT and its local slope, the slope on log axes between T/2T/2 and 2T2T (between T/2T/2 and TT at the right edge).

Read the default. At T=100T = 100, with lengthscale 0.1 and noise standard deviation 0.1, the RBF kernel gathers 36.5 nats, Matérn 5/2 53.4, Matérn 3/2 70.2, and Matérn 1/2 150.4, against 230.8 for a hundred completely new evaluations. The curves leave the dashed line, falling below 90% of it, between T=10T = 10 and T=22T = 22, when evaluations start to overlap.

Move T to 1000. The local slopes are 0.16, 0.22, 0.28, and 0.58, still above the large-TT values of 0 for the RBF kernel and 1/61/6, 1/41/4, and 1/21/2 for the Matérn kernels. A thousand evaluations in one dimension is not yet the long run.

Lengthen the lengthscale to 0.3. At T=1000T = 1000 the four values fall to 25.2, 41.5, 63.9, and 398.0 nats. The rates do not depend on the lengthscale; the constants in front of them do, through how many eigenvalues are large.

10.5.4 From information gain to regret #

Table 10.1 carries the rates through the regret bounds of GP-UCB, the rule that evaluates where the posterior mean plus a multiple of the posterior standard deviation is largest (Equation (13.11)), with the setting each result assumes.

Table 10.1 From eigenvalue decay to rates on a compact domain in d dimensions. The regret upper bound is for GP-UCB on draws from the prior, with a confidence parameter that grows like log T; on a continuous domain it needs the RBF kernel or a Matérn kernel with ν > 2. The lower bound is for any algorithm on functions of bounded RKHS norm.
Kernel Eigenvalues λi\lambda_i γT\gamma_T Regret upper bound, Bayesian Lower bound, fixed function
RBF O(e−c i1/d)O(e^{-c\,i^{1/d}}) (Belkin, 2018) O((log⁡T)d+1)O\big((\log T)^{d+1}\big) O(T(log⁡T)d/2+1)O\big(\sqrt{T}(\log T)^{d/2 + 1}\big) Ω(T(log⁡T)d/2)\Omega\big(\sqrt{T(\log T)^{d/2}}\big)
Matérn, ν>1/2\nu > 1/2 O(i−(2ν+d)/d)O(i^{-(2\nu + d)/d}) (Santin and Schaback, 2016) O(Td2ν+d(log⁡T)2ν2ν+d)O\big(T^{\frac{d}{2\nu + d}}(\log T)^{\frac{2\nu}{2\nu + d}}\big) O(Tν+d2ν+d(log⁡T)4ν+d4ν+2d)O\big(T^{\frac{\nu + d}{2\nu + d}}(\log T)^{\frac{4\nu + d}{4\nu + 2d}}\big) Ω(Tν+d2ν+d)\Omega\big(T^{\frac{\nu + d}{2\nu + d}}\big)

The γT\gamma_T and regret columns are those of Vakili et al. (2021a); the regret is Tlog⁡T γT\sqrt{T\log T\,\gamma_T} with γT\gamma_T substituted, and for the RBF kernel it is the T(log⁡T)(d+2)/2\sqrt{T}(\log T)^{(d+2)/2} of Section 13.4.3. The lower bounds are those of Scarlett et al. (2017). On a continuous domain the Bayesian bound needs sample paths smooth enough to discretize, which the RBF kernel and Matérn kernels with ν>2\nu > 2 provide (Section 13.4.4, Section 10.6.3).

For a fixed function in the RKHS, the frequentist analysis of GP-UCB gives regret of order γTT\gamma_T\sqrt{T} up to logarithmic factors (Chowdhury and Gopalan, 2017), whose exponent with the Matérn rate, 12+d/(2ν+d)\tfrac12 + d/(2\nu + d), reaches 1 once d≥2νd \ge 2\nu (inference, as in Section 13.5.2). The factor γT\sqrt{\gamma_T} between that and the lower bound is the subject of Section 21.4 and Section 29.4.

Sources cited in Section 10.5 7
  1. Vakili et al. (2021a) On Information Gain and Regret Bounds in Gaussian Process Bandits
  2. Cover and Thomas (2006) Elements of Information Theory
  3. Santin and Schaback (2016) Approximation of Eigenfunctions in Kernel-Based Spaces
  4. Belkin (2018) Approximation Beats Concentration? An Approximation View on Inference with Smooth Radial Kernels
  5. Srinivas et al. (2010) Gaussian Process Optimization in the Bandit Setting: No Regret and Experimental Design
  6. Scarlett et al. (2017) Lower Bounds on Regret for Noisy Gaussian Process Bandit Optimization
  7. Chowdhury and Gopalan (2017) On Kernelized Multi-armed Bandits

10.6 A Gaussian process made precise #

Definition 7.1 defined a Gaussian process as a collection of random variables, any finite number of them jointly Gaussian, and Section 7.3 read it as an interface that answers queries at finitely many inputs. The regret bounds ask more: they take the maximum of ff over a continuous domain, infinitely many inputs at once. This section says what kind of object a Gaussian process is, and when such questions have answers.

10.6.1 Random variables indexed by inputs #

A random variable is a function of the outcome ω\omega of a random experiment (Section 2.1.3; here ω\omega is an outcome, not a frequency). A stochastic process on a domain X\X is a function f(x,ω)f(\vx, \omega) such that f(x,⋅)f(\vx, \cdot) is a random variable for every fixed x\vx. Fixing the outcome instead gives the sample path x↦f(x,ω)\vx \mapsto f(\vx, \omega). A Gaussian process is a stochastic process whose values at any finite list of inputs are jointly Gaussian (Da Costa et al., 2026, def. 2.1).

The joint distributions at finite lists of inputs, the finite-dimensional distributions, must agree in two ways: listing the inputs in another order permutes the distribution accordingly, and dropping an input gives the marginal of the rest. Section 7.3 checked the second for every mean function and kernel.

Theorem 10.4 Kolmogorov extension theorem

Every family of finite-dimensional distributions consistent in these two ways belongs to some stochastic process on X\X, and it determines that process's probabilities for every event that involves countably many inputs (Kolmogoroff, 1933, ch. III, sec. 4).

This is the theorem the aside of Section 7.3 named. For a Gaussian process it says that a mean function and a positive semidefinite kernel define a random function on any domain (Da Costa et al., 2026, sec. 2). Its proof needs measure theory, and the book does not give it.

10.6.2 What the finite-dimensional distributions do not decide #

Whether the path is continuous, or what its maximum on [0,1][0, 1] is, are questions about uncountably many inputs, and the finite-dimensional distributions do not decide them. Let UU be uniform on [0,1][0, 1], and define f(x)=0f(x) = 0 for every xx and g(x)=1g(x) = 1 if x=Ux = U, 0 otherwise. At any fixed xx, g(x)=0g(x) = 0 unless UU lands exactly on xx, which has probability zero, so ff and gg have the same finite-dimensional distributions. Yet every path of ff is continuous with maximum 0, and every path of gg jumps and has maximum 1.

Processes that agree with probability 1 at each fixed input are called versions of each other (Kanagawa et al., 2018, def. 4.8), and a statement about sample paths says that some version has them. When a Gaussian process on a closed and bounded domain has a continuous version, that version is the one meant, and its maximum f⋆f^\star and maximizer x⋆\vx^\star exist, because a continuous function on such a domain attains its maximum. Entropy search, which chooses evaluations by what they reveal about where x⋆\vx^\star is (Section 12.7), presupposes this.

10.6.3 Sample-path regularity #

Whether a continuous version exists depends on the kernel near zero distance. For a stationary kernel and mean zero, the expected squared difference of two nearby values is

E[(f(x+h)−f(x))2]=2(k(0)−k(h)).\E\big[(f(\vx + \mathbf{h}) - f(\vx))^2\big] = 2\big(k(\mathbf{0}) - k(\mathbf{h})\big).

If this shrinks like ∥h∥2η\lVert\mathbf{h}\rVert^{2\eta} for some η\eta between 0 and 1, the process has a version whose paths are continuous, and Hölder continuous of every order η′<η\eta' < \eta, meaning that ∣f(x)−f(x′)∣≤C∥x−x′∥η′\lvert f(\vx) - f(\vx')\rvert \le C\lVert\vx - \vx'\rVert^{\eta'} near each point (Da Costa et al., 2026, thm. 3.1). For Gaussian processes this is a sharp form of the continuity theorem of Kolmogorov, on which the proof rests.

For the Matérn 1/2 kernel, k(0)−k(h)=1−e−∣h∣/ℓ≤∣h∣/ℓk(0) - k(h) = 1 - e^{-\lvert h\rvert/\ell} \le \lvert h\rvert/\ell, so 2η=12\eta = 1: the paths are continuous, Hölder of every order below 1/2 like Brownian motion (a random walk taken to continuous time), and no more, so not differentiable (Da Costa et al., 2026, remark 3.4). Applying the criterion to the derivative process, whose kernel is −k′′-k'', climbs the ladder: for ν\nu that is not a whole number, a Matérn path is (for a suitable version) ⌊ν⌋\lfloor\nu\rfloor times continuously differentiable and no more, so ν=1/2,3/2,5/2\nu = 1/2, 3/2, 5/2 give 0, 1, and 2 continuous derivatives (Da Costa et al., 2026, cor. 1.2 and prop. 3.1). For such ν\nu these sample-path statements agree with the mean-square ladder of Table 9.1, which also gives derivatives of every whole order below ν\nu and no more. RBF paths have derivatives of every order (Da Costa et al., 2026, remark 3.5).

The agreement is a theorem, not a definition. Mean-square differentiability (Section 7.5.3) concerns second moments of difference quotients and follows from k′′(0)k''(0) alone (Rasmussen and Williams, 2006, sec. 4.1.1); sample-path differentiability concerns each drawn function. The continuous-domain regret bound of Section 13.4.4 needs the second, with some to spare: its proof discretizes the domain and asks that nearby values be close with high probability, which the RBF kernel and Matérn kernels with ν>2\nu > 2 provide (Srinivas et al., 2010).

For a Matérn kernel, then, draws have ⌊ν⌋\lfloor\nu\rfloor continuous derivatives and Sobolev smoothness just below ν\nu, while RKHS functions, the posterior mean among them, have Sobolev smoothness ν+d/2\nu + d/2 (Section 10.2.5). Every regret bound assumes one of these levels.

Sources cited in Section 10.6 5
  1. Da Costa et al. (2026) Sample Path Regularity of Gaussian Processes from the Covariance Kernel
  2. Kolmogoroff (1933) Grundbegriffe der Wahrscheinlichkeitsrechnung
  3. Kanagawa et al. (2018) Gaussian Processes and Kernel Methods: A Review on Connections and Equivalences
  4. Rasmussen and Williams (2006) Gaussian Processes for Machine Learning
  5. Srinivas et al. (2010) Gaussian Process Optimization in the Bandit Setting: No Regret and Experimental Design

10.7 Exercises #

Exercise 10.1

Let kk be the RBF kernel with unit amplitude and lengthscale ℓ\ell on R\R. (a) Show that ∥k(⋅,a)−k(⋅,b)∥k2=2−2k(a,b)\lVert k(\cdot, a) - k(\cdot, b)\rVert_k^2 = 2 - 2k(a, b) and evaluate it at ∣a−b∣=ℓ\lvert a - b\rvert = \ell and 3ℓ3\ell. (b) For a stationary kernel on R\R, f∈Hkf \in \mathcal{H}_k exactly when ∫∣f^(ω)∣2/s(ω) dω\int \lvert\hat f(\omega)\rvert^2/s(\omega)\,\dd\omega is finite, where f^\hat f is the Fourier transform of ff and ss the spectral density (Wendland, 2004, thm. 10.12; Kanagawa et al., 2018, thm. 2.4). For the bump f(x)=e−x2/2w2f(x) = e^{-x^2/2w^2}, with ∣f^(ω)∣2∝e−w2ω2\lvert\hat f(\omega)\rvert^2 \propto e^{-w^2\omega^2}, find the widths ww for which f∈Hkf \in \mathcal{H}_k.

Solution

(a) By Equation (10.3) with coefficients 11 and −1-1, the squared norm is k(a,a)−2k(a,b)+k(b,b)=2−2k(a,b)k(a,a) - 2k(a,b) + k(b,b) = 2 - 2k(a,b). At distance ℓ\ell, k=e−1/2=0.607k = e^{-1/2} = 0.607 and it is 0.7870.787; at 3ℓ3\ell, k=e−9/2=0.011k = e^{-9/2} = 0.011 and it is 1.9781.978, close to 2, the value for two bumps that do not overlap. (b) The RBF spectral density is proportional to e−ℓ2ω2/2e^{-\ell^2\omega^2/2}, so the integrand is proportional to e−(w2−ℓ2/2)ω2e^{-(w^2 - \ell^2/2)\omega^2}, and the integral is finite exactly when w>ℓ/2≈0.71 ℓw > \ell/\sqrt{2} \approx 0.71\,\ell. A narrower bump has infinite norm: the kernel gives its high frequencies too little prior variance to pay for them. The kernel's own bump, of width ℓ\ell, qualifies, as it must.

Exercise 10.2

Let ω∼N(0,1/ℓ2)\omega \sim \N(0, 1/\ell^2) and g(r)=E[cos⁡(ωr)]g(r) = \E[\cos(\omega r)]. (a) Show, by integrating by parts, that E[ωh(ω)]=ℓ−2E[h′(ω)]\E[\omega h(\omega)] = \ell^{-2}\E[h'(\omega)] for a differentiable hh that does not grow too fast. (b) Use it to show g′(r)=−(r/ℓ2)g(r)g'(r) = -(r/\ell^2)g(r), and conclude that g(r)=e−r2/2ℓ2g(r) = e^{-r^2/2\ell^2}.

Solution

(a) The density p(ω)=c e−ℓ2ω2/2p(\omega) = c\,e^{-\ell^2\omega^2/2} has p′(ω)=−ℓ2ω p(ω)p'(\omega) = -\ell^2\omega\,p(\omega), so E[ωh(ω)]=−ℓ−2∫h p′ dω=ℓ−2∫h′ p dω\E[\omega h(\omega)] = -\ell^{-2}\int h\,p'\,\dd\omega = \ell^{-2}\int h'\,p\,\dd\omega by parts, the boundary terms vanishing because pp decays faster than hh grows. (b) g′(r)=−E[ωsin⁡(ωr)]g'(r) = -\E[\omega\sin(\omega r)], and with h(ω)=sin⁡(ωr)h(\omega) = \sin(\omega r), h′=rcos⁡(ωr)h' = r\cos(\omega r), so g′(r)=−(r/ℓ2)g(r)g'(r) = -(r/\ell^2)g(r). With g(0)=1g(0) = 1 the unique solution is e−r2/2ℓ2e^{-r^2/2\ell^2}, the RBF kernel: Gaussian frequencies with standard deviation 1/ℓ1/\ell give lengthscale ℓ\ell, and a short lengthscale needs high frequencies.

Exercise 10.3

One random feature estimates a unit-amplitude kernel at distance rr by cos⁡(ωr)\cos(\omega r), ω∼p\omega \sim p. (a) Show that its variance is 12(1+k(2r))−k(r)2\tfrac12\big(1 + k(2r)\big) - k(r)^2. (b) Evaluate it at r=0r = 0 and as r→∞r \to \infty. (c) For the RBF kernel, show that it never exceeds 12\tfrac12, so the average of MM features has standard deviation at most 1/2M1/\sqrt{2M}.

Solution

(a) cos⁡2θ=12(1+cos⁡2θ)\cos^2\theta = \tfrac12(1 + \cos 2\theta), so E[cos⁡2(ωr)]=12(1+k(2r))\E[\cos^2(\omega r)] = \tfrac12(1 + k(2r)) by Equation (10.10); subtract the squared mean k(r)2k(r)^2. (b) At r=0r = 0 it is 12⋅2−1=0\tfrac12 \cdot 2 - 1 = 0, since every feature gives k(0)=1k(0) = 1 exactly; as r→∞r \to \infty it tends to 12\tfrac12. (c) For the RBF kernel k(2r)=k(r)4k(2r) = k(r)^4, so the variance is 12−k2(1−12k2)≤12\tfrac12 - k^2(1 - \tfrac12k^2) \le \tfrac12 for 0≤k≤10 \le k \le 1. The MM terms are independent, so the average has variance at most 1/(2M)1/(2M), the comparison value of Figure 10.2.

Exercise 10.4

(a) The linear kernel k(x,x′)=x⊤x′k(\vx, \vx') = \vx^\T\vx' on the unit ball of Rd\R^d has at most dd nonzero eigenvalues. Use Theorem 10.3 with m=dm = d to show γT≤d2log⁡(1+T/(σn2d))\gamma_T \le \frac d2\log\big(1 + T/(\sigma_n^2 d)\big). (b) Compare with the KK independent arms of Exercise 13.3, for which γT=K2log⁡(1+T/(Kσn2))\gamma_T = \frac K2\log\big(1 + T/(K\sigma_n^2)\big), and explain the shared form.

Solution

(a) With m=dm = d the tail δd\delta_d is zero, and on the unit ball ∣k∣≤1\lvert k\rvert \le 1, so kˉ=1\bar k = 1 and only the first term of Equation (10.14) remains: γT≤d2log⁡(1+T/(σn2d))\gamma_T \le \frac d2\log(1 + T/(\sigma_n^2 d)), which is O(dlog⁡T)O(d\log T), the linear rate of Section 6.5.2. The bound ψ\psi does not enter, because step 4 of the proof is not needed. (b) Both kernels have a fixed number of directions, dd or KK, holding all the variance. Each can be measured repeatedly but contributes only a logarithm, and the best design spreads the TT evaluations evenly among them. A kernel with infinitely many eigenvalues behaves like one with mm directions, where mm grows with TT as fast as the decay allows.

Sources cited in Section 10.7 2
  1. Wendland (2004) Scattered Data Approximation
  2. Kanagawa et al. (2018) Gaussian Processes and Kernel Methods: A Review on Connections and Equivalences

Further reading #

  • Kanagawa et al. (2018), a long review available as a preprint, sets the Gaussian process and RKHS views side by side, with Mercer's theorem, the Karhunen-Loève expansion, the zero-one law for sample paths, and the Sobolev spaces of Matérn kernels.
  • Rasmussen and Williams (2006), chapter 4, treats stationary kernels, Bochner's theorem, and eigenfunction analysis; chapter 6 introduces the RKHS and its link to regularization.
  • Aronszajn (1950) founded the theory of reproducing kernels; Steinwart and Christmann (2008), chapter 4, and Berlinet and Thomas-Agnan (2004) give modern treatments, the second with probability in view.
  • Wendland (2004) develops positive definite functions (chapter 6) and the native spaces of kernels (chapter 10) from approximation theory.
  • Rahimi and Recht (2007) introduced random Fourier features, with the uniform convergence bound quoted here.
  • Vakili et al. (2021a) derives the information-gain rates from eigenvalue decay; Theorem 10.3 is their Theorem 3.
  • Da Costa et al. (2026) gives necessary and sufficient conditions on the kernel for the sample paths to have a given smoothness, with the Matérn and RBF kernels as examples.

References

  1. Aronszajn, N. (1950). Theory of Reproducing Kernels. Transactions of the American Mathematical Society. Cited in §10.2
  2. Belkin, M. (2018). Approximation Beats Concentration? An Approximation View on Inference with Smooth Radial Kernels. Proceedings of the 31st Conference on Learning Theory. Cited in §10.5
  3. Berlinet, A., and Thomas-Agnan, C. (2004). Reproducing Kernel Hilbert Spaces in Probability and Statistics. Springer. Cited in §10.3
  4. Bochner, S. (1933). Monotone Funktionen, Stieltjessche Integrale und harmonische Analyse. Mathematische Annalen. Cited in §10.4
  5. Chowdhury, S. R., and Gopalan, A. (2017). On Kernelized Multi-armed Bandits. International Conference on Machine Learning. Cited in §10.2 §10.5
  6. Cover, T. M., and Thomas, J. A. (2006). Elements of Information Theory. Wiley. Cited in §10.5
  7. Da Costa, N., Pförtner, M., Da Costa, L., and Hennig, P. (2026). Sample Path Regularity of Gaussian Processes from the Covariance Kernel. Analysis and Applications. Cited in §10.6
  8. Driscoll, M. F. (1973). The Reproducing Kernel Hilbert Space Structure of the Sample Paths of a Gaussian Process. Zeitschrift für Wahrscheinlichkeitstheorie und Verwandte Gebiete. Cited in §10.2
  9. Kanagawa, M., Hennig, P., Sejdinovic, D., and Sriperumbudur, B. K. (2018). Gaussian Processes and Kernel Methods: A Review on Connections and Equivalences. arXiv preprint. preprint Cited in §10.2 §10.3 §10.6 §10.7
  10. Kimeldorf, G. S., and Wahba, G. (1970). A Correspondence Between Bayesian Estimation on Stochastic Processes and Smoothing by Splines. The Annals of Mathematical Statistics. Cited in §10.2
  11. Kimeldorf, G., and Wahba, G. (1971). Some Results on Tchebycheffian Spline Functions. Journal of Mathematical Analysis and Applications. Cited in §10.2
  12. Kolmogoroff, A. (1933). Grundbegriffe der Wahrscheinlichkeitsrechnung. Springer. Cited in §10.6
  13. Lukić, M. N., and Beder, J. H. (2001). Stochastic Processes with Sample Paths in Reproducing Kernel Hilbert Spaces. Transactions of the American Mathematical Society. Cited in §10.2
  14. Mercer, J. (1909). Functions of Positive and Negative Type, and Their Connection with the Theory of Integral Equations. Philosophical Transactions of the Royal Society of London. Series A, Containing Papers of a Mathematical or Physical Character. Cited in §10.3
  15. Rahimi, A., and Recht, B. (2007). Random Features for Large-Scale Kernel Machines. Advances in Neural Information Processing Systems 20 (NeurIPS 2007). Cited in §10.4
  16. Rasmussen, C. E., and Williams, C. K. I. (2006). Gaussian Processes for Machine Learning. MIT Press. Cited in §10.2 §10.3 §10.4 §10.6
  17. Santin, G., and Schaback, R. (2016). Approximation of Eigenfunctions in Kernel-Based Spaces. Advances in Computational Mathematics. Cited in §10.5
  18. Scarlett, J., Bogunovic, I., and Cevher, V. (2017). Lower Bounds on Regret for Noisy Gaussian Process Bandit Optimization. Conference on Learning Theory. Cited in §10.5
  19. Srinivas, N., Krause, A., Kakade, S. M., and Seeger, M. (2010). Gaussian Process Optimization in the Bandit Setting: No Regret and Experimental Design. ICML 2010. Cited in §10.2 §10.5 §10.6
  20. Steinwart, I., and Christmann, A. (2008). Support Vector Machines. Springer. Cited in §10.2 §10.3
  21. Vakili, S., Khezeli, K., and Picheny, V. (2021a). On Information Gain and Regret Bounds in Gaussian Process Bandits. International Conference on Artificial Intelligence and Statistics. Cited in §10.5
  22. Wendland, H. (2004). Scattered Data Approximation. Cambridge University Press. Cited in §10.4 §10.7
  23. Wilson, J. T., Borovitskiy, V., Terenin, A., Mostowski, P., and Deisenroth, M. P. (2020). Efficiently Sampling Functions from Gaussian Process Posteriors. Proceedings of the 37th International Conference on Machine Learning (ICML 2020). Cited in §10.4