tgpoptim {stops}R Documentation

Bayesian Optimization by a (treed) Bayesian Gaussian Process Prior (with jumps to linear models) surrogate model Essentially a wrapper for the functionality in tgp that has the same slots as optim with defaults for STOPS models.

Description

Bayesian Optimization by a (treed) Bayesian Gaussian Process Prior (with jumps to linear models) surrogate model Essentially a wrapper for the functionality in tgp that has the same slots as optim with defaults for STOPS models.

Usage

tgpoptim(
  x,
  fun,
  ...,
  initpoints = 10,
  lower,
  upper,
  acc = 1e-08,
  itmax = 10,
  verbose = 0,
  model = "bgp"
)

Arguments

x

optional starting values

fun

function to minimize

...

additional arguments to be passed to the function to be optimized

initpoints

the number of points to sample initially to fit the surrogate model

lower

The lower contraints of the search region

upper

The upper contraints of the search region

acc

if the numerical accuracy of two successive target function values is below this, stop the optimization; defaults to 1e-8

itmax

maximum number of iterations

verbose

numeric value hat prints information on the fitting process; >2 is extremely verbose

model

which surrogate model class to use (currently uses defaults only, will extend this to tweak the model)

Value

A list with the components (for compatibility with optim)

Examples


fbana <- function(x) {
x1 <- x[1]
x2 <- x[2]
100 * (x2 - x1 * x1)^2 + (1 - x1)^2
}
res1<-tgpoptim(c(-1.2,1),fbana,lower=c(-5,-5),upper=c(5,5),acc=1e-16,itmax=20)
res1

fwild <- function (x) 10*sin(0.3*x)*sin(1.3*x^2) + 0.00001*x^4 + 0.2*x+80
plot(fwild, -50, 50, n = 1000, main = "Bayesian GP Optimization minimizing 'wild function'")
set.seed(210485)
res2<-tgpoptim(50, fwild,lower=-50,upper=50,acc=1e-16,itmax=20,model="btgpllm")
points(res2$par,res2$value,col="red",pch=19)
res2


[Package stops version 1.6-2 Index]