We are using scipy.optimize.differential_evolution through lmfit for an optimization problem with major parameter magnitudes differences.
We know that leastsq does handle this type of problems but we are wondering if differential_evolution does as well or if we should normalize them in advance?
Best regards
CodePudding user response:
I think the answer to both of your 2 options is No.
First No: scipy (and so lmfit) differential_evolution()
does not automatically rescale parameter values to have similar orders of magnitude.
Second No: you should not have to rescale the values.
Basically, for some methods (say, leastsq
) it is important to rescale because the algorithm constructs and uses derivative matrices that include all of the variables. If there are widely varying scales, the manipulation of the matrices can be numerically unstable.
Differential Evolution does not use such derivatives (even where they would be helpful, hence its incredible slowness). So, it will not have that problem.
That said, just from a stability-of-numerical-calculations perspective, I would recommend against some variables that are on the scale of 1.e-12 with other on the scale 1e12. If you know the scale is outside 1e-6 to 1e6, rescale.