[Scilab-users] non linear optim

Tim Wescott tim at wescottdesign.com
Mon Mar 20 18:12:03 CET 2017


On Mon, 2017-03-20 at 08:53 -0700, David Chèze wrote:
> Hi Paul,
> 
> the leastsq examples run properly on my machine, as well as other
> tests with
> simple functions inside.
> 
> I looked at leastsq first because of the minimal request very simple
> way to
> express the problem f=costf(X) with functions that are not quickly
> vectorizable. Otherwise I was used to datafit. I saw in lsqrsolve
> that we
> need to provide the numbers of equations to run the solver, maybe
> it's
> similar for leastsq ? In my case the costf function evaluates the
> model over
> 7 tests, each test is 6 to 7 evaluations of different configurations.
> I'm
> limiting to 2 unknowns to calibrate in my model so the problem can be
> solve
> a priori  but leastsq is not informed of that a priori . 
> 
> and 
> 
> 

Hey David:

I think Paul is concerned that something broke in the transition from
5.x to 6.0.

I haven't used fminsearch, but it looks like it uses a significantly
different algorithm than leastsq and optim (I believe that optim uses
Newton's method, or perhaps a combination of Newton's method and
gradient descent).  So it could just be that the underlying algorithm
in fminsearch works better for your problem than the one for leastsq.

Looking at the relevant Wikipedia pages may suggest something:

https://en.wikipedia.org/wiki/Nelder%E2%80%93Mead_method  (fminsearch)
https://en.wikipedia.org/wiki/Newton%27s_method_in_optimization (optim)

-- 

Tim Wescott
www.wescottdesign.com
Control & Communications systems, circuit & software design.
Phone: 503.631.7815
Cell:  503.349.8432






More information about the users mailing list