predict {dgpsi}  R Documentation 
This function implements singlecore or multicore predictions (with or without multithreading) from GP, DGP, or linked (D)GP emulators.
## S3 method for class 'dgp'
predict(
object,
x,
method = "mean_var",
full_layer = FALSE,
sample_size = 50,
cores = 1,
chunks = NULL,
threading = FALSE,
...
)
## S3 method for class 'lgp'
predict(
object,
x,
method = "mean_var",
full_layer = FALSE,
sample_size = 50,
cores = 1,
chunks = NULL,
threading = FALSE,
...
)
## S3 method for class 'gp'
predict(
object,
x,
method = "mean_var",
sample_size = 50,
cores = 1,
chunks = NULL,
...
)
object 
an instance of the 
x 
the testing input data:

method 
the prediction approach: meanvariance ( 
full_layer 
a bool indicating whether to output the predictions of all layers. Defaults to 
sample_size 
the number of samples to draw for each given imputation if 
cores 
the number of cores/workers to be used. If set to 
chunks 
the number of chunks that the testing input matrix 
threading 
a bool indicating whether to use the multithreading to accelerate the predictions of DGP or linked (D)GP emulators. Turn this option on
when you have a moderately large number of training data points as in such a case you could gain faster predictions. Defaults to 
... 
N/A. 
See further examples and tutorials at https://mingdeyu.github.io/dgpsiR/.
If object
is an instance of the gp
class:
if method = "mean_var"
: an updated object
is returned with an additional slot called results
that contains two matrices named mean
for the predictive means and var
for the predictive variances. Each matrix has only one column with its rows
corresponding to testing positions (i.e., rows of x
).
if method = "sampling"
: an updated object
is returned with an additional slot called results
that contains a matrix whose rows correspond
to testing positions and columns correspond to sample_size
number of samples drawn from the predictive distribution of GP.
If object
is an instance of the dgp
class:
if method = "mean_var"
and full_layer = FALSE
: an updated object
is returned with an additional slot called results
that contains two
matrices named mean
for the predictive means and var
for the predictive variances respectively. Each matrix has its rows corresponding to testing
positions and columns corresponding to DGP global output dimensions (i.e., the number of GP/likelihood nodes in the final layer).
if method = "mean_var"
and full_layer = TRUE
: an updated object
is returned with an additional slot called results
that contains two
sublists named mean
for the predictive means and var
for the predictive variances respectively. Each sublist contains L (i.e., the number of layers)
matrices named layer1, layer2,..., layerL
. Each matrix has its rows corresponding to testing positions and columns corresponding to
output dimensions (i.e., the number of GP/likelihood nodes from the associated layer).
if method = "sampling"
and full_layer = FALSE
: an updated object
is returned with an additional slot called results
that contains D (i.e., the number
of GP/likelihood nodes in the final layer) matrices named output1, output2,..., outputD
. Each matrix has its rows corresponding to testing positions and
columns corresponding to samples of size: B * sample_size
, where B
is the number of imputations specified in dgp()
.
if method = "sampling"
and full_layer = TRUE
: an updated object
is returned with an additional slot called results
that contains L (i.e., the number
of layers) sublists named layer1, layer2,..., layerL
. Each sublist represents samples drawn from the GP/likelihood nodes in the corresponding layer,
and contains D (i.e., the number of GP/likelihood nodes in the corresponding layer) matrices named output1, output2,..., outputD
. Each matrix gives samples
of the output from one of D GP/likelihood nodes, and has its rows corresponding to testing positions and columns corresponding to samples
of size: B * sample_size
, where B
is the number of imputations specified in dgp()
.
If object
is an instance of the lgp
class:
if method = "mean_var"
and full_layer = FALSE
: an updated object
is returned with an additional slot called results
that
contains two sublists named mean
for the predictive means and var
for the predictive variances respectively. Each sublist
contains M number (same number of emulators in the final layer of the system) of matrices named emulator1, emulator2,..., emulatorM
.
Each matrix has its rows corresponding to global testing positions and columns corresponding to output dimensions of the associated emulator
in the final layer.
if method = "mean_var"
and full_layer = TRUE
: an updated object
is returned with an additional slot called results
that contains
two sublists named mean
for the predictive means and var
for the predictive variances respectively. Each sublist contains L
(i.e., the number of layers in the emulated system) components named layer1, layer2,..., layerL
. Each component represents a layer
and contains M number (same number of emulators in the corresponding layer of the system) of matrices named emulator1, emulator2,..., emulatorM
.
Each matrix has its rows corresponding to global testing positions and columns corresponding to output dimensions of the associated
GP/DGP emulator in the corresponding layer.
if method = "sampling"
and full_layer = FALSE
: an updated object
is returned with an additional slot called results
that contains
M number (same number of emulators in the final layer of the system) of sublists named emulator1, emulator2,..., emulatorM
. Each
sublist corresponds to an emulator in the final layer, and contains D matrices, named output1, output2,..., outputD
, that correspond to the output
dimensions of the GP/DGP emulator. Each matrix has its rows corresponding to testing positions and columns corresponding to samples
of size: B * sample_size
, where B
is the number of imputations specified in lgp()
.
if method = "sampling"
and full_layer = TRUE
: an updated object
is returned with an additional slot called results
that contains
L (i.e., the number of layers of the emulated system) sublists named layer1, layer2,..., layerL
. Each sublist represents a layer
and contains M number (same number of emulators in the corresponding layer of the system) of components named emulator1, emulator2,..., emulatorM
.
Each component corresponds to an emulator in the associated layer, and contains D matrices, named output1, output2,..., outputD
, that correspond to
the output dimensions of the GP/DGP emulator. Each matrix has its rows corresponding to testing positions and columns corresponding to
samples of size: B * sample_size
, where B
is the number of imputations specified in lgp()
.
Any R vector detected in x
will be treated as a column vector and automatically converted into a singlecolumn R matrix.
## Not run:
# See gp(), dgp(), or lgp() for an example.
## End(Not run)