[SciPy-User] leastsq interface and features

josef.pktd at gmail.com josef.pktd at gmail.com
Sat May 29 11:42:12 EDT 2010


On Sat, May 29, 2010 at 11:06 AM, Vincent Davis <vincent at vincentdavis.net>wrote:

> On Fri, May 28, 2010 at 10:47 PM, bowie_22 <m.boumans at gmx.net> wrote:
>
>> Hello,
>>
>> at the moment am I am evaluating scipy as a subsitute for Matlab.
>> One important use case for me is to fit a model to measured data.
>>
>> In Matlab I use lsqnonlin from the Optimization Toolbox.
>> In Scipy I would use leastsq.
>>
>> By comparing the 2 approaches with a "daily use" point of view I see the
>> following improvements for the scipy module
>>
>> 1) setting the options for the algorithm:
>>   ML uses a structure together with optimset optimget
>>   --> lsqnonlin has a quite short signature
>> IMPROVEMENT: introduce a common options structure for all optimization
>> algos
>>
>> 2) there is the possibilty to set an output function that is called in
>> each
>> iteration step in ML. That can be used for displaying the current status
>> of the
>> optimization. For me a quite important point as my customers want to "see"
>> what
>> happens (not just throwing measured data to an algorithm and get back a
>> set of
>> numbers)
>>  IMPROVEMENT: introduce a output function that can be called each
>> iteration
>>
>> 3) give lower and upper bounds for the optimization variables. Also quite
>> important as in my uses cases you have normally an idea in which range
>> your
>> parameter should be (mass of a car 1200 - 1800 kg). In ML you can provide
>> this
>> knowledge as lower bounds and upper bounds to lsqnonlin.
>> IMPROVEMENT: introduce lower and upper bounds
>>
>> My problem:
>> How can I help to get this improvements to scipy? Is this the correct
>> address to
>> ask?
>>
>
> This is a good place to ask, I am surprised you have not already gotten
> several responses.
>
> I see in the docs that (“leastsq” is a wrapper around MINPACK’s lmdif and
> lmder algorithms.)
>
> You can also file a ticket at scipy, an example would be
> http://projects.scipy.org/scipy/ticket/808
> You can take a look at the source code.
> http://projects.scipy.org/scipy/browser/trunk/scipy/optimize/minpack.py
>
> That said you might want to look at http://statsmodels.sourceforge.net/ And you could help by contributing :) This is not a part of the project I
> am real familiar with but should be.
>

statsmodels has nothing to offer for this case.

A consistent interface to solvers is in openopt.

I don't know if leastsq could be extended, but for constraint minimization
scipy has other minimizers available. I think many of the other fmins have
callbacks and printing

Josef


>
> I don't have much more in the way of answers, I just don't know them :)
>
> Vincent
>
>
>> Regs
>>
>> Marcus
>>
>> _______________________________________________
>> SciPy-User mailing list
>> SciPy-User at scipy.org
>> http://mail.scipy.org/mailman/listinfo/scipy-user
>>
>
>   *Vincent Davis
> 720-301-3003 *
> vincent at vincentdavis.net
>  my blog <http://vincentdavis.net> | LinkedIn<http://www.linkedin.com/in/vincentdavis>
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20100529/6b23feb8/attachment.html>


More information about the SciPy-User mailing list