I´ve been asigned to find a given fuction´s maximum with scipy.minimize with the BFGS method using lambda. I´ve already figured out that in order to do that, I need to minimize the -(f) function, but I cannot change the function itself, only the way it´s called in the minimize. Also, the asnwer must be a float.
A abd B are the two functions to maximize
Thanks in advance for the help!!
def A(x):
return -(x-1)**2
B = lambda x: -(x+2)**4
#This is where the minimize is called
def argmax(f):
from scipy.optimize import minimize
return