This function implements the static pruning of a DGP emulator.
Usage
prune(object, control = list(), verb = TRUE)
Arguments
- object
an instance of the
dgp
class that is generated bydgp()
withstruc = NULL
.- control
a list that can supply the following two components to control the static pruning of the DGP emulator:
min_size
, the minimum number of design points required to trigger the pruning. Defaults to 10 times of the input dimensions.threshold
, the R2 value above which a GP node is considered redundant and removable. Defaults to0.97
.
- verb
a bool indicating if the trace information will be printed during the function execution. Defaults to
TRUE
.
Details
See further examples and tutorials at https://mingdeyu.github.io/dgpsi-R/.
Note
The function requires a DGP emulator that has been trained with a dataset comprising a minimum size equal to
min_size
incontrol
. If the training dataset size is smaller than this, it is suggested to enrich the design of the DGP emulator and prune its structure dynamically using thedesign()
function. Depending on the design of the DGP emulator, the static pruning may not be accurate. It is thus suggested to implement dynamic pruning as a part of the sequential design viadesign()
.The following slots:
loo
andoos
created byvalidate()
; andresults
created bypredict()
;
in
object
will be removed and not contained in the returned object.
Examples
if (FALSE) { # \dontrun{
# load the package and the Python env
library(dgpsi)
# construct the borehole function over a hypercube
f <- function(x){
x[,1] <- (0.15 - 0.5) * x[,1] + 0.5
x[,2] <- exp((log(50000) - log(100)) * x[,2] + log(100))
x[,3] <- (115600 - 63070) *x[,3] + 63070
x[,4] <- (1110 - 990) * x[,4] + 990
x[,5] <- (116 - 63.1) * x[,5] + 63.1
x[,6] <- (820 - 700) * x[,6] + 700
x[,7] <- (1680 - 1120) * x[,7] + 1120
x[,8] <- (12045 - 9855) * x[,8] + 9855
y <- apply(x, 1, RobustGaSP::borehole)
}
# set a random seed
set_seed(999)
# generate training data
X <- maximinLHS(80, 8)
Y <- f(X)
# generate validation data
validate_x <- maximinLHS(500, 8)
validate_y <- f(validate_x)
# training a DGP emulator with anisotropic squared exponential kernels
m <- dgp(X, Y, share = F)
# OOS validation of the DGP emulator
plot(m, validate_x, validate_y)
# prune the emulator until no more GP nodes are removable
m <- prune(m)
# OOS validation of the resulting emulator
plot(m, validate_x, validate_y)
} # }