[SciPy-user] leastsquare N>M ?

Daniel Fish djf at pdx.edu
Wed Oct 4 09:20:55 CDT 2006


I receive the following error from scipy.optimize.leastsq() (in scipy version 0.5.0.2033, python 2.4 (windows)):

# CODE--------------------------------------
1. from scipy.optimize import *
2. def func(x):
3.     return x[0]**2
4. x0=[1,0]
5. (y,msg)=leastsq(func,x0)
6. print y

# OUTPUT----------------------------------------------------------------------------------------------------
File "C:/cygwin/Ksim/PythonCode/Database/test.py", line 5, in ?
(y,msg)=leastsq(func,x0)
File "C:\Python24\lib\site-packages\scipy\optimize\minpack.py", line 257, in leastsq raise errors[info][1], errors[info][0]
TypeError: Improper input parameters.
2 1 1 0.000000 0.000000 0.000000 600 100.000000
# -----------------------------------------------------------------------------------------------------------------

But have no problem if I let x0=[1]. Does leastsq not work with more unknowns than equations, or am I doing something wrong?

thanks,

djoefish






-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-user/attachments/20061004/e86c7ab4/attachment-0001.html 


More information about the SciPy-user mailing list