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

Eric Emsellem eemselle@eso....
Thu Mar 8 14:29:22 CST 2012

Dear all,

I know the title looks a little provocative, but this was obviously done 
on purpose. I am very impressed by the capabilities of scipy (et al., 
numpy etc) and have been a fan since years! But one thing (in my 
opinion) seems to be missing  (see below). If it exists, then great (and 

What I didn't find in Scipy (or numpy or..) is *an efficient 
least-squares fitting routine which can include bounded, or fixed 
parameters*. This seems like something many people must be needing! I am 
right now using mpfit.py (from minpack then Craig B. Markwardt for idl 
and Mark Rivers for python), which I did integrate in the package I am 
developing. It is much faster than many other routines in scipy although 
Adam Ginsburg did mention some test-bench he conducted some time ago, 
showing that leastsq was quite efficient. It can include bounds, fixed 
parameters etc. And it works great! But this is probably not the best 
way to have such a stand-alone routine... and it is far from being 
optimised for the modern python.


is there ANY plan for having such a module in Scipy?? I think 
(personally) that this is a MUST DO. This is typically the type of 
routines that I hear people use in e.g., idl etc. If this could be an 
optimised, fast (and easy to use) routine, all the better.

Any input is welcome!


More information about the SciPy-User mailing list