Newton's Method for Optimization
Lesson Introduction
Welcome to our lesson on Newton's Method for Optimization! This method helps us find the lowest point in a valley (minimum) or the highest peak on a mountain (maximum). By the end of this lesson, you'll understand Newton's Method, how it works, and how to use it in Python.
Imagine you're on a hike, looking for the lowest point in a valley. Newton's Method will guide you step-by-step to this point.
Task Setup: Function to Minimize
General Approach with Initial Guess
Updating the Guess Using Newton's Method
Python Implementation and Optimization Path: Part 1
Let's implement Newton's Method in Python and see it in action.
Here, we take multiple steps according to the formula above. We stop once the first derivative is very close to zero, indicating the minimum is reached. The code also defines the maximum amount of iterations. It is needed in case the minimum of the function doesn't exist or won't be found because the process will stuck in a loop.
Our function keeps track of all the steps, so we can plot it later.




