# NLopt simplex methods in log scale

**URL:** <https://discourse.julialang.org/t/nlopt-simplex-methods-in-log-scale/6452>\
**Category:** Optimization (Mathematical)\
**Tags:** optim\
**Created:** [October 15, 2017, 7:52pm UTC](https://discourse.julialang.org/t/nlopt-simplex-methods-in-log-scale/6452 "2017-10-15T19:52:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ivborissov](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ivborissov/32/2841_2.png) [@ivborissov](https://discourse.julialang.org/u/ivborissov)\
**Post date:** [October 15, 2017, 7:52pm UTC](https://discourse.julialang.org/t/nlopt-simplex-methods-in-log-scale/6452/1 "2017-10-15T19:52:22Z")

</div>

Hi,  
It is often useful to move to log scale while searching for parameters in a wide range (1e-9, 1e9). In my case I am estimating parameters of ODE system in a range (1e-9, 1e9) using derivative-free optimization algorithms from NLopt. Moving to log scale (-9,9) gives good results for global methods, but slows down the computations for simplex methods (SBPLX, NELDERMEAD). Are there any recommendations for changing algorithm coefficients (alpha, gamma etc) when using log scale?

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [October 16, 2017, 8:30am UTC](https://discourse.julialang.org/t/nlopt-simplex-methods-in-log-scale/6452/2 "2017-10-16T08:30:33Z")

</div>

The simplex method family adapts slowly to changes in scale. You can change the expansion, contraction and shrink coefficients, eg \gamma=\kappa, \rho=\sigma=1/\kappa, where \kappa=2 is usually the default and you would need to increase it, but this may slow down convergence when the algorithm is approaching the optimum.

Figuring out how to use BFGS or similar, perhaps with automatic differentiation, may be a better option.

---

<div class="post-metadata">

**Author:** ![ivborissov](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ivborissov/32/2841_2.png) [@ivborissov](https://discourse.julialang.org/u/ivborissov)\
**Post date:** [October 18, 2017, 7:59pm UTC](https://discourse.julialang.org/t/nlopt-simplex-methods-in-log-scale/6452/3 "2017-10-18T19:59:56Z")

</div>

Thanks!

---

<div class="post-metadata">

**Author:** ![ivborissov](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ivborissov/32/2841_2.png) [@ivborissov](https://discourse.julialang.org/u/ivborissov)\
**Post date:** [October 27, 2017, 3:52pm UTC](https://discourse.julialang.org/t/nlopt-simplex-methods-in-log-scale/6452/4 "2017-10-27T15:52:51Z")

</div>

Is there a way to shange those coefficients in NLopt?

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [October 27, 2017, 6:05pm UTC](https://discourse.julialang.org/t/nlopt-simplex-methods-in-log-scale/6452/5 "2017-10-27T18:05:42Z")

</div>

> [@ivborissov](#):
>
> Is there a way to shange those coefficients in NLopt?

No, they are currently [hardcoded in the C library](https://github.com/stevengj/nlopt/blob/master/neldermead/nldrmd.c).

In general, I would recommend other algorithms for most problems. Even if it is inconvenient to compute derivatives, I would still tend to try something like BOBYQA first.

---

<div class="post-metadata">

**Author:** ![ivborissov](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ivborissov/32/2841_2.png) [@ivborissov](https://discourse.julialang.org/u/ivborissov)\
**Post date:** [October 27, 2017, 8:24pm UTC](https://discourse.julialang.org/t/nlopt-simplex-methods-in-log-scale/6452/6 "2017-10-27T20:24:31Z")

</div>

Steven, thanks for your response.  
Yes, I am aware that NELDERMEAD is not that reliable in some cases. However for my problems (ODE parameters estimation with inequality constraints) LN\_AUGLAG + LN\_NELDERMEAD finds good solution 10 times faster than BOBYQA/COBYLA and 5 times faster than SBPLX.
