predict {dgpsi}R Documentation

Predictions from GP, DGP, or linked (D)GP emulators

Description

This function implements single-core or multi-core predictions (with or without multi-threading) from GP, DGP, or linked (D)GP emulators.

Usage

## 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,
  ...
)

Arguments

object

an instance of the gp, dgp, or lgp class.

x

the testing input data:

  • if object is an instance of the gp or dgp class, x is a matrix where each row is an input testing data point and each column is an input dimension.

  • if object is an instance of the lgp class, x can be a matrix or a list:

    • if x is a matrix, it is the global testing input data that feed into the emulators in the first layer of a system. The rows of x represent different input data points and the columns represent input dimensions across all emulators in the first layer of the system. In this case, it is assumed that the only global input to the system is the input to the emulators in the first layer and there is no global input to emulators in other layers.

    • if x is a list, it should have L (the number of layers in an emulator system) elements. The first element is a matrix that represents the global testing input data that feed into the emulators in the first layer of the system. The remaining L-1 elements are L-1 sub-lists, each of which contains a number (the same number of emulators in the corresponding layer) of matrices (rows being testing input data points and columns being input dimensions) that represent the global testing input data to the emulators in the corresponding layer. The matrices must be placed in the sub-lists based on how their corresponding emulators are placed in struc argument of lgp(). If there is no global input data to a certain emulator, set NULL in the corresponding sub-list of x.

method

the prediction approach: mean-variance ("mean_var") or sampling ("sampling") approach. Defaults to "mean_var".

full_layer

a bool indicating whether to output the predictions of all layers. Defaults to FALSE. Only used when object is a DGP and linked (D)GP emulator.

sample_size

the number of samples to draw for each given imputation if method = "sampling". Defaults to 50.

cores

the number of cores/workers to be used. If set to NULL, the number of cores is set to ⁠(max physical cores available - 1)⁠. Defaults to 1.

chunks

the number of chunks that the testing input matrix x will be divided into for multi-cores to work on. Only used when cores is not 1. If not specified (i.e., chunks = NULL), the number of chunks is set to the value of cores. Defaults to NULL.

threading

a bool indicating whether to use the multi-threading to accelerate the predictions of DGP or linked (D)GP emulators. Turn this option on when you use the Matérn-2.5 kernel and have a moderately large number of training data points as in such a case you could gain faster predictions. Defaults to FALSE.

...

N/A.

Details

See further examples and tutorials at https://mingdeyu.github.io/dgpsi-R/.

Value

Note

Any R vector detected in x will be treated as a column vector and automatically converted into a single-column R matrix. Thus, if x is 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)

[Package dgpsi version 2.4.0 Index]