[SciPy-User] fmin / I'm sure this is a dumb syntax error on my part
Thu Oct 13 14:55:42 CDT 2011
So, I'm new to the optimization tools in scipy, so I'm trying to solve a problem I already know the answer to in an attempt to learn the system.
What I'm trying to solve is:
min of 100(y-x^2)^2+(1-x)^2
solving for both x and y (the solution is 1,1).
Based on the example, I tried this:
from scipy.optimize import fmin
return 100.0(x-x**2.0)**2.0 + (1.0-x)**2.0
iv = [2.0, 5.0]
Also in an earlier version I had x and y, but it wasn't working so I thought it might be better as an array. So when I do this I get an error that says that a float is not callable. What I think is happening is that it is substituting the initial guess in (thus it returns a float) but it isn't iterating for some reason.
I'm sure it's really stupid, but could someone explain what's suppose to be going on?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-User