Gaussian processes

This module provides a collection of tools that are useful when performing Gaussian process regression.

Numpy

abs_diff(x, xp) Gets matrix of differences between \(D\)-dimensional vectors x and xp i.e.
exponential_squared(x, xp, sigmaf, l[, pspec]) Create exponential squared covariance function between \(D\) dimensional vectors \(x\) and \(x_p\) i.e.
africanus.gps.abs_diff(x, xp)[source]

Gets matrix of differences between \(D\)-dimensional vectors x and xp i.e.

\[X_{ij} = |x_i - x_j|\]
Parameters:

x : numpy.ndarray

Array of inputs of shape (N, D).

xp : numpy.ndarray

Array of inputs of shape (Np, D).

Returns:

XX : numpy.ndarray

Array of differences of shape (N, Np).

africanus.gps.exponential_squared(x, xp, sigmaf, l, pspec=False)[source]

Create exponential squared covariance function between \(D\) dimensional vectors \(x\) and \(x_p\) i.e.

\[k(x, x_p) = \sigma_f^2 \exp\left(-\frac{(x-x_p)^2}{2l^2}\right)\]
Parameters:

x : numpy.ndarray

Array of shape (N, D).

xp : numpy.ndarray

Array of shape (Np, D).

sigmaf : float

The signal variance hyper-parameter

l : float

The length scale hyper-parameter

Returns:

K : numpy.ndarray

Array of shape (N, Np)