# NOT RUN {
## Only a few examples. More examples can be found in the vignette and in
## the paper "In a Nutshell -- The Sequential Parameter Optimization Toolbox",
## see https://arxiv.org/abs/1712.04076
## 1. Most simple example: Kriging + LHS search + predicted mean optimization
## (not expected improvement)
set.seed(1)
res <- spot(x=NULL,funSphere,c(-2,-3),c(1,2),
control=list(funEvals=15))
res$xbest
res$ybest
## 2. With expected improvement
set.seed(1)
res <- spot(x=NULL,funSphere,c(-2,-3),c(1,2),
control=list(funEvals=15,
modelControl=list(target="ei")))
res$xbest
res$ybest
### 3. Use local optimization instead of LHS search
set.seed(1)
res <- spot(,funSphere,c(-2,-3),c(1,2),
control=list(funEvals=15,
modelControl=list(target="ei"),
optimizer=optimLBFGSB))
res$xbest
res$ybest
### 4. Use transformed input values
set.seed(1)
f2 <- function(x){2^x}
lower <- c(-100, -100)
upper <- c(100, 100)
transformFun <- rep("f2", length(lower))
res <- spot(x=NULL,funSphere,lower=lower, upper=upper,
control=list(funEvals=15,
modelControl=list(target="ei"),
optimizer=optimLBFGSB,
transformFun=transformFun))
res$xbest
res$ybest
# }
Run the code above in your browser using DataLab