This page describes examples of how to use the Gaussian Process Software (GP). RELEASEINFORMATION
This example shows how points which look like they come from a function to be sampled from a Gaussian distribution. The sample is 25 dimensional and is from a Gaussian with a particular covariance.
> demGpSample()
Gaussian processes are about conditioning a Gaussian distribution on the training data to make the test predictions. To illustrate this process, we can look at the joint distribution over two variables.
> demGpCov2D(c(1,2))
Gives the joint distribution for f1 and f2. The plots show the joint distributions as well as the conditional for f2 given f1.
> gpSample('rbf', 10, c(1,1), c(-3,3))
will give 10 samples from an RBF covariance function with a parameter vector given by [1 1] (inverse width 1, variance 1) across the range -3 to 3 on the x-axis. The random seed will be set to 1e5.
> gpSample('rbf', 10, c(16,1), c(-3,3))
is similar, but the inverse width is now set to 16 (length scale 0.25).
Gaussian processes are non-parametric models. They are specified by their covariance function and a mean function. When combined with data observations a posterior Gaussian process is induced. The demos below show samples from that posterior.
> gpPosteriorSample('rbf', 5, c(1,1), c(-3,3))
> gpPosteriorSample('rbf', 5, c(16,1), c(-3,3))
This simple demonstration plots, consecutively, an increasing number of data points, followed by an interpolated fit through the data points using a Gaussian process. This is a noiseless system, and the data is sampled from a GP with a known covariance function. The curve is then recovered with minimal uncertainty after only nine data points are included. The code is run with
> demInterpolation()
The regression demo very much follows the format of the interpolation demo. Here the difference is that the data is sampled with noise. Fitting a model with noise means that the regression will not necessarily pass right through each data point. The code is run with
> demRegression()
One of the advantages of Gaussian processes over pure kernel interpretations of regression is the ability to select the hyper parameters of the kernel automatically. The demo
> demOptimiseGp()
shows a series of plots of a Gaussian process with different length scales fitted to six data points. For each plot there is a corresponding plot of the log likelihood. The log likelihood peaks for a length scale close to 1. This was the length scale used to generate the data.