DEoptim               package:DEoptim               R Documentation

_D_i_f_f_e_r_e_n_t_i_a_l _E_v_o_l_u_t_i_o_n _O_p_t_i_m_i_z_a_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     Performs evolutionary global optimization via the differential
     evolution algorithm.

_U_s_a_g_e:

     DEoptim(fn, lower, upper, control = DEoptim.control(), ...)

_A_r_g_u_m_e_n_t_s:

      fn: A function to be minimized, with first argument the vector of
          parameters over which minimization is to take place. It
          should return a scalar result. 'NA' and 'NaN' values are not
          allowed.

lower, upper: Bounds on the variables.

 control: A list of control parameters; see 'DEoptim.control'.

     ...: Further arguments to be passed to 'fn'.

_D_e_t_a_i_l_s:

     'DEoptim' performs minimization of 'fn'. 

     The 'control' argument is a list; see the help file for
     'DEoptim.control' for details.

_V_a_l_u_e:

     A list of lists of the class 'DEoptim'.

     list 'optim' contains the followings:
      'bestmem': the best set of parameters found.
      'bestval': the value of 'fn' corresponding to 'bestmem'.
      'nfeval': number of function evaluations.
      'iter': number of procedure iterations.

     list 'member' contains the followings:
      'lower': the lower boundary.
      'upper': the upper boundary.
      'bestvalit': the best value of 'fn' at each iteration.
      'bestmemit': the best member at each iteration.
      'pop': the population generated at the last iteration.
      'storepop': a list containing the intermediate populations.

_N_o_t_e:

     'DEoptim' calls C code that is in many respects similar to the MS
     Visual C++ v5.0 implementation of the differential evolution
     algorithm distributed with the book _Differential Evolution - A
     Practical Approach to Global Optimization_ by Price, K.V., Storn,
     R.M., Lampinen J.A, Springer-Verlag, 2005, and found on-line at
     <URL: http://www.icsi.berkeley.edu/~storn/DeWin.zip>.

     If you experience misconvergence in the optimization process you
     usually have to increase the value for 'NP', but often you only
     have to adjust 'F' to be a little lower or higher than '0.8'. If
     you increase 'NP' and simultaneously lower 'F' a little,
     convergence is more likely to occur but generally takes longer,
     i.e. 'DEoptim' is getting more robust (there is always a
     convergence speed/robustness tradeoff).

     'DEoptim' is much more sensitive to the choice of 'F' than it is
     to the choice of 'CR'. 'CR' is more like a fine tuning element.
     High values of 'CR' like 'CR=1' give faster convergence if
     convergence occurs. Sometimes, however, you have to go down as
     much as 'CR=0' to make 'DEoptim' robust enough for a particular
     problem.

     To perform a maximization (instead of minimization) of a given
     function, simply define a new function which is the opposite of
     the function to maximize and apply 'DEoptim' to it.

     To integrate additional constraints on the parameters 'x' of
     'fn(x)', for instance 'x[1] + x[2]^2 < 2', integrate the
     constraint within the function to optimize, for instance: 


         fn <- function(x){
           if (x[1] + x[2]^2 < 2){
             r <- Inf
           else{
             ...
           }
           return(r)
         }

     Note that 'DEoptim' stops if any 'NA' or 'NaN' value is obtained.
     You have to redefine your function to handle these values (for
     instance, set 'NA' to 'Inf' in your objective function).

     You can reproduce your results by setting the seed of the random
     number  generator, e.g. 'set.seed(1234)'.

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

_A_u_t_h_o_r(_s):

     David Ardia david.ardia@unifr.ch and  Katharine Mullen
     katharine.mullen@nist.gov.

_R_e_f_e_r_e_n_c_e_s:

     Differential evolution homepage: <URL:
     http://www.icsi.berkeley.edu/~storn/code.html>

     Storn, R. and Price, K. (1997). Differential Evolution - A Simple
     and Efficient Heuristic for Global Optimization over Continuous
     Spaces, _Journal of Global Optimization_, 11:4, 341-359.  

     Price, K.V., Storn, R.M., Lampinen J.A. (2005). _Differential
     Evolution - A Practical Approach to Global Optimization_.
     Springer-Verlag. ISBN 3540209506.

_S_e_e _A_l_s_o:

     'DEoptim.control' for control arguments, 'DEoptim-methods' for
     methods on 'DEoptim' objects, including some examples in plotting
     the results; 'optim' or 'constrOptim' for alternative optimization
     algorithms.

_E_x_a_m_p_l_e_s:

       ## 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
      
       set.seed(1234)

       DEoptim(Rosenbrock, lower, upper)

       DEoptim(Rosenbrock, lower, upper, DEoptim.control(NP = 100))

       outDEoptim <- DEoptim(Rosenbrock, lower, upper, DEoptim.control(NP = 80,
                             itermax = 400, F = 1.2, CR = 0.7))
       
       plot(outDEoptim)

       ## 'Wild' function, global minimum at about -15.81515
       Wild <- function(x)
         10 * sin(0.3 * x) * sin(1.3 * x^2) +
            0.00001 * x^4 + 0.2 * x + 80

       
       plot(Wild, -50, 50, n = 1000,
         main = "'Wild function'")

       outDEoptim <- DEoptim(Wild, lower = -50, upper = 50,
                             control = DEoptim.control(trace = FALSE))
       
       plot(outDEoptim)

       DEoptim(Wild, lower = -50, upper = 50,
               control = DEoptim.control(NP = 50))

