I want to implement the Nelder-Mead optimization on an equation. But it does not contain only one variable, it contains multiple variables (one of them which is the unknown, and the others known.)
For instance at this example: http://docs.scipy.org/doc/scipy/reference/tutorial/optimize.html
If my rosen(x) was
def rosen(x,y):
... """The Rosenbrock function"""
... return sum(100.0*(x[1:]-x[:-1]**2.0)**y + (1-x[:-1])**2.0)
instead of this that is mentioned on the example, how could i optimise it? If i call
res = minimize(rosen, x0, method='nelder-mead',
... options={'xtol': 1e-8, 'disp': True})
it says that needs two arguments if i call
res = minimize(rosen(y), x0, method='nelder-mead',
... options={'xtol': 1e-8, 'disp': True})
with y already defined previously on the code, i get the same error. While if I call it
res = minimize(rosen(x,y), x0, method='nelder-mead',
... options={'xtol': 1e-8, 'disp': True})
I get an error that x is not defined.