WrappedDiceKrigingGP {GPTreeO} | R Documentation |
R6 class WrappedDiceKrigingGP
Description
Contains the GP created by DiceKriging::km from the DiceKriging
package
Public fields
gp
The DiceKriging GP object (DiceKriging::km in the
DiceKriging
manual)X_buffer
Buffer matrix to collect x points until first GP can be trained
y_buffer
Buffer vector to collect y points until first GP can be trained
y_var_buffer
Buffer vector to collect variance of y points until first GP can be trained
add_y_var
Small additional variance used to keep the covariance matrix condition number under control
n_points_train_limit
Number of points needed before we can create the GP
n_points
The number of collected points belonging to this GP
x_dim
Dimensionality of input points
gp_control
A list of GP implementation-specific options, passed directly to the wrapped GP implementation
init_covpars
The initial covariance parameters when training the DiceKriging GP object in self@gp
estimate_covpars
If TRUE, the parameters are estimated by the package. Otherwise, the parameters from init_covpars are taken
retrain_buffer_length
Only retrain after this many new points have been added to the buffer
retrain_buffer_counter
Counter for the number of new points added since last retraining
add_buffer_in_prediction
If TRUE, points in the data buffers are added to the GP before prediction. They are added into a temporarily created GP which contains the not yet included points. The GP in the node is not yet updated.
X_shared
Matrix with x points that this GP shares with the GP in the sibling node
y_shared
Vector of y points that this GP shares with the GP in the sibling node
y_var_shared
Vector of y_var points that this GP shares with the GP in the sibling node
n_shared_points
The number of own points shared with the GP in the sibling node
Methods
Public methods
Method new()
Create a new WrappedDiceKrigingGP object
Usage
WrappedDiceKrigingGP$new( X, y, y_var, gp_control, init_covpars, retrain_buffer_length, add_buffer_in_prediction, estimate_covpars = TRUE, X_shared = NULL, y_shared = NULL, y_var_shared = NULL )
Arguments
X
Input data matrix with x_dim columns and at maximum Nbar rows. Is used to create the first iteration of the local GP.
y
Value of target variable at input point x; has to be a one-dimensional matrix or a vector; any further columns will be ignored
y_var
Variance of the target variable; has to be a one-dimensional matrix or vector
gp_control
A list of GP implementation-specific options, passed directly to the wrapped GP implementation
init_covpars
Initial covariance parameters of the local GP
retrain_buffer_length
Only retrain when the number of buffer points or collected points exceeds this value
add_buffer_in_prediction
If TRUE, points in the data buffers are added to the GP before prediction. They are added into a temporarily created GP which contains the not yet included points. The GP in the node is not yet updated.
estimate_covpars
If TRUE, the parameters are estimated by the package. Otherwise, the parameters from init_covpars are taken
X_shared
Matrix with x points that this GP shares with the GP in the sibling node
y_shared
Vector of y points that this GP shares with the GP in the sibling node
y_var_shared
Vector of y_var points that this GP shares with the GP in the sibling node
Returns
A new WrappedDiceKrigingGP object. Besides the local GP, information on the shared points and those stored in the buffer are collected. For more information on the GP, consult the method DiceKriging::km in the DiceKriging
package.
Method update_init_covpars()
Stores the initial covariance parameters (length-scales, standard deviation and trend coefficients) of the GP in the field init_covpars
Usage
WrappedDiceKrigingGP$update_init_covpars()
Method get_lengthscales()
Retrieves the length-scales of the kernel of the local GP
Usage
WrappedDiceKrigingGP$get_lengthscales()
Method get_X_data()
Retrieves the design matrix X
Usage
WrappedDiceKrigingGP$get_X_data(include_shared = FALSE)
Arguments
include_shared
If TRUE, shared points between this GP and its sibling GP are included
Method get_y_data()
Retrieves the response
Usage
WrappedDiceKrigingGP$get_y_data(include_shared = FALSE)
Arguments
include_shared
If TRUE, shared points between this GP and its sibling GP are included
Method get_y_var_data()
Retrieves the individual variances from the response
Usage
WrappedDiceKrigingGP$get_y_var_data(include_shared = FALSE)
Arguments
include_shared
If TRUE, shared points between this GP and its sibling GP are included
Method get_cov_mat()
Retrieves the covariance matrix
Usage
WrappedDiceKrigingGP$get_cov_mat()
Returns
the covariance matrix
Method update_add_y_var()
Method for updating add_y_var based on a bound for the covariance matrix condition number, based on this paper, Section 5.4
Usage
WrappedDiceKrigingGP$update_add_y_var(max_cond_num)
Arguments
max_cond_num
Max allowed condition number
Method store_point()
Stores a new point into the respective buffer method
Usage
WrappedDiceKrigingGP$store_point( x, y, y_var, shared = FALSE, remove_shared = TRUE )
Arguments
x
Single input data point from the data stream; has to be a vector or row matrix with length equal to x_dim
y
Value of target variable at input point x; has to be a one-dimensional matrix or a vector; any further columns will be ignored
y_var
Variance of the target variable; has to be a one-dimensional matrix or vector
shared
If TRUE, this point is shared between this GP and its sibling GP
remove_shared
If TRUE, the last of the shared points is removed
Method delete_buffers()
Method for clearing the buffers
Usage
WrappedDiceKrigingGP$delete_buffers()
Method train()
Method for (re)creating / (re)training the GP
Usage
WrappedDiceKrigingGP$train(do_buffer_check = TRUE)
Arguments
do_buffer_check
If TRUE, only train the GP if the number of stored points is larger than retrain_buffer_length
Returns
TRUE if training was performed, otherwise FALSE
Method predict()
Method for prediction
Usage
WrappedDiceKrigingGP$predict(x, return_std = TRUE)
Arguments
x
Single data point for which the predicted mean (and standard deviation) is computed; has to be a vector or row matrix with length equal to x_dim
return_std
If TRUE, the standard error is returned in addition to the prediction
Returns
Prediction for input point x
Method delete_gp()
Method to delete the GP object in self$gp
Usage
WrappedDiceKrigingGP$delete_gp()
Method create_DiceKriging_gp()
Method for calling the 'km' function in DiceKriging to create a GP object, stored in self$gp
Usage
WrappedDiceKrigingGP$create_DiceKriging_gp(X, y, y_var)
Arguments
X
Input data matrix with x_dim columns and at maximum Nbar rows for the local GP.
y
Value of target variable at input point x; has to be a one-dimensional matrix or a vector; any further columns will be ignored
y_var
Variance of the target variable; has to be a one-dimensional matrix or vector
Returns
TRUE
Method call_DiceKriging_predict()
Method for calling the 'predict' function in DiceKriging
Usage
WrappedDiceKrigingGP$call_DiceKriging_predict(x, use_gp = NULL)
Arguments
x
Single data point for which the predicted mean (and standard deviation) is computed; has to be a vector with length equal to x_dim
use_gp
optional user-defined GP which is evaluated instead of the local GP
Returns
The predictions for x from the specified GP, by default the local GP
Method clone()
The objects of this class are cloneable with this method.
Usage
WrappedDiceKrigingGP$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.