
For minimization, this function uses the "DEoptim"
method from the
codeDEoptim package. It is basically a wrapper, to enable DEoptim for usage
in SPOT.
optimDE(x = NULL, fun, lower, upper, control = list(), ...)
optional start point
objective function, which receives a matrix x and returns observations y
boundary of the search space
boundary of the search space
list of control parameters
funEvals
Budget, number of function evaluations allowed. Default is 200.
populationSize
Population size or number of particles in the population. Default is 10*dimension.
passed to fun
list, with elements
x
archive of the best member at each iteration
y
archive of the best value of fn at each iteration
xbest
best solution
ybest
best observation
count
number of evaluations of fun
# NOT RUN {
res <- optimDE(,lower = c(-10,-20),upper=c(20,8),fun = funSphere)
res$ybest
optimDE(x = matrix(rep(1,6), 3, 2),lower = c(-10,-20),upper=c(20,8),fun = funSphere,
control = list(funEvals=100, populationSize=20))
#Compare to DEoptim:
require(DEoptim)
set.seed(1234)
DEoptim(function(x){funRosen(matrix(x,1))}, lower=c(-10,-10), upper=c(10,10),
DEoptim.control(strategy = 2,bs = FALSE, N = 20, itermax = 28, CR = 0.7, F = 1.2,
trace = FALSE, p = 0.2, c = 0, reltol = sqrt(.Machine$double.eps), steptol = 200 ))
set.seed(1234)
optimDE(, fun=funRosen, lower=c(-10,-10), upper= c(10,10),
control = list( populationSize = 20, funEvals = 580, F = 1.2, CR = 0.7))
# }
Run the code above in your browser using DataLab