Package jgpml
Class GaussianProcess
java.lang.Object
jgpml.GaussianProcess
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
A simple testdouble
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.
-
Field Details
-
logtheta
public Jama.Matrix logthetahyperparameters -
X
public Jama.Matrix Xinput data points -
L
public Jama.Matrix LCholesky decomposition of the input -
alpha
public Jama.Matrix alphapartial factor
-
-
Constructor Details
-
GaussianProcess
Creates a new GP object.- Parameters:
covFunction
- - the covariance function
-
-
Method Details
-
main
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 pointsy
- - the target data pointslogtheta0
- - 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 pointsy
- - the target data pointslogtheta0
- - the initial hyperparameters of the covariance functioniterations
- - 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
- columnMatrix
of hyperparametersy
- output datasetdf0
- 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
-