[SciPy-user] error at optimize.fmin

Jose Lopez lopmart@gmail....
Wed Jun 18 04:30:21 CDT 2008


Hi, my code is the next and i  have a error, but i not know what i do:

from pylab import *
from scipy import *

def func(b,Hder):
    return (Hder[0]-(b[0]-b[1]))**2 + (Hder[1]-(b[1]-b[2]))**2+
(Hder[2]-(b[2]-b[3]))**2+ (Hder[3]-(b[3]-100.0))**2


b0=[0.0,0.0,0.0,0.0]
H0=[0.0,-50.0,20.0,-20.0]

xopt =optimize.fmin_l_bfgs_b(func,b0,args=(H0))



error is


Traceback (most recent call last):
  File "C:/Users/Valeria2/JL-MAESTRIA/programas 3
avance/resultado2/pruebafmin_l.py", line 13, in <module>
    xopt =optimize.fmin_l_bfgs_b(funcion,b0,args=(H0))
  File "C:\Python25\Lib\site-packages\scipy\optimize\lbfgsb.py", line 205,
in fmin_l_bfgs_b
    f, g = func_and_grad(x)
  File "C:\Python25\Lib\site-packages\scipy\optimize\lbfgsb.py", line 156,
in func_and_grad
    f, g = func(x, *args)
TypeError: funcion() takes exactly 2 arguments (5 given)


thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-user/attachments/20080618/24930b82/attachment.html 


More information about the SciPy-user mailing list