[SciPy-User] Least-squares fittings with bounds: why is scipy not up to the task?

Matthew Newville matt.newville@gmail....
Fri Mar 9 14:50:57 CST 2012


Pauli,

On Friday, March 9, 2012 12:31:22 PM UTC-6, Pauli Virtanen wrote:
>
> Hi,
>
> 09.03.2012 18:50, Charles R Harris kirjoitti:
> [clip]
> > Carefully stepping past the kerfluffle at the bar, I think this sort of
> > functionality in scipy would be useful. If nothing else, I wouldn't have
> > to keep implementing for myself ;) IIRC, Dennis Lexalde was going to do
> > something similar and I think it would be good if some of the folks with
> > implementations started a separate thread about getting it into scipy.
>
> Dennis actually not only intended, but also implemented something
> similar. I wasn't too deeply involved in that, but it's already merged
> in Scipy's trunk.
>
> Now, based on a *very* quick look to lmfit (I did not look at it before
> now as I did not remember it existed), it seems to be quite similar in
> purpose. Hashing out if lmfit has something extra, or if the current
> implementation is missing something could be useful, however.
>
>         Pauli
>
If I understand, you are talking about scipy.optimize.minimize(), which can 
take many minimization methods, but only accepts bounds for the underlying 
methods (l-bfgs-b, coblya, slsqp, and tnc), and constraints only for coblya 
and slsqp.     Thus, I would interpret minimize() to aim to be (and 
documented to be) a unification of the routines to minimize a scalar 
function of one or more variables.   For the discussion here, minimize() 
does not support the Levenberg-Marquardt least-squares algorithm (leastsq) 
at all, as lmfit uses (and as mpfit uses).  

The constraint mechanism is entirely different between lmfit and the other 
constrained optimization methods. 

Cheers, 

--Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20120309/46c6dab4/attachment-0001.html 


More information about the SciPy-User mailing list