CEoptim: Cross-Entropy optimizer

Description Usage Arguments Value Note Author(s) References Examples

View source: R/CEoptim.R

Description

CEopt is an optimization function based on the Cross-Entropy method

Usage

1
2
	CEoptim(f, f.arg=NULL, maximize=FALSE, continuous=NULL, discrete=NULL,
	    N=100L, rho=0.1, iterThr=1e4L, noImproveThr=5, verbose=FALSE)

Arguments

f

Function to be optimized. Can have continuous and discrete arguments

f.arg

List of additional fixed arguments passed to function f.

maximize

Logical value determining whether to maximize or minimize the objective function

continuous

List of arguments for the continuous optimization part consisting of:

discrete

List of arguments for the discrete optimization part, consisting of:

N

Integer representing the CE sample size.

rho

Value between 0 and 1 representing the elite proportion.

iterThr

Termination threshold on the largest number of iterations.

noImproveThr

Termination threshold on the largest number of iterations during which no improvement of the best function value is found.

verbose

Logical value set for CE progress output.

Value

CEoptim returns an object of class "CEoptim" which is a list with the following components.

Note

Although partial parameter passing is allowed outside lists, it is recommended that parameters names are specified in full. Parameters inside lists have to specified completely.

Because CEoptim is a random function it is useful to (1) set the seed for the random number generator (for testing purposes), and (2) investigate the quality of the results by repeating the optimization a number of times.

Author(s)

Tim Benham, Qibin Duan, Dirk P. Kroese, Benoit Liquet

References

Benham T., Duan Q., Kroese D.P., Liquet B. (2017) CEoptim: Cross-Entropy R package for optimization. Journal of Statistical Software, 76(8), 1-29.

Rubinstein R.Y. and Kroese D.P. (2004). The Cross-Entropy Method. Springer, New York.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Maximizing the Peaks Function


fun <- function(x){
return(3*(1-x[1])^2*exp(-x[1]^2 - (x[2]+1)^2)
	-10*(x[1]/5-x[1]^3 - x[2]^5)*exp(-x[1]^2 - x[2]^2)
	-1/3*exp(-(x[1]+1)^2 - x[2]^2))}

set.seed(1234)

mu0 <- c(-3,-3); sigma0 <- c(10,10)
 
res <- CEoptim(fun,continuous=list(mean=mu0, sd=sigma0), maximize=TRUE)

## To extract the Optimal value of fun
res$optimum
## To extract the location of the optimal value
res$optimizer$continuous
## print function gives the following default values
print(res)

CEoptim documentation built on May 30, 2017, 4:26 a.m.

Search within the CEoptim package
Search all R packages, documentation and source code