| validate {dgpsi} | R Documentation |
Validate a constructed GP, DGP, or linked (D)GP emulator
Description
This function validate a constructed GP, DGP, or linked (D)GP emulator via the Leave-One-Out (LOO) cross validation or Out-Of-Sample (OOS) validation.
Usage
validate(object, x_test, y_test, method, verb, force, cores, ...)
## S3 method for class 'gp'
validate(
object,
x_test = NULL,
y_test = NULL,
method = "mean_var",
verb = TRUE,
force = FALSE,
cores = 1,
...
)
## S3 method for class 'dgp'
validate(
object,
x_test = NULL,
y_test = NULL,
method = "mean_var",
verb = TRUE,
force = FALSE,
cores = 1,
threading = FALSE,
...
)
## S3 method for class 'lgp'
validate(
object,
x_test = NULL,
y_test = NULL,
method = "mean_var",
verb = TRUE,
force = FALSE,
cores = 1,
threading = FALSE,
...
)
Arguments
object |
can be one of the following:
|
x_test |
the OOS testing input data:
|
y_test |
the OOS testing output data that correspond to
|
method |
the prediction approach in validations: mean-variance ( |
verb |
a bool indicating if the trace information on validations will be printed during the function execution.
Defaults to |
force |
a bool indicating whether to force the LOO or OOS re-evaluation when |
cores |
the number of cores/workers to be used for the LOO or OOS validation. If set to |
... |
N/A. |
threading |
a bool indicating whether to use the multi-threading to accelerate the LOO or OOS. Turning this option on could improve the speed of validations when the emulator is built with a moderately large number of training data points and the Matérn-2.5 kernel. |
Details
See further examples and tutorials at https://mingdeyu.github.io/dgpsi-R/.
Value
If
objectis an instance of thegpclass, an updatedobjectis returned with an additional slot calledloo(for LOO cross validation) oroos(for OOS validation) that contains:two slots called
x_train(orx_test) andy_train(ory_test) that contain the validation data points for LOO (or OOS).a column matrix called
mean, ifmethod = "mean_var", ormedian, ifmethod = "sampling", that contains the predictive means or medians of the GP emulator at validation positions.three column matrices called
std,lower, andupperthat contain the predictive standard deviations and credible intervals of the GP emulator at validation positions. Ifmethod = "mean_var", the upper and lower bounds of a credible interval are two standard deviations above and below the predictive mean. Ifmethod = "sampling", the upper and lower bounds of a credible interval are 2.5th and 97.5th percentiles.a numeric value called
rmsethat contains the root mean/median squared error of the GP emulator.a numeric value called
nrmsethat contains the (min-max) normalized root mean/median squared error of the GP emulator. The min-max normalization is based on the maximum and minimum values of the validation outputs contained iny_train(ory_test).
The rows of matrices (
mean,median,std,lower, andupper) correspond to the validation positions.If
objectis an instance of thedgpclass, an updatedobjectis returned with an additional slot calledloo(for LOO cross validation) oroos(for OOS validation) that contains:two slots called
x_train(orx_test) andy_train(ory_test) that contain the validation data points for LOO (or OOS).a matrix called
mean, ifmethod = "mean_var", ormedian, ifmethod = "sampling", that contains the predictive means or medians of the DGP emulator at validation positions.three matrices called
std,lower, andupperthat contain the predictive standard deviations and credible intervals of the DGP emulator at validation positions. Ifmethod = "mean_var", the upper and lower bounds of a credible interval are two standard deviations above and below the predictive mean. Ifmethod = "sampling", the upper and lower bounds of a credible interval are 2.5th and 97.5th percentiles.a vector called
rmsethat contains the root mean/median squared errors of the DGP emulator across different output dimensions.a vector called
nrmsethat contains the (min-max) normalized root mean/median squared errors of the DGP emulator across different output dimensions. The min-max normalization is based on the maximum and minimum values of the validation outputs contained iny_train(ory_test).
The rows and columns of matrices (
mean,median,std,lower, andupper) correspond to the validation positions and DGP emulator output dimensions, respectively.If
objectis an instance of thelgpclass, an updatedobjectis returned with an additional slot calledoos(for OOS validation) that contains:two slots called
x_testandy_testthat contain the validation data points for OOS.a list called
mean, ifmethod = "mean_var", ormedian, ifmethod = "sampling", that contains the predictive means or medians of the linked (D)GP emulator at validation positions.three lists called
std,lower, andupperthat contain the predictive standard deviations and credible intervals of the linked (D)GP emulator at validation positions. Ifmethod = "mean_var", the upper and lower bounds of a credible interval are two standard deviations above and below the predictive mean. Ifmethod = "sampling", the upper and lower bounds of a credible interval are 2.5th and 97.5th percentiles.a list called
rmsethat contains the root mean/median squared errors of the linked (D)GP emulator.a list called
nrmsethat contains the (min-max) normalized root mean/median squared errors of the linked (D)GP emulator. The min-max normalization is based on the maximum and minimum values of the validation outputs contained iny_test.
Each element in
mean,median,std,lower,upper,rmse, andnrmsecorresponds to a (D)GP emulator in the final layer of the linked (D)GP emulator.
Note
When both
x_testandy_testareNULL, the LOO cross validation will be implemented. Otherwise, OOS validation will be implemented. The LOO validation is only applicable to a GP or DGP emulator (i.e.,xis an instance of thegpordgpclass). If a linked (D)GP emulator (i.e.,xis an instance of thelgpclass) is provided,x_testandy_testmust also be provided for OOS validation.Any R vector detected in
x_testandy_testwill be treated as a column vector and automatically converted into a single-column R matrix. Thus, ifx_testory_testis a single testing data point with multiple dimensions, it must be given as a matrix.
Examples
## Not run:
# See gp(), dgp(), or lgp() for an example.
## End(Not run)