# Gaussian process

(Redirected from Gaussian processes)

In probability theory and statistics, a Gaussian process is a stochastic process (a collection of random variables indexed by time or space), such that every finite collection of those random variables has a multivariate normal distribution, i.e. every finite linear combination of them is normally distributed. The distribution of a Gaussian process is the joint distribution of all those (infinitely many) random variables, and as such, it is a distribution over functions with a continuous domain, e.g. time or space.

A machine-learning algorithm that involves a Gaussian process uses lazy learning and a measure of the similarity between points (the kernel function) to predict the value for an unseen point from training data. The prediction is not just an estimate for that point, but also has uncertainty information—it is a one-dimensional Gaussian distribution (which is the marginal distribution at that point).[1]

For some kernel functions, matrix algebra can be used to calculate the predictions using the technique of kriging. When a parameterised kernel is used, optimisation software is typically used to fit a Gaussian process model.

The concept of Gaussian processes is named after Carl Friedrich Gauss because it is based on the notion of the Gaussian distribution (normal distribution). Gaussian processes can be seen as an infinite-dimensional generalization of multivariate normal distributions.

Gaussian processes are useful in statistical modelling, benefiting from properties inherited from the normal distribution. For example, if a random process is modelled as a Gaussian process, the distributions of various derived quantities can be obtained explicitly. Such quantities include the average value of the process over a range of times and the error in estimating the average using sample values at a small set of times.

## Definition

A time continuous stochastic process ${\displaystyle \left\{X_{t};t\in T\right\}}$ is Gaussian if and only if for every finite set of indices ${\displaystyle t_{1},\ldots ,t_{k}}$ in the index set ${\displaystyle T}$

${\displaystyle \mathbf {X} _{t_{1},\ldots ,t_{k}}=(X_{t_{1}},\ldots ,X_{t_{k}})}$

is a multivariate Gaussian random variable.[2] That is the same as saying every linear combination of ${\displaystyle (X_{t_{1}},\ldots ,X_{t_{k}})}$ has a univariate normal (or Gaussian) distribution.

Using characteristic functions of random variables, the Gaussian property can be formulated as follows: ${\displaystyle \left\{X_{t};t\in T\right\}}$ is Gaussian if and only if, for every finite set of indices ${\displaystyle t_{1},\ldots ,t_{k}}$, there are real-valued ${\displaystyle \sigma _{\ell j}}$, ${\displaystyle \mu _{\ell }}$ with ${\displaystyle \sigma _{jj}>0}$ such that the following equality holds for all ${\displaystyle s_{1},s_{2},\ldots ,s_{k}\in \mathbb {R} }$

${\displaystyle \operatorname {E} \left(\exp \left(i\ \sum _{\ell =1}^{k}s_{\ell }\ \mathbf {X} _{t_{\ell }}\right)\right)=\exp \left(-{\frac {1}{2}}\,\sum _{\ell ,j}\sigma _{\ell j}s_{\ell }s_{j}+i\sum _{\ell }\mu _{\ell }s_{\ell }\right)}$.

where ${\displaystyle i}$ denotes the imaginary unit such that ${\displaystyle i^{2}=-1}$.

The numbers ${\displaystyle \sigma _{\ell j}}$ and ${\displaystyle \mu _{\ell }}$ can be shown to be the covariances and means of the variables in the process.[3]

## Variance

The variance of a Gaussian process is finite at any time ${\displaystyle t}$, formally[4]:p. 515

${\displaystyle \operatorname {var} [X(t)]=\operatorname {E} [|X(t)-\operatorname {E} [X(t)]|^{2}]<\infty \quad {\text{for all }}t\in T}$.

## Stationarity

For general stochastic processes strict-sense stationarity implies wide-sense stationarity but not every wide-sense stationary stochastic process is strict-sense stationary. However, for a Gaussian stochastic process the two concepts are equivalent.[4]:p. 518

A Gaussian stochastic process is strict-sense stationary if, and only if, it is wide-sense stationary.

## Covariance functions

A key fact of Gaussian processes is that they can be completely defined by their second-order statistics.[5] Thus, if a Gaussian process is assumed to have mean zero, defining the covariance function completely defines the process' behaviour. Importantly the non-negative definiteness of this function enables its spectral decomposition using the Karhunen–Loève expansion. Basic aspects that can be defined through the covariance function are the process' stationarity, isotropy, smoothness and periodicity.[6][7]

Stationarity refers to the process' behaviour regarding the separation of any two points ${\displaystyle x}$ and ${\displaystyle x'}$. If the process is stationary, it depends on their separation, ${\displaystyle x-x'}$, while if non-stationary it depends on the actual position of the points ${\displaystyle x}$ and ${\displaystyle x'}$. For example, the special case of an Ornstein–Uhlenbeck process, a Brownian motion process, is stationary.

If the process depends only on ${\displaystyle |x-x'|}$, the Euclidean distance (not the direction) between ${\displaystyle x}$ and ${\displaystyle x'}$, then the process is considered isotropic. A process that is concurrently stationary and isotropic is considered to be homogeneous;[8] in practice these properties reflect the differences (or rather the lack of them) in the behaviour of the process given the location of the observer.

Ultimately Gaussian processes translate as taking priors on functions and the smoothness of these priors can be induced by the covariance function.[6] If we expect that for "near-by" input points ${\displaystyle x}$ and ${\displaystyle x'}$ their corresponding output points ${\displaystyle y}$ and ${\displaystyle y'}$ to be "near-by" also, then the assumption of continuity is present. If we wish to allow for significant displacement then we might choose a rougher covariance function. Extreme examples of the behaviour is the Ornstein–Uhlenbeck covariance function and the squared exponential where the former is never differentiable and the latter infinitely differentiable.

Periodicity refers to inducing periodic patterns within the behaviour of the process. Formally, this is achieved by mapping the input ${\displaystyle x}$ to a two dimensional vector ${\displaystyle u(x)=\left(\cos(x),\sin(x)\right)}$.

### Usual covariance functions

The effect of choosing different kernels on the prior function distribution of the Gaussian process. Left is a squared exponential kernel. Middle is Brownian. Right is quadratic.

There are a number of common covariance functions:[7]

• Constant : ${\displaystyle K_{\operatorname {C} }(x,x')=C}$
• Linear: ${\displaystyle K_{\operatorname {L} }(x,x')=x^{T}x'}$
• white Gaussian noise: ${\displaystyle K_{\operatorname {GN} }(x,x')=\sigma ^{2}\delta _{x,x'}}$
• Squared exponential: ${\displaystyle K_{\operatorname {SE} }(x,x')=\exp {\Big (}-{\frac {|d|^{2}}{2\ell ^{2}}}{\Big )}}$
• Ornstein–Uhlenbeck: ${\displaystyle K_{\operatorname {OU} }(x,x')=\exp \left(-{\frac {|d|}{\ell }}\right)}$
• Matérn: ${\displaystyle K_{\operatorname {Matern} }(x,x')={\frac {2^{1-\nu }}{\Gamma (\nu )}}{\Big (}{\frac {{\sqrt {2\nu }}|d|}{\ell }}{\Big )}^{\nu }K_{\nu }{\Big (}{\frac {{\sqrt {2\nu }}|d|}{\ell }}{\Big )}}$
• Periodic: ${\displaystyle K_{\operatorname {P} }(x,x')=\exp \left(-{\frac {2\sin ^{2}\left({\frac {d}{2}}\right)}{\ell ^{2}}}\right)}$
• Rational quadratic: ${\displaystyle K_{\operatorname {RQ} }(x,x')=(1+|d|^{2})^{-\alpha },\quad \alpha \geq 0}$

Here ${\displaystyle d=x-x'}$. The parameter is the characteristic length-scale of the process (practically, "how close" two points ${\displaystyle x}$ and ${\displaystyle x'}$ have to be to influence each other significantly), δ is the Kronecker delta and σ the standard deviation of the noise fluctuations. Moreover, ${\displaystyle K_{\nu }}$ is the modified Bessel function of order ${\displaystyle \nu }$ and ${\displaystyle \Gamma (\nu )}$ is the gamma function evaluated at ${\displaystyle \nu }$. Importantly, a complicated covariance function can be defined as a linear combination of other simpler covariance functions in order to incorporate different insights about the data-set at hand.

Clearly, the inferential results are dependent on the values of the hyperparameters θ (e.g. and σ) defining the model's behaviour. A popular choice for θ is to provide maximum a posteriori (MAP) estimates of it with some chosen prior. If the prior is very near uniform, this is the same as maximizing the marginal likelihood of the process; the marginalization being done over the observed process values ${\displaystyle y}$.[7] This approach is also known as maximum likelihood II, evidence maximization, or empirical Bayes.[9]

## Continuity

For a Gaussian process, continuity in probability is equivalent to mean-square continuity, [10]:145 and continuity with probability one is equivalent to sample continuity.[11]:91 "Gaussian processes are discontinuous at fixed points." The latter implies, but is not implied by, continuity in probability. Continuity in probability holds if and only if the mean and autocovariance are continuous functions. In contrast, sample continuity was challenging even for stationary Gaussian processes (as probably noted first by Andrey Kolmogorov), and more challenging for more general processes.[12]:Sect. 2.8 [13]:69,81 [14]:80 [15] As usual, by a sample continuous process one means a process that admits a sample continuous modification. [16]:292 [17]:424

### Stationary case

For a stationary Gaussian process ${\displaystyle X=(X_{t})_{t\in \mathbb {R} },}$ some conditions on its spectrum are sufficient for sample continuity, but fail to be necessary. A necessary and sufficient condition, sometimes called Dudley-Fernique theorem, involves the function ${\displaystyle \sigma }$ defined by

${\displaystyle \sigma (h)={\sqrt {\mathbb {E} {\big (}X(t+h)-X(t){\big )}^{2}}}}$

(the right-hand side does not depend on ${\displaystyle t}$ due to stationarity). Continuity of ${\displaystyle X}$ in probability is equivalent to continuity of ${\displaystyle \sigma }$ at ${\displaystyle 0.}$ When convergence of ${\displaystyle \sigma (h)}$ to ${\displaystyle 0}$ (as ${\displaystyle h\to 0}$) is too slow, sample continuity of ${\displaystyle X}$ may fail. Convergence of the following integrals matters:

${\displaystyle I(\sigma )=\int _{0}^{1}{\frac {\sigma (h)}{h{\sqrt {\log(1/h)}}}}\,dh=\int _{0}^{\infty }2\sigma (\mathbb {e} ^{-x^{2}})\,dx,}$

these two integrals being equal according to integration by substitution ${\displaystyle h=\mathbb {e} ^{-x^{2}},}$ ${\displaystyle \textstyle x={\sqrt {\log(1/h)}}.}$ The first integrand need not be bounded as ${\displaystyle h\to 0+,}$ thus the integral may converge (${\displaystyle I(\sigma )<\infty }$) or diverge (${\displaystyle I(\sigma )=\infty }$). Taking for example ${\displaystyle \sigma (\mathbb {e} ^{-x^{2}})={\tfrac {1}{x^{a}}}}$ for large ${\displaystyle x,}$ that is, ${\displaystyle \sigma (h)=(\log(1/h))^{-a/2}}$ for small ${\displaystyle h,}$ one obtains ${\displaystyle I(\sigma )<\infty }$ when ${\displaystyle a>1,}$ and ${\displaystyle I(\sigma )=\infty }$ when ${\displaystyle 0 In these two cases the function ${\displaystyle \sigma }$ is increasing on ${\displaystyle [0,\infty ),}$ but generally it is not. Moreover, the condition

${\displaystyle (*)}$   there exists ${\displaystyle \varepsilon >0}$ such that ${\displaystyle \sigma }$ is monotone on ${\displaystyle [0,\varepsilon ]}$

does not follow from continuity of ${\displaystyle \sigma }$ and the evident relations ${\displaystyle \sigma (h)\geq 0}$ (for all ${\displaystyle h}$) and ${\displaystyle \sigma (0)=0.}$

Theorem 1.   Let ${\displaystyle \sigma }$ be continuous and satisfy ${\displaystyle (*).}$ Then the condition ${\displaystyle I(\sigma )<\infty }$ is necessary and sufficient for sample continuity of ${\displaystyle X.}$

Some history.[17]:424 Sufficiency was announced by Xavier Fernique in 1964, but the first proof was published by Richard M. Dudley in 1967.[16]:Theorem 7.1 Necessity was proved by Michael B. Marcus and Lawrence Shepp in 1970.[18]:380

There exist sample continuous processes ${\displaystyle X}$ such that ${\displaystyle I(\sigma )=\infty ;}$ they violate condition ${\displaystyle (*).}$ An example found by Marcus and Shepp [18]:387 is a random lacunary Fourier series

${\displaystyle X_{t}=\sum _{n=1}^{\infty }c_{n}(\xi _{n}\cos \lambda _{n}t+\eta _{n}\sin \lambda _{n}t),}$

where ${\displaystyle \xi _{1},\eta _{1},\xi _{2},\eta _{2},\dots }$ are independent random variables with standard normal distribution; frequencies ${\displaystyle 0<\lambda _{1}<\lambda _{2}<\dots }$ are a fast growing sequence; and coefficients ${\displaystyle c_{n}>0}$ satisfy ${\displaystyle \textstyle \sum _{n}c_{n}<\infty .}$ The latter relation implies ${\displaystyle \textstyle \mathbb {E} \sum _{n}c_{n}(|\xi _{n}|+|\eta _{n}|)=\sum _{n}c_{n}\mathbb {E} (|\xi _{n}|+|\eta _{n}|)={\text{const}}\cdot \sum _{n}c_{n}<\infty ,}$ whence ${\displaystyle \sum _{n}c_{n}(|\xi _{n}|+|\eta _{n}|)<\infty }$ almost surely, which ensures uniform convergence of the Fourier series almost surely, and sample continuity of ${\displaystyle X.}$

Autocorrelation of a random lacunary Fourier series

Its autocovariation function

${\displaystyle \mathbb {E} X_{t}X_{t+h}=\sum _{n=1}^{\infty }c_{n}^{2}\cos \lambda _{n}h}$

is nowhere monotone (see the picture), as well as the corresponding function ${\displaystyle \sigma ,}$

${\displaystyle \sigma (h)={\sqrt {2\mathbb {E} X_{t}X_{t}-2\mathbb {E} X_{t}X_{t+h}}}=2{\sqrt {\sum _{n=1}^{\infty }c_{n}^{2}\sin ^{2}{\frac {\lambda _{n}h}{2}}}}.}$

## Brownian motion as the integral of Gaussian processes

A Wiener process (aka Brownian motion) is the integral of a white noise generalized Gaussian process. It is not stationary, but it has stationary increments.

The Ornstein–Uhlenbeck process is a stationary Gaussian process.

The Brownian bridge is (like the Ornstein–Uhlenbeck process) an example of a Gaussian process whose increments are not independent.

The fractional Brownian motion is a Gaussian process whose covariance function is a generalisation of that of the Wiener process.

## Applications

An example of Gaussian Process Regression (prediction) compared with other regression models.[19]

A Gaussian process can be used as a prior probability distribution over functions in Bayesian inference.[7][20] Given any set of N points in the desired domain of your functions, take a multivariate Gaussian whose covariance matrix parameter is the Gram matrix of your N points with some desired kernel, and sample from that Gaussian.

Inference of continuous values with a Gaussian process prior is known as Gaussian process regression, or kriging; extending Gaussian process regression to multiple target variables is known as cokriging.[21] Gaussian processes are thus useful as a powerful non-linear multivariate interpolation tool. Gaussian process regression can be further extended to address learning tasks in both supervised (e.g. probabilistic classification[7]) and unsupervised (e.g. manifold learning[5]) learning frameworks.

Gaussian processes can also be used in the context of mixture of experts models, for example.[22][23] The underlying rationale of such a learning framework consists in the assumption that a given mapping cannot be well captured by a single Gaussian process model. Instead, the observation space is divided into subsets, each of which is characterized by a different mapping function; each of these is learned via a different Gaussian process component in the postulated mixture.

### Gaussian process prediction, or kriging

Gaussian Process Regression (prediction) with a squared exponential kernel. Left plot are draws from the prior function distribution. Middle are draws from the posterior. Right is mean prediction with one standard deviation shaded.

When concerned with a general Gaussian process regression problem (kriging), it is assumed that for a Gaussian process f observed at coordinates x, the vector of values ${\displaystyle f(x)}$ is just one sample from a multivariate Gaussian distribution of dimension equal to number of observed coordinates ${\displaystyle n}$. Therefore, under the assumption of a zero-mean distribution, ${\displaystyle f(x)\sim N(0,K(\theta ,x,x'))}$, where ${\displaystyle K(\theta ,x,x')}$ is the covariance matrix between all possible pairs ${\displaystyle (x,x')}$ for a given set of hyperparameters θ.[7] As such the log marginal likelihood is:

${\displaystyle \log p(f(x)\mid \theta ,x)=-{\frac {1}{2}}f(x)^{T}K(\theta ,x,x')^{-1}f(x')-{\frac {1}{2}}\log \det(K(\theta ,x,x'))-{\frac {n}{2}}\log 2\pi }$

and maximizing this marginal likelihood towards θ provides the complete specification of the Gaussian process f. One can briefly note at this point that the first term corresponds to a penalty term for a model's failure to fit observed values and the second term to a penalty term that increases proportionally to a model's complexity. Having specified θ making predictions about unobserved values ${\displaystyle f(x^{*})}$ at coordinates x* is then only a matter of drawing samples from the predictive distribution ${\displaystyle p(y^{*}\mid x^{*},f(x),x)=N(y^{*}\mid A,B)}$ where the posterior mean estimate A is defined as

${\displaystyle A=K(\theta ,x^{*},x)K(\theta ,x,x')^{-1}f(x)}$

and the posterior variance estimate B is defined as:

${\displaystyle B=K(\theta ,x^{*},x^{*})-K(\theta ,x^{*},x)K(\theta ,x,x')^{-1}K(\theta ,x^{*},x)^{T}}$

where ${\displaystyle K(\theta ,x^{*},x)}$ is the covariance between the new coordinate of estimation x* and all other observed coordinates x for a given hyperparameter vector θ, ${\displaystyle K(\theta ,x,x')}$ and ${\displaystyle f(x)}$ are defined as before and ${\displaystyle K(\theta ,x^{*},x^{*})}$ is the variance at point x* as dictated by θ. It is important to note that practically the posterior mean estimate ${\displaystyle f(x^{*})}$ (the "point estimate") is just a linear combination of the observations ${\displaystyle f(x)}$; in a similar manner the variance of ${\displaystyle f(x^{*})}$ is actually independent of the observations ${\displaystyle f(x)}$. A known bottleneck in Gaussian process prediction is that the computational complexity of prediction is cubic in the number of points |x| and as such can become unfeasible for larger data sets.[6] Works on sparse Gaussian processes, that usually are based on the idea of building a representative set for the given process f, try to circumvent this issue.[24][25]

## References

1. ^ "Platypus Innovation: A Simple Intro to Gaussian Processes (a great data modelling tool)". 2016-05-10.
2. ^ MacKay, David, J.C. (2003). Information Theory, Inference, and Learning Algorithms (PDF). Cambridge University Press. p. 540. ISBN 9780521642989. The probability distribution of a function ${\displaystyle y(\mathbf {x} )}$ is a Gaussian processes if for any finite selection of points ${\displaystyle \mathbf {x} ^{(1)},\mathbf {x} ^{(2)},\ldots ,\mathbf {x} ^{(N)}}$, the density ${\displaystyle P(y(\mathbf {x} ^{(1)}),y(\mathbf {x} ^{(2)}),\ldots ,y(\mathbf {x} ^{(N)}))}$is a Gaussian
3. ^ Dudley, R.M. (1989). Real Analysis and Probability. Wadsworth and Brooks/Cole.
4. ^ a b Amos Lapidoth (8 February 2017). A Foundation in Digital Communication. Cambridge University Press. ISBN 978-1-107-17732-1.
5. ^ a b Bishop, C.M. (2006). Pattern Recognition and Machine Learning. Springer. ISBN 978-0-387-31073-2.
6. ^ a b c Barber, David (2012). Bayesian Reasoning and Machine Learning. Cambridge University Press. ISBN 978-0-521-51814-7.
7. Rasmussen, C.E.; Williams, C.K.I (2006). Gaussian Processes for Machine Learning. MIT Press. ISBN 978-0-262-18253-9.
8. ^ Grimmett, Geoffrey; David Stirzaker (2001). Probability and Random Processes. Oxford University Press. ISBN 978-0198572220.
9. ^ Seeger, Matthias (2004). "Gaussian Processes for Machine Learning". International Journal of Neural Systems. 14 (2): 69–104. CiteSeerX 10.1.1.71.1079. doi:10.1142/s0129065704001899. PMID 15112367.
10. ^ Dudley, R. M. (1975). "The Gaussian process and how to approach it" (PDF). Proceedings of the International Congress of Mathematicians. 2. pp. 143–146.
11. ^ Dudley, R. M. (1973). "Sample functions of the Gaussian process". Annals of Probability. 1 (1): 66–103. doi:10.1007/978-1-4419-5821-1_13. ISBN 978-1-4419-5820-4.
12. ^ Talagrand, Michel (2014). Upper and lower bounds for stochastic processes: modern methods and classical problems. Ergebnisse der Mathematik und ihrer Grenzgebiete. 3. Folge / A Series of Modern Surveys in Mathematics. Springer, Heidelberg. ISBN 978-3-642-54074-5.
13. ^ Ledoux, Michel (1994). "Isoperimetry and Gaussian analysis". Lecture Notes in Mathematics. 1648. Springer, Berlin. pp. 165–294. doi:10.1007/BFb0095676. ISBN 978-3-540-62055-6.
14. ^ Adler, Robert J. (1990). "An introduction to continuity, extrema, and related topics for general Gaussian processes". Lecture Notes-Monograph Series. Institute of Mathematical Statistics. 12: i–155. JSTOR 4355563.
15. ^ Berman, Simeon M. (1992). "Review of: Adler 1990 'An introduction to continuity...'". Mathematical Reviews. MR 1088478.
16. ^ a b Dudley, R. M. (1967). "The sizes of compact subsets of Hilbert space and continuity of Gaussian processes". Journal of Functional Analysis. 1 (3): 290–330. doi:10.1016/0022-1236(67)90017-1.
17. ^ a b Marcus, M.B.; Shepp, Lawrence A. (1972). "Sample behavior of Gaussian processes". Proceedings of the sixth Berkeley symposium on mathematical statistics and probability, vol. II: probability theory. Univ. California, Berkeley. pp. 423–441.
18. ^ a b Marcus, Michael B.; Shepp, Lawrence A. (1970). "Continuity of Gaussian processes". Transactions of the American Mathematical Society. 151 (2): 377–391. doi:10.2307/1995502. JSTOR 1995502.
19. ^ The documentation for scikit-learn also has similar examples.
20. ^ Liu, W.; Principe, J.C.; Haykin, S. (2010). Kernel Adaptive Filtering: A Comprehensive Introduction. John Wiley. ISBN 978-0-470-44753-6.
21. ^ Stein, M.L. (1999). Interpolation of Spatial Data: Some Theory for Kriging. Springer.
22. ^ Platanios, Emmanouil A.; Chatzis, Sotirios P. (2014). "Gaussian Process-Mixture Conditional Heteroscedasticity". IEEE Transactions on Pattern Analysis and Machine Intelligence. 36 (5): 888–900. doi:10.1109/TPAMI.2013.183. PMID 26353224.
23. ^ Chatzis, Sotirios P. (2013). "A latent variable Gaussian process model with Pitman–Yor process priors for multiclass classification". Neurocomputing. 120: 482–489. doi:10.1016/j.neucom.2013.04.029.
24. ^ Smola, A.J.; Schoellkopf, B. (2000). "Sparse greedy matrix approximation for machine learning". Proceedings of the Seventeenth International Conference on Machine Learning: 911–918.
25. ^ Csato, L.; Opper, M. (2002). "Sparse on-line Gaussian processes". Neural Computation. 14 (3): 641–668. CiteSeerX 10.1.1.335.9713. doi:10.1162/089976602317250933. PMID 11860686.