Mathias Engel
15 March 2018
We got data points where is a vector and is a scalar.
We want a model .
The probability distribution of a function is a Gaussian process if for any finite selection of points , the marginal density is a Gaussian.
import numpy, scipy.stats
def gp_prior(dimension=2, size=100):
means = numpy.zeros(dimension)
cov = numpy.zeros((dimension, dimension))
for x1 in range(dimension):
for x2 in range(dimension):
cov[x1, x2] = 10**2*numpy.exp(-.5 * (x2-x1)**2 / 2**2)
return numpy.random.multivariate_normal(means, cov, size=size)
def sample_rows(X, n_examples=3, replace=False):
return X[numpy.random.choice(X.shape[0], n_examples, replace=replace)]
, given basis functions .
is defined by , given basis weights .
Assume is the prior of .
is a linear in and therefore also Gaussian distributed with zero mean, .
Given measurment noise , has a prior distribution , with
The entries of C is in general
Let . Solving this integral gives the kernel function for the Gaussian Process.