gp_surrogate {gptools2}R Documentation

Gaussian Process surrogate function

Description

Gaussian Process surrogate function

Gaussian Process surrogate function

Public fields

X

A n-by-p numeric matrix where n is the number of data points, p is the number of dimensions; the predictor variables.

ys

A n-by-1 column vector; the response variable.

sigma

A n-by-1 column vector or a scalar; the observational noise.

true_f

A function; the function of which the surrogate is seeked.

model

A variable for storing the fitted model.

sample_fun

A function; the function to sample the next set of points to evaluate using the surrogate function. By default, it samples from the bounding hypercube of the variable 'X'.

select_fun

A function; the function to select the next point to evaluate using the true function. By default, it picks the point that has the highest predictive variance.

in_sample_fit

The in-sample fit of the fitted model to the training data X.

next_to_consider

The next set of points to evaluate using the surrogate function.

out_of_sample_uncertainty

The out-of-sample uncertainty associated with 'next_to_consider'; the predictive variance.

next_to_evaluate

The next point to evaluate using the true function.

measure

The summary measure of the fitted model.

debug

TRUE or FALSE, whether to use the debug mode.

Methods

Public methods


Method new()

Constructor of the Gaussian Process surrogate model

Usage
gp_surrogate$new(
  X,
  f,
  kernel = squared_exponential(),
  sigma = 0,
  sample_fun,
  select_fun,
  debug = FALSE,
  sample_n = 20,
  parallel = FALSE,
  mc.cores = 1,
  options = list(),
  ...
)
Arguments
X

A numeric matrix; the training data.

f

A function; the function of which the surrogate is seeked.

kernel

The kernel function of the Gaussian Process.

sigma

The regularisation parameter of the Gaussian Process.

sample_fun

sample_fun A function; the function to sample the next set of points to evaluate using the surrogate function.

select_fun

select_fun A function; the function to select the next point to evaluate using the true function.

debug

TRUE or FALSE, whether to use the debug mode.

sample_n

A positive integer; the number of samples to draw in each iteration. Note that this parameter is used only when 'sample_fun' is not provided.

parallel

TRUE or FALSE; whether to use parallel computing.

mc.cores

A positive integer; the number of cores to use for parallel computing. Only works when 'parallel = TRUE'.

options

Optional argument to pass to optim.

...

Additional parameters to pass to gp.


Method update()

Update a fitted model with active learning

Usage
gp_surrogate$update(parallel = FALSE, mc.cores = 1, options)
Arguments
parallel

TRUE or FALSE; whether to use parallel computing.

mc.cores

A positive integer; the number of cores to use for parallel computing. Only works when 'parallel = TRUE'.

options

Optional argument to pass to optim


Method measure_fit_and_risk()

Evaluate the fitted model using the in-sample fit and out-of-sample variance

Usage
gp_surrogate$measure_fit_and_risk()

Method clone()

The objects of this class are cloneable with this method.

Usage
gp_surrogate$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


[Package gptools2 version 0.1.10 Index]