buildBO: Bayesian Optimization Model Interface

View source: R/buildBO.R

buildBOR Documentation

Bayesian Optimization Model Interface

Description

Bayesian Optimization Model Interface

Usage

buildBO(x, y, control = list())

Arguments

x

matrix of input parameters. Rows for each point, columns for each parameter.

y

one column matrix of observations to be modeled.

control

list of control parameters:

thetaLower

lower boundary for theta, default is 1e-4

thetaUpper

upper boundary for theta, default is 1e2

algTheta

algorithm used to find theta, default is L-BFGS-B

budgetAlgTheta

budget for the above mentioned algorithm, default is 200. The value will be multiplied with the length of the model parameter vector to be optimized.

optimizeP

boolean that specifies whether the exponents (p) should be optimized. Else they will be set to two. Default is FALSE

useLambda

whether or not to use the regularization constant lambda (nugget effect). Default is TRUE

lambdaLower

lower boundary for log10lambda, default is -6

lambdaUpper

upper boundary for log10lambda, default is 0

startTheta

optional start value for theta optimization, default is NULL

reinterpolate

whether (TRUE,default) or not (FALSE) reinterpolation should be performed

target

target values of the prediction, a vector of strings. Each string specifies a value to be predicted, e.g., "y" for mean, "s" for standard deviation, "ei" for expected improvement. See also predict.kriging

Value

an object of class "spotBOModel", with a predict method and a print method. Basically a list, with the options and found parameters for the model which has to be passed to the predictor function:

x

sample locations

y

observations at sample locations (see parameters)

min

min y val

thetaLower

lower boundary for theta (see parameters)

thetaUpper

upper boundary for theta (see parameters)

algTheta

algorithm to find theta (see parameters)

budgetAlgTheta

budget for the above mentioned algorithm (see parameters)

lambdaLower

lower boundary for log10lambda, default is -6

lambdaUpper

upper boundary for log10lambda, default is 0

dmodeltheta

vector of activity parameters

dmodellambda

regularization constant (nugget)

mu

mean mu

ssq

sigma square

Psi

matrix large Psi

Psinv

inverse of Psi

nevals

number of Likelihood evaluations during MLE

References

Forrester, Alexander I.J.; Sobester, Andras; Keane, Andy J. (2008). Engineering Design via Surrogate Modelling - A Practical Guide. John Wiley & Sons.

Gramacy, R. B. Surrogates. CRC press, 2020.

Jones, D. R., Schonlau, M., and Welch, W. J. Efficient global optimization of expensive black-box functions. Journal of Global Optimization 13, 4 (1998), 455–492.

See Also

predict.spotBOModel

Examples

## Reproduction of Gramacy's classic EI illustration with data from Jones et al.
## Generates Fig. 7.6 from the Gramacy book "Surrogates".
x <- c(1, 2, 3, 4, 12)
y <- c(0, -1.75, -2, -0.5, 5)
## Build BO Model
m1 <- buildBO(x = matrix(x, ncol = 1), 
 y = matrix(y, ncol=1),
 control = list(target="ei"))
xx <- seq(0, 13, length=1000)
yy <- predict(object = m1, newdata = xx)
m <- which.min(y)
fmin <- y[m]
mue <- matrix(yy$y, ncol = 1)
s2 <- matrix(yy$s, ncol = 1)
ei <- matrix(yy$ei, ncol = 1)
## Plotting the Results (similar to Fig. 7.6 in Gramacy's Surrogate book)
par(mfrow=c(1,2))
plot(x, y, pch=19, xlim=c(0,13), ylim=c(-4,9), main="predictive surface")
lines(xx, mue)
lines(xx, mue + 2*sqrt(s2), col=2, lty=2)
lines(xx, mue - 2*sqrt(s2), col=2, lty=2)
abline(h=fmin, col=3, lty=3)
legend("topleft", c("mean", "95% PI", "fmin"), lty=1:3,   col=1:3, bty="n")
plot(xx, ei, type="l", col="blue", main="EI", xlab="x", ylim=c(0,max(ei)))
      

SPOT documentation built on June 26, 2022, 1:06 a.m.