12
$\begingroup$

Using NMinimize for finding global minima, one can choose the DifferentialEvolution method. You can find a (not so) detailed description in the link Constrained Optimization.

That being said, I would like to know if there is a simple way to implement the randomization of the value attributed to the option ScalingFactor. Such a feature should enhance the method:

It has been found recently that selecting F from the interval [0.5, 1.0] randomly for each generation or for each difference vector, a technique called dither, improves convergence behaviour significantly (Differential Evolution Homepage)

where the F mentioned in the quote corresponds to the value of ScalingFactor in Mathematica.

Probably, this is my lack of knowledge on the details of Mathematica showing up, but I don't know how to tell that in each step of NMinimize it should put RandomReal[{0.5,1.}] in the option ScalingFactor.

$\endgroup$
5
  • $\begingroup$ I tried "ScalingFactor" :> RandomReal[{0.5, 1}] which appeared to fail. So did setting the option to a list of factors. So I gave up as it probably being impossible. $\endgroup$
    – Michael E2
    Feb 20, 2014 at 11:43
  • $\begingroup$ Maybe I am talking nonsense, but is there any way to control each step of the process of the function NMinimize, so we can sort this random value for "ScalingFactor"each time? $\endgroup$
    – fcpenha
    Feb 20, 2014 at 18:51
  • $\begingroup$ @MichaelE2 , could you give some references or hints on how to control the steps of NMinimize and similar functions? Maybe I can't implement this specific problem that I proposed, but I feel I could learn a lot with this. $\endgroup$
    – fcpenha
    Mar 11, 2014 at 17:06
  • $\begingroup$ You can read about diff. evol. in tutorial/ConstrainedOptimizationGlobalNumerical -- you probably already have. That's about all I know about how to use it in Mma. What I tried were random guesses based on the description of the implementation in the tutorial. Occasionally I've gotten lucky and found an undocumented feature. Sorry I can't help further. $\endgroup$
    – Michael E2
    Mar 11, 2014 at 17:21
  • $\begingroup$ @MichaelE2 Yes, I've read the documentation. Thank you a lot for the time spent on this subject. $\endgroup$
    – fcpenha
    Mar 11, 2014 at 21:05

1 Answer 1

11
$\begingroup$

What follows is, of course, a terrible hack... since NMinimize is implemented entirely in top-level Mathematica, its code allows inspection by spelunking tools. The relevant function is

NMinimize[1, x]; (* force autoloading *)

Needs["GeneralUtilities`"]

PrintDefinitions[Optimization`NMinimizeDump`CoreDE]

and the desired behavior can be achieved by replacing scale in

mutateout[j, vecs, Length[vars], crossprob, scale]

with RandomReal[{0.5, 1}] and reevaluating the definition.

This change will only be in effect for the current kernel session and until the NMinimize definitions are read-in again. For a more persistent patch, one could load NMinimize and set DownValues[Optimization`NMinimizeDump`CoreDE] in an init.m file.

$\endgroup$
1
  • $\begingroup$ Nice adjustment. I think it would be good if the DE implementation could be updated with some other mutators in the future. The classical rand/1 is not bad, but the best choice is, as always, problem-specific. Empirically, I found that MDE5 is a very good default choice for many problems. Dither also does not seem to improve rand/1/bin as dramatically as it does some other mutators. $\endgroup$ Sep 27, 2015 at 1:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.