optimDE: Minimization by Differential Evolution

View source: R/optimDE.R

optimDER Documentation

Minimization by Differential Evolution

Description

For minimization, this function uses the "DEoptim" method from the codeDEoptim package. It is basically a wrapper, to enable DEoptim for usage in SPOT.

Usage

optimDE(x = NULL, fun, lower, upper, control = list(), ...)

Arguments

x

optional start point

fun

objective function, which receives a matrix x and returns observations y

lower

boundary of the search space

upper

boundary of the search space

control

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

Value

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

Examples

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))

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