DEoptim-methods {DEoptim}R Documentation

DEoptim-methods

Description

Methods for DEoptim objects.

Usage

## S3 method for class 'DEoptim':
summary(object, ...)
## S3 method for class 'DEoptim':
plot(x, plot.type = c("bestmemit","bestvalit","storepop"), ...)

Arguments

object, x An object of class~DEoptim; usually, a result of a call to~DEoptim.
plot.type Should we plot the best member at each iteration, the best value at each iteration or the intermediate populations?
... Further arguments passed to or from other methods.

Note

Please cite the package in publications. Use citation("DEoptim").

Author(s)

David Ardia~david.ardia@unifr.ch

Examples

  ## Rosenbrock Banana function
  Rosenbrock <- function(x){
    x1 <- x[1]
    x2 <- x[2]
    100 * (x2 - x1 * x1)^2 + (1 - x1)^2
  }

  lower <- c(-10,-10)
  upper <- -lower
  r <- DEoptim(Rosenbrock, lower, upper)
  summary(r) ## print summary of the DEoptim object

  par(mfrow = c(1,2))
  plot(r, type = 'b') ## plot the best members
  plot(r, plot.type = "bestvalit", type = 'b', col = 'blue') ## plot the best values

  ## rerun the optimization, and store intermediate populations
  r <- DEoptim(Rosenbrock, lower, upper, control=list(NP=400, itermax=30, storepopfrom=1, storepopfreq=2))
  summary(r)
  
  par(mfrow=c(1,1))
  plot(r, plot.type = "storepop") ## plot intermediate populations

[Package DEoptim version 1.3-3 Index]