Package jgpml

Class GaussianProcess

java.lang.Object
jgpml.GaussianProcess

public class GaussianProcess extends Object
Main class of the package, contains the objects that constitutes a Gaussian Process as well as the algorithm to train the Hyperparameters and to do predictions.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    Jama.Matrix
    partial factor
    Jama.Matrix
    Cholesky decomposition of the input
    Jama.Matrix
    hyperparameters
    Jama.Matrix
    input data points
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new GP object.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    main(String[] args)
    A simple test
    double
    negativeLogLikelihood(Jama.Matrix logtheta, Jama.Matrix x, Jama.Matrix y, Jama.Matrix df0)
    Computes minus the log likelihood and its partial derivatives with respect to the hyperparameters; this mode is used to fit the hyperparameters.
    Jama.Matrix[]
    predict(Jama.Matrix xstar)
    Computes Gaussian predictions, whose mean and variance are returned.
    Jama.Matrix
    predictMean(Jama.Matrix xstar)
    Computes Gaussian predictions, whose mean is returned.
    void
    train(Jama.Matrix X, Jama.Matrix y, Jama.Matrix logtheta0)
    Trains the GP Hyperparameters maximizing the marginal likelihood.
    void
    train(Jama.Matrix X, Jama.Matrix y, Jama.Matrix logtheta0, int iterations)
    Trains the GP Hyperparameters maximizing the marginal likelihood.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • logtheta

      public Jama.Matrix logtheta
      hyperparameters
    • X

      public Jama.Matrix X
      input data points
    • L

      public Jama.Matrix L
      Cholesky decomposition of the input
    • alpha

      public Jama.Matrix alpha
      partial factor
  • Constructor Details

    • GaussianProcess

      public GaussianProcess(CovarianceFunction covFunction)
      Creates a new GP object.
      Parameters:
      covFunction - - the covariance function
  • Method Details

    • main

      public static void main(String[] args)
      A simple test
      Parameters:
      args -
    • train

      public void train(Jama.Matrix X, Jama.Matrix y, Jama.Matrix logtheta0)
      Trains the GP Hyperparameters maximizing the marginal likelihood. By default the minimisation algorithm performs 100 iterations.
      Parameters:
      X - - the input data points
      y - - the target data points
      logtheta0 - - the initial hyperparameters of the covariance function
    • train

      public void train(Jama.Matrix X, Jama.Matrix y, Jama.Matrix logtheta0, int iterations)
      Trains the GP Hyperparameters maximizing the marginal likelihood. By default the algorithm performs 100 iterations.
      Parameters:
      X - - the input data points
      y - - the target data points
      logtheta0 - - the initial hyperparameters of the covariance function
      iterations - - number of iterations performed by the minimization algorithm
    • negativeLogLikelihood

      public double negativeLogLikelihood(Jama.Matrix logtheta, Jama.Matrix x, Jama.Matrix y, Jama.Matrix df0)
      Computes minus the log likelihood and its partial derivatives with respect to the hyperparameters; this mode is used to fit the hyperparameters.
      Parameters:
      logtheta - column Matrix of hyperparameters
      y - output dataset
      df0 - returned partial derivatives with respect to the hyperparameters
      Returns:
      lml minus log marginal likelihood
    • predict

      public Jama.Matrix[] predict(Jama.Matrix xstar)
      Computes Gaussian predictions, whose mean and variance are returned. Note that in cases where the covariance function has noise contributions, the variance returned in S2 is for noisy test targets; if you want the variance of the noise-free latent function, you must subtract the noise variance.
      Parameters:
      xstar - test dataset
      Returns:
      [ystar Sstar] predicted mean and covariance
    • predictMean

      public Jama.Matrix predictMean(Jama.Matrix xstar)
      Computes Gaussian predictions, whose mean is returned. Note that in cases where the covariance function has noise contributions, the variance returned in S2 is for noisy test targets; if you want the variance of the noise-free latent function, you must substract the noise variance.
      Parameters:
      xstar - test dataset
      Returns:
      [ystar Sstar] predicted mean and covariance