Package jgpml.covariancefunctions
Class CovSum
java.lang.Object
jgpml.covariancefunctions.CovSum
- All Implemented Interfaces:
CovarianceFunction
Composes a covariance function as the sum of other covariance functions. This function doesn't actually compute very
much on its own, it merely calls other covariance functions with the right parameters.
-
Constructor Summary
ConstructorsConstructorDescriptionCovSum
(int inputDimensions, CovarianceFunction... f) Create a newCovarianceFunction
as sum of theCovarianceFunction
s passed as input. -
Method Summary
Modifier and TypeMethodDescriptionJama.Matrix
compute
(Jama.Matrix loghyper, Jama.Matrix X) Compute covariance matrix of a dataset XJama.Matrix[]
compute
(Jama.Matrix loghyper, Jama.Matrix X, Jama.Matrix Xstar) Compute compute test set covariancesJama.Matrix
computeDerivatives
(Jama.Matrix loghyper, Jama.Matrix X, int index) Coompute the derivatives of thisCovarianceFunction
with respect to the hyperparameter with indexidx
int
Returns the number of hyperparameters of thisCovarianceFunction
-
Constructor Details
-
CovSum
Create a newCovarianceFunction
as sum of theCovarianceFunction
s passed as input.- Parameters:
inputDimensions
- input dimension of the datasetf
- array ofCovarianceFunction
- See Also:
-
-
Method Details
-
numParameters
public int numParameters()Returns the number of hyperparameters of thisCovarianceFunction
- Specified by:
numParameters
in interfaceCovarianceFunction
- Returns:
- number of hyperparameters
-
compute
public Jama.Matrix compute(Jama.Matrix loghyper, Jama.Matrix X) Compute covariance matrix of a dataset X- Specified by:
compute
in interfaceCovarianceFunction
- Parameters:
loghyper
- columnMatrix
of hyperparametersX
- input dataset- Returns:
- K covariance
Matrix
-
compute
public Jama.Matrix[] compute(Jama.Matrix loghyper, Jama.Matrix X, Jama.Matrix Xstar) Compute compute test set covariances- Specified by:
compute
in interfaceCovarianceFunction
- Parameters:
loghyper
- columnMatrix
of hyperparametersX
- input datasetXstar
- test set- Returns:
- [K(Xstar, Xstar) K(X,Xstar)]
-
computeDerivatives
public Jama.Matrix computeDerivatives(Jama.Matrix loghyper, Jama.Matrix X, int index) Coompute the derivatives of thisCovarianceFunction
with respect to the hyperparameter with indexidx
- Specified by:
computeDerivatives
in interfaceCovarianceFunction
- Parameters:
loghyper
- hyperparametersX
- input datasetindex
- hyperparameter index- Returns:
Matrix
of derivatives
-