0
$\begingroup$

I'm working with NMaximize. Currently, I use the "DifferentialEvolution" method. Let us assume that, as a general rule, the more time Mathematica spends looking for a maximum, the more accurate the result will be. One user might be able to spend more time looking for an answer in order to get greater accuracy, but another user might be constrained for time and might need to sacrifice some accuracy. I'm assuming that one tunes the parameter "ScalingFactor" to achieve their particular balance between the calculation time against the end result accuracy. Am I oversimplifying the issue? My question is, does a large ScalingFactor mean that Mathematica will work harder and longer to find the answer? I've read the Mathematica documentation on NMaximize, but it is quite lengthy and theoretical, and it doesn't help a user such as myself who simply wants set this parameter and then get on with their work.

$\endgroup$
9
  • 1
    $\begingroup$ The algorithm, including the scaling factor, is described here: "$\text{The }j^{\text{th}}\text{ new point is generated by picking three random points, }x_u\text{, }x_v\text{, and }x_w\,\text{, from the old population, and forming }x_s=x_w+s\left(x_u-x_v\right)\text{, where }s\text{ is a real scaling factor.}$" $\endgroup$ – Michael E2 Oct 22 '20 at 18:46
  • $\begingroup$ An analogy is the secant method for root-finding, if you know it: The new $x_3$ is generated from two points $x_1,x_2$ by $x_3=x_2+s\,(x_2-x_1)$, where the scaling factor is given by $s = f(x_2)/[f(x_2)-f(x_1)]$. One way to look at differential evolution is that it tends to be slow because the assumptions on $f$ are so weak that there is not a good way to estimate the optimal $s$ for each coordinate. $\endgroup$ – Michael E2 Oct 22 '20 at 19:05
  • $\begingroup$ @Michael I'm sorry, your equations are simple enough, but I still don't understand conceptually whether what the scaling factor does. Maybe I'm looking at this wrong? I assumed that a large scaling factor either sped the calculation up (with a sacrifice of some accuracy), or slowed it down (for greater accuracy). Would it be better to say that there is no general rule for how the scaling factor affects a calculation, and that the user simply has to use trial and error to choose the scaling factor? Thanks for your help. $\endgroup$ – Chris Oct 22 '20 at 19:23
  • $\begingroup$ ps. I am currently running my code with a scaling factor of 1.0. I was going to try a few scaling factors to see how the results and length of calculation change. After reading the documentation you linked, I would think that 1.0 is an especially a bad choice, and maybe I should just abort this calculation. $\endgroup$ – Chris Oct 22 '20 at 19:29
  • 1
    $\begingroup$ The scaling factor controls how big a bump the x's get at each step of the differential evolution. If you have a reason to think you need bigger bumps or a smaller bumps, you can change the factor. I don't see how to give guidelines (I don't have enough experience to know all the issues), but I'd think one would have to understand the objective function quite well to make a good choice. In diff. evo., you want the bump size to be balanced between jumping to another peak and converging to a local max. While my description is vague, I don't think I know how to make it clearer or more precise. $\endgroup$ – Michael E2 Oct 22 '20 at 19:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.