mice {dgpsi} | R Documentation |
Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using MICE
Description
This function searches from a candidate set to locate the next design point(s) to be added to a (D)GP emulator or a bundle of (D)GP emulators using the Mutual Information for Computer Experiments (MICE), see the reference below.
Usage
mice(object, x_cand, ...)
## S3 method for class 'gp'
mice(object, x_cand, batch_size = 1, nugget_s = 1e-06, workers = 1, ...)
## S3 method for class 'dgp'
mice(
object,
x_cand,
batch_size = 1,
nugget_s = 1e-06,
workers = 1,
threading = FALSE,
aggregate = NULL,
...
)
## S3 method for class 'bundle'
mice(
object,
x_cand,
batch_size = 1,
nugget_s = 1e-06,
workers = 1,
threading = FALSE,
aggregate = NULL,
...
)
Arguments
object |
can be one of the following:
|
x_cand |
a matrix (with each row being a design point and column being an input dimension) that gives a candidate set
from which the next design point(s) are determined. If |
... |
any arguments (with names different from those of arguments used in |
batch_size |
an integer that gives the number of design points to be chosen.
Defaults to |
nugget_s |
the value of the smoothing nugget term used by MICE. Defaults to |
workers |
the number of workers/cores to be used for the criterion calculation. If set to |
threading |
a bool indicating whether to use the multi-threading to accelerate the criterion calculation for a DGP emulator. Turning this option on could improve the speed of criterion calculations when the DGP emulator is built with a moderately large number of training data points and the Matérn-2.5 kernel. |
aggregate |
an R function that aggregates scores of the MICE across different output dimensions (if
Set to |
Details
See further examples and tutorials at https://mingdeyu.github.io/dgpsi-R/.
Value
If
object
is an instance of thegp
class, a vector is returned with the length equal tobatch_size
, giving the positions (i.e., row numbers) of next design points fromx_cand
.If
object
is an instance of thedgp
class, a matrix is returned with row number equal tobatch_size
and column number equal to one (ifaggregate
is notNULL
) or the output dimension (ifaggregate
isNULL
), giving positions (i.e., row numbers) of next design points fromx_cand
to be added to the DGP emulator across different outputs. Ifobject
is a DGP emulator with eitherHetero
orNegBin
likelihood layer, the returned matrix has two columns with the first column giving positions of next design points fromx_cand
that correspond to the mean parameter of the normal or negative Binomial distribution, and the second column giving positions of next design points fromx_cand
that correspond to the variance parameter of the normal distribution or the dispersion parameter of the negative Binomial distribution.If
object
is an instance of thebundle
class, a matrix is returned with row number equal tobatch_size
and column number equal to the number of emulators in the bundle, giving positions (i.e., row numbers) of next design points fromx_cand
to be added to individual emulators.
Note
The column order of the first argument of
aggregate
must be consistent with the order of emulator output dimensions (ifobject
is an instance of thedgp
class), or the order of emulators placed inobject
ifobject
is an instance of thebundle
class;If
x_cand
is supplied as a list whenobject
is an instance ofbundle
class and aaggregate
function is provided, the matrices inx_cand
must have common rows (i.e., the candidate sets of emulators in the bundle have common input locations) so theaggregate
function can be applied.Any R vector detected in
x_cand
will be treated as a column vector and automatically converted into a single-column R matrix.
References
Beck, J., & Guillas, S. (2016). Sequential design with mutual information for computer experiments (MICE): emulation of a tsunami model. SIAM/ASA Journal on Uncertainty Quantification, 4(1), 739-766.
Examples
## Not run:
# load packages and the Python env
library(lhs)
library(dgpsi)
# construct a 1D non-stationary function
f <- function(x) {
sin(30*((2*x-1)/2-0.4)^5)*cos(20*((2*x-1)/2-0.4))
}
# generate the initial design
X <- maximinLHS(10,1)
Y <- f(X)
# training a 2-layered DGP emulator with the global connection off
m <- dgp(X, Y, connect = F)
# generate a candidate set
x_cand <- maximinLHS(200,1)
# locate the next design point using MICE
next_point <- mice(m, x_cand = x_cand)
X_new <- x_cand[next_point,,drop = F]
# obtain the corresponding output at the located design point
Y_new <- f(X_new)
# combine the new input-output pair to the existing data
X <- rbind(X, X_new)
Y <- rbind(Y, Y_new)
# update the DGP emulator with the new input and output data and refit with 500 training iterations
m <- update(m, X, Y, refit = TRUE, N = 500)
# plot the LOO validation
plot(m)
## End(Not run)