Constant covariance function. More...
#include <gpr/covariance_functions/ConstantCF.h>
Public Member Functions | |
| ConstantCF () | |
| ~ConstantCF () | |
| double | calculateLogPrior () |
| Evaluate the log prior of covariance function parameters. | |
| FieldMatrixd | calculateLogPriorGradient () |
| Evaluate gradient of the log prior with respect to the parameters. | |
| void | calculateGradOfCovMatrix (const Coord &x, Coord &x2, std::vector< FieldMatrixd > &DKff) |
| The function takes a matrix x of input vectors and returns DKff, the gradients of covariance matrix Kff = k(X,X2) with respect to th (cell array with matrix elements). | |
| void | calculateGradOfCovMatrixWithDerivatives (const Coord &x, Coord &x2, FieldMatrixIdx &dims, std::vector< FieldMatrixd > &DKff) |
| Evaluate gradient of covariance function, of which has been taken partial derivative with respect to x, with respect to parameters. | |
| void | calculateGradOfCovMatrixWithDerivatives2 (const Coord &x, Coord &x2, FieldMatrixIdx &dims1, FieldMatrixIdx &dims2, std::vector< FieldMatrixd > &DKff) |
| Evaluate gradient of covariance function, of which has been taken partial derivatives with respect to both input variables x, with respect to parameters. | |
| void | ginput2 (const Coord &x, Coord &x2, FieldMatrixIdx &dims, std::vector< FieldMatrixd > &DKff) |
| Evaluate gradient of covariance function with respect to both input variables x and x2 (in same dimension). | |
| void | ginput3 (const Coord &x, Coord &x2, FieldMatrixIdx &dims1, FieldMatrixIdx &dims2, std::vector< FieldMatrixd > &DKff) |
| Evaluate gradient of covariance function with respect to both input variables x and x2 (in different dimensions). | |
| void | ginput4 (const Coord &x, Coord &x2, FieldMatrixIdx &dims, std::vector< FieldMatrixd > &DKff) |
| Evaluate gradient of covariance function with respect to x. Simplified and faster version of constant_ginput, returns full matrices. | |
| void | calculateCovarianceMatrix (const Coord &x, Coord &x2, FieldMatrixd &C) |
| Evaluate covariance matrix between two input vectors. | |
| void | setConstSigma2 (const double _constSigma2) |
| Set the constSigma2 value. | |
| void | setParameters (const Eigen::VectorXd &w) |
| Set parameters of this covariance function using the provided vector. | |
| double | getConstSigma2 () |
| double | getConstSigma2 () const noexcept |
| Eigen::VectorXd | combineParameters () |
| Combine parameters of the covariance function into one Eigen vector. | |
Constant covariance function.
Definition at line 21 of file ConstantCF.h.
| gpr::ConstantCF::ConstantCF | ( | ) |
Definition at line 9 of file ConstantCF.cpp.
|
inline |
Definition at line 24 of file ConstantCF.h.
| void gpr::ConstantCF::calculateCovarianceMatrix | ( | const Coord & | x, |
| Coord & | x2, | ||
| FieldMatrixd & | C ) |
Evaluate covariance matrix between two input vectors.
C = GP_CONSTANT_COV(GP, TX, X) takes in covariance function of a Gaussian process GP and two matrixes TX and X that contain input vectors to GP. Returns covariance matrix C. Every element ij of C contains covariance between inputs i in TX and j in X. This is a mandatory subfunction used for example in prediction and energy computations.
| x | Configurations supplying the rows of the covariance matrix. |
| x2 | Configurations supplying the columns of the covariance matrix. |
| C | Output covariance matrix between x and x2. |
Definition at line 72 of file ConstantCF.cpp.
| void gpr::ConstantCF::calculateGradOfCovMatrix | ( | const Coord & | x, |
| Coord & | x2, | ||
| std::vector< FieldMatrixd > & | DKff ) |
The function takes a matrix x of input vectors and returns DKff, the gradients of covariance matrix Kff = k(X,X2) with respect to th (cell array with matrix elements).
This is a mandatory subfunction used in gradient computations.
| x | Configurations for the first covariance argument. |
| x2 | Configurations for the second covariance argument. |
| DKff | Output covariance-matrix derivatives with respect to the covariance hyperparameters. |
Definition at line 24 of file ConstantCF.cpp.
| void gpr::ConstantCF::calculateGradOfCovMatrixWithDerivatives | ( | const Coord & | x, |
| Coord & | x2, | ||
| FieldMatrixIdx & | dims, | ||
| std::vector< FieldMatrixd > & | DKff ) |
Evaluate gradient of covariance function, of which has been taken partial derivative with respect to x, with respect to parameters.
| x | Configurations for the first covariance argument. |
| x2 | Configurations for the second covariance argument. |
| dims | Coordinate-dimension indices for the derivative observations. |
| DKff | Output derivative-covariance blocks differentiated with respect to the covariance hyperparameters. |
Definition at line 30 of file ConstantCF.cpp.
| void gpr::ConstantCF::calculateGradOfCovMatrixWithDerivatives2 | ( | const Coord & | x, |
| Coord & | x2, | ||
| FieldMatrixIdx & | dims1, | ||
| FieldMatrixIdx & | dims2, | ||
| std::vector< FieldMatrixd > & | DKff ) |
Evaluate gradient of covariance function, of which has been taken partial derivatives with respect to both input variables x, with respect to parameters.
Returns DKff, the gradients of derivative covariance matrix dK(df,df)/dhyp = d(d^2 k(X1,X2)/dX1dX2)/dhyp with respect to the parameters.
| x | Configurations for the first covariance argument. |
| x2 | Configurations for the second covariance argument. |
| dims1 | Coordinate-dimension indices for derivatives with respect to the first input. |
| dims2 | Coordinate-dimension indices for derivatives with respect to the second input. |
| DKff | Output second-derivative covariance blocks differentiated with respect to the covariance hyperparameters. |
Definition at line 36 of file ConstantCF.cpp.
| double gpr::ConstantCF::calculateLogPrior | ( | ) |
Evaluate the log prior of covariance function parameters.
Definition at line 14 of file ConstantCF.cpp.
| FieldMatrixd gpr::ConstantCF::calculateLogPriorGradient | ( | ) |
Evaluate gradient of the log prior with respect to the parameters.
Definition at line 19 of file ConstantCF.cpp.
|
inline |
Combine parameters of the covariance function into one Eigen vector.
Definition at line 35 of file ConstantCF.inl.
|
inline |
Definition at line 30 of file ConstantCF.inl.
|
inlinenodiscardnoexcept |
Definition at line 179 of file ConstantCF.h.
| void gpr::ConstantCF::ginput2 | ( | const Coord & | x, |
| Coord & | x2, | ||
| FieldMatrixIdx & | dims, | ||
| std::vector< FieldMatrixd > & | DKff ) |
Evaluate gradient of covariance function with respect to both input variables x and x2 (in same dimension).
Returns DKff, the gradients of twice derivatived covariance matrix K(df,df) = dk(X1,X2)/dX1dX2 (cell array with matrix elements). Input variable's dimensions are expected to be same.
| x | Configurations for the first covariance argument. |
| x2 | Configurations for the second covariance argument. |
| dims | Coordinate-dimension indices for derivative observations. |
| DKff | Output second-derivative covariance blocks. |
Definition at line 42 of file ConstantCF.cpp.
| void gpr::ConstantCF::ginput3 | ( | const Coord & | x, |
| Coord & | x2, | ||
| FieldMatrixIdx & | dims1, | ||
| FieldMatrixIdx & | dims2, | ||
| std::vector< FieldMatrixd > & | DKff ) |
Evaluate gradient of covariance function with respect to both input variables x and x2 (in different dimensions).
DKff = GPCF_CONSTANT_GINPUT3(GPCF, X, X2) takes a covariance function structure GPCF, a matrix X of input vectors and returns DKff, the gradients of twice derivatived covariance matrix K(df,df) = dk(X1,X2)/dX1dX2 (cell array with matrix elements). The derivative is calculated in multidimensional problem between input's observation dimensions which are not same. This subfunction is needed when using derivative observations.
| x | Configurations for the first covariance argument. |
| x2 | Configurations for the second covariance argument. |
| dims1 | Coordinate-dimension indices for derivatives with respect to the first input. |
| dims2 | Coordinate-dimension indices for derivatives with respect to the second input. |
| DKff | Output second-derivative covariance blocks. |
Definition at line 52 of file ConstantCF.cpp.
| void gpr::ConstantCF::ginput4 | ( | const Coord & | x, |
| Coord & | x2, | ||
| FieldMatrixIdx & | dims, | ||
| std::vector< FieldMatrixd > & | DKff ) |
Evaluate gradient of covariance function with respect to x. Simplified and faster version of constant_ginput, returns full matrices.
Returns DKff, the gradients of covariance matrix Kff = k(X,X2) with respect to X (whole matrix). This function is needed when using derivative observations.
| x | Configurations for the first covariance argument. |
| x2 | Configurations for the second covariance argument. |
| dims | Coordinate-dimension indices for derivatives with respect to the first input. |
| DKff | Output covariance-derivative blocks. |
Definition at line 62 of file ConstantCF.cpp.
|
inline |
Set the constSigma2 value.
Definition at line 17 of file ConstantCF.inl.
|
inline |
Set parameters of this covariance function using the provided vector.
| w | Vector of hyperparameters |
Definition at line 22 of file ConstantCF.inl.