Search⌘ K

Solving Problems with the Gradient and the Hessian

Explore how to solve optimization problems by identifying candidate points where the gradient is zero and using the Hessian to classify these points as minima or maxima. Learn to implement these techniques in Python with detailed code steps and examples.

We know the candidate points are those in which the gradient has all its entries equal to zero. Therefore, for each point, we do a test with the Hessian so we can determine if the point is a minimum, a maximum, or neither.

Getting the candidate points with Python

Let’s break the code into pieces. We’re going to calculate the gradient first and the points that make it zero. The function will be f(x,y,z)=x2+y2+z2f(x, y, z) = x^2 + y^2 + z^2 ...