Skip to main content

Section 6.7 Scipy function minimize

Scipy has its own instruction to find function's minima: minimize. This function implements several optimization methods.

The code below shows how to use this instruction. The function used in the example is Rosenbrock's function with the Broyden-Fletcher-Goldfarb-Shanno algorithm.

Next code minimizes the Rosenbrock's function with the stabdard Conjugate Gradient algorithm:

Another popular optimization algorithm, used in the code below, is the Nelder-Mead Simplex method.
Below we use the Newton-Conjugate Gradient method. This method requires the user to pass to it the Jacobian of the function.
Finally, below we use the Powell method. This method is particularly useful for continuous functions with a complicated expression, for which would be hard to provide an explicit expression of its derivatives.