gp_opt | R Documentation |
Used internally. Simple Gaussian process-based Bayesian optimisation
function, used to find the next value to evaluate (as x
) in the
calibrate_trial()
function. Uses only a single input dimension, which may
be rescaled to the [0, 1]
range by the function, and a covariance structure
based on absolute distances between values, raised to a power (pow
) and
subsequently divided by lengthscale
before the inverse exponentiation of
the resulting matrix is used. The pow
and lengthscale
hyperparameters
consequently control the smoothness by controlling the rate of decay between
correlations with distance.
The optimisation algorithm uses bi-directional uncertainty bounds in an
acquisition function that suggests the next target to evaluate, with wider
uncertainty bounds (higher kappa
) leading to increased 'exploration' (i.e.,
the function is more prone to suggest new target values where the uncertainty
is high and often further from the best evaluation so far) and narrower
uncertainty bounds leading to increased 'exploitation' (i.e., the function is
more prone to suggest new target values relatively close to the mean
predictions from the model).
The dir
argument controls whether the suggested value (based on both
uncertainty bounds) should be the value closest to target
in either
direction (dir = 0
), at or above target
(dir > 0
), or at or below
target (dir < 0
), if any, are preferred.
When the function being evaluated is noise-free and monotonically increasing
or decreasing, the optimisation function can narrow the range of predictions
based on the input evaluations (narrow = TRUE
), leading to a finer grid of
potential new targets to suggest compared to when predictions are spaced over
the full range.
If the new value at which to evaluate the function suggested has already been
evaluated, random noise will be added to ensure evaluation at a new value
(if narrow
is FALSE
, noise will be based on a random draw from a normal
distribution with the current suggested value as mean and the standard
deviation of the x
values as SD, truncated to the range of x
-values; if
narrow
is TRUE
, a new value drawn from a uniform distribution within the
current narrowed range will be suggested. For both strategies, the process
will be repeated until the suggested value is 'new').
The Gaussian process model used is partially based on code from Gramacy
2020 (with permission), see References.
gp_opt(
x,
y,
target,
dir = 0,
resolution = 5000,
kappa = 1.96,
pow = 1.95,
lengthscale = 1,
scale_x = TRUE,
noisy = FALSE,
narrow = FALSE
)
x |
numeric vector, the previous values where the function being calibrated was evaluated. |
y |
numeric vector, the corresponding results of the previous
evaluations at the |
target |
single numeric value, the desired target value for the calibration process. |
dir |
single numeric value (default |
resolution |
single integer (default |
kappa |
single numeric value |
pow |
single numerical value, passed to |
lengthscale |
single numerical value (default |
scale_x |
single logical value; if |
noisy |
single logical value. If |
narrow |
single logical value. If |
List containing two elements, next_x
, a single numerical value, the
suggested next x
value at which to evaluate the function, and
predictions
, a data.frame
with resolution
rows and the four columns:
x
, the x
grid values where predictions are made; y_hat
, the predicted
means, and lub
and uub
, the lower and upper uncertainty bounds of the
predictions according to kappa
.
Gramacy RB (2020). Chapter 5: Gaussian Process Regression. In: Surrogates: Gaussian Process Modeling, Design and Optimization for the Applied Sciences. Chapman Hall/CRC, Boca Raton, Florida, USA. Available online.
Greenhill S, Rana S, Gupta S, Vellanki P, Venkatesh S (2020). Bayesian Optimization for Adaptive Experimental Design: A Review. IEEE Access, 8, 13937-13948. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1109/ACCESS.2020.2966228")}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.