Lably
Skip to content

Bayesian quadrature

Method in statistics

  • 5 min read
  • 4 chapters

Related on Lably

Through Integral

Bayesian quadrature

Numerical integration

Let f:X→R be a function defined on a domain X (where typically X⊆Rd). In numerical integration, function evaluations f(x1),…,f(xn) at distinct locations x1,…,xn in X are used to estimate the integral of f against a measure ν: i.e. ν[f]:=∫Xf(x)ν(dx). Given weights w1,…,wn∈R, a quadrature rule is an estimator of ν[f] of the form ν^[f]:=∑i=1nwif(xi).

Bayesian quadrature consists of specifying a prior distribution over f, conditioning this prior on f(x1),…,f(xn) to obtain a posterior distribution f, then computing the implied posterior distribution on ν[f]. The name "quadrature" comes from the fact that the posterior mean on ν[f] sometimes takes the form of a quadrature rule whose weights are determined by the choice of prior.

Bayesian quadrature with Gaussian processes

The most common choice of prior distribution for f is a Gaussian process as this permits conjugate inference to obtain a closed-form posterior distribution on ν[f]. Suppose we have a Gaussian process with prior mean function m:X→R and covariance function (or kernel function) k:X×X→R. Then, the posterior distribution on f is a Gaussian process with mean mn:X→R and kernel kn:X×X→R given by: mn(x)=m(x)+k(x,X)k(X,X)−1f(X)andkn(x,y)=k(x,y)−k(x,X)k(X,X)−1k(X,y). where (k(X,X))ij=k(xi,xj), (f(X))i=f(xi), (k(⋅,X))i=k(⋅,xi) and (k(X,⋅))i=k(xi,⋅).

Furthermore, the posterior distribution on ν[f] is a univariate Gaussian distribution with mean E[ν[f]] and variance V[ν[f]] given by E[ν[f]]=ν[m]+ν[k(⋅,X)]k(X,X)−1f(X)andV[ν[f]]=νν[k]−ν[k(⋅,X)]k(X,X)−1ν[k(X,⋅)]. The function ν[k(⋅,x)]=∫Xk(y,x)ν(dy) is the kernel mean embedding of k and νν[k]=∫Xk(x,y)ν(dx)ν(dy) denotes the integral of k with respect to both inputs. In particular, note that the posterior mean is a quadrature rule with weights wi=(ν[k(⋅,X)]k(X,X)−1)i. and the posterior variance provides a quantification of the user's uncertainty over the value of ν[f].

In more challenging integration problems, where the prior distribution cannot be relied upon as a meaningful representation of epistemic uncertainty, it is necessary to use the data f(x1),…,f(xn) to set the kernel hyperparameters using, for example, maximum likelihood estimation. The estimation of kernel hyperparameters introduces adaptivity into Bayesian quadrature.

Example

Consider estimation of the integral ν[f]=∫01f(x)dx≈1.79 of the function f(x)=(1+x2)sin⁡(5πx)+85 using a Bayesian quadrature rule based on a zero-mean Gaussian process prior with the Matérn covariance function of smoothness 3/2 and correlation length ρ=1/5. This covariance function is k(x,y)=(1+3|x−y|/ρ)exp⁡(−3|x−y|/ρ). It is straightforward (though tedious) to compute that ν[k(⋅,x)]=∫01k(y,x)dy=4ρ3−13exp⁡(3(x−1)ρ)(3+23ρ−3x)−13exp⁡(−3xρ)(3x+23ρ) νν[k]=∫01∫01k(x,y)dxdy=2ρ3[23−3ρ+exp⁡(−3ρ)(3+3ρ)]. Convergence of the Bayesian quadrature point estimate E[ν[f]] and concentration of the posterior mass, as quantified by V[ν[f]], around the true integral ν[f] as f is evaluated at more and more points is displayed in the accompanying animation.

Advantages and disadvantages

Since Bayesian quadrature is an example of probabilistic numerics, it inherits certain advantages compared with traditional numerical integration methods:

  • It allows uncertainty to be quantified and propagated through all subsequent computations to explicitly model the impact of numerical error.
  • It provides a principled way to incorporate prior knowledge by using a judicious choice of prior distributions for f, which may be more sophisticated compared to the standard Gaussian process just described.
  • It permits more efficient use of information, e.g. jointly inferring multiple related quantities of interest or using active learning to reduce the required number of points.

Despite these merits, Bayesian quadrature methods possess the following limitations:

  • Although the Bayesian paradigm allows a principled treatment of the quantification of uncertainty, posterior inference over ν[f] is not always tractable, thus requiring a second-level estimation. E.g. for Bayesian quadrature with Gaussian processes, the kernel mean embedding ν[k(⋅,x)] has no closed-form expression for a general kernel k and measure ν.
  • The computational cost of Bayesian quadrature methods based on Gaussian processes is in general O(n3) due to the cost of inverting n×n matrices, which may defy their applications to large-scale problems.

Sign in to keep reading

3 more chapters are free with a Lably account.

More in Statistics