# NOT RUN {
#define objective function
objFun <- function(x) 2*(x[1] - 1)^2 + 5*(x[2] - 3)^2 + (10*x[3] - x[4]/3)
spotConfig <-
list(types = c('numeric', 'numeric', 'numeric', 'numeric'),
funEvals = 15, #budget
noise = TRUE,
seedFun = 1,
replicated = 2,
seedSPOT = 1,
design = designLHD,
model = buildRandomForest, #surrogate model
optimizer = optimLHD, #LHD to optimize model
optimizerControl = list(funEvals=100)) #100 model evals in each step
lower <- c(-20, -20, -20, -20)
upper <- c(20, 20, 20, 20)
res <- spot(x=NULL,
fun=objFun,
lower=lower,
upper=upper,
control=spotConfig)
resPCA <- buildPCA(res$x)
# }
Run the code above in your browser using DataLab