298. Newton's Method

298.1. Newton’s Method

Newton’s method is an iterative numerical technique to find roots of a function (i.e., solutions to 𝑓(𝑥)=0).

Step 1. At each step, approximate 𝑓(𝑥) by its tangent line at the current guess 𝑥𝑘:

𝑓(𝑥)𝑓(𝑥𝑘)+𝑓(𝑥𝑘)(𝑥𝑥𝑘)

Step 2. Set this approximation equal to 0:

0=𝑓(𝑥𝑘)+𝑓(𝑥𝑘)(𝑥𝑥𝑘)

Step 3. Solve for 𝑥:

𝑥=𝑥𝑘𝑓(𝑥𝑘)𝑓(𝑥𝑘)

Step 4. This gives the update rule:

𝑥=𝑥𝑘𝑓(𝑥𝑘)𝑓(𝑥𝑘)

298.1.1. Newton’s Method for Nonlinear Optimization

Used to find the roots of the first derivative 𝑓(𝑥)=0, which correspond to the local minima/maxima of the original function 𝑓(𝑥).

Finding stationary points of a function 𝑓(𝑥), i.e., points where the gradient (derivative) is zero:

It can be derived from either linear approximation of the gradient or quadratic approximation of the function

298.1.1.1. 1D Linear Approximation
  1. Start with the first-order (linear) Taylor expansion of the derivative around 𝑥𝑘:
𝑓(𝑥𝑘+1)𝑓(𝑥𝑘)+𝑓(𝑥𝑘)(𝑥𝑥𝑘)
  1. Stationary point condition: Set the derivative to zero to find a candidate minimum or maximum
0=𝑓(𝑥𝑘)+𝑓(𝑥𝑘)(𝑥𝑥𝑘)
  1. Solve for the next iterate 𝑥𝑘+1:
𝑥𝑘+1=𝑥𝑘𝑓(𝑥𝑘)𝑓(𝑥𝑘)
298.1.1.2. nD Linear Approximation
  1. Start with the first-order (linear) Taylor expansion of the gradient around 𝑥𝑘:
𝑓(𝐱𝑘+1)𝑓(𝐱𝑘)+𝐻𝑘(𝐱𝑘+1𝐱𝑘)

where 𝐻𝑘=2𝑓(𝐱𝑘) is the Hessian matrix

  1. Stationary point condition: Set the gradient to zero to find a candidate minimum or maximum:
𝟎=𝑓(𝐱𝑘)+𝐻𝑘(𝐱+(𝑘+1)𝐱𝑘)
  1. Solve for the next iterate 𝐱𝑘+1:
𝐱𝑘+1=𝐱𝑘𝐻𝑘1𝑓(𝐱𝑘)
298.1.1.3. 1D Quadratic Approximation
  1. Start with the second-order (quadratic) Taylor expansion of the function around 𝑥𝑘:
𝑓𝑄(𝑥)=𝑓(𝑥𝑘)+𝑓(𝑥𝑘)(𝑥𝑥𝑘)+12𝑓(𝑥𝑘)(𝑥𝑥𝑘)2
  1. Minimize the quadratic approximation: Set the derivative of 𝑓𝑄(𝑥) to zero:
dd𝑥𝑓𝑄(𝑥)=𝑓(𝑥𝑘)+𝑓(𝑥𝑘)(𝑥𝑥𝑘)=0
  1. Solve for the next iterate 𝑥𝑘+1:
𝑥𝑘+1=𝑥𝑘𝑓(𝑥𝑘)𝑓(𝑥𝑘)
298.1.1.4. nD Quadratic Approximation
  1. Start with the second-order (quadratic) Taylor expansion of the function around 𝑥𝑘:
𝑚𝑘(𝐩)=𝑓(𝐱𝑘)+𝑓(𝐱𝑘)𝑇𝐩+12𝐩𝑇𝐻𝑘𝐩𝐩=𝐱𝐱𝑘
  1. Minimize the quadratic approximation: Set the gradient of 𝑚𝑘(𝐩) with respect to 𝐩 to zero:
𝑚𝑘(𝐩)=𝑓(𝐱𝑘)+𝐻𝑘𝐩=𝟎
  1. Solve for the step 𝐩𝑘 and next iterate 𝐱𝑘+1:
𝐩𝑘=𝐻𝑘1𝑓(𝐱𝑘),𝐱𝑘+1=𝐱𝑘+𝐩𝑘


298.1.1.5. Quadratic Approximation
𝑓𝑄(𝑥)=𝑓(𝑥𝑘)+𝑓(𝑥𝑘)(𝑥𝑥𝑘)+12𝑓(𝑥𝑘)(𝑥𝑥𝑘)2
Example
𝑓(𝑥)=𝑥5𝑓(𝑥)=5𝑥4

Hello

298.1.2. Multi-Dimensional

second-order iterative algorithm

uses both the

Step 1. Start with initial guess 𝑥0

Step 2. At each iteration 𝑘:

𝐱𝑘+1=𝐱𝑘[2𝑓(𝐱𝑘)]1𝑓(𝐱𝑘)𝑓(𝐱𝑘)=[𝜕𝑓𝜕𝑥1(𝐱𝑘)𝜕𝑓𝜕𝑥2(𝐱𝑘)𝜕𝑓𝜕𝑥𝑛(𝐱𝑘)]𝑛2𝑓(𝐱𝑘)=[𝜕2𝑓𝜕𝑥12(𝐱𝑘)𝜕2𝑓𝜕𝑥1𝜕𝑥2(𝐱𝑘)𝜕2𝑓𝜕𝑥1𝜕𝑥𝑛(𝐱𝑘)𝜕2𝑓𝜕𝑥2𝜕𝑥1(𝐱𝑘)𝜕2𝑓𝜕𝑥22(𝐱𝑘)𝜕2𝑓𝜕𝑥2𝜕𝑥𝑛(𝐱𝑘)𝜕2𝑓𝜕𝑥𝑛𝜕𝑥1(𝐱𝑘)𝜕2𝑓𝜕𝑥𝑛2𝜕𝑥2(𝐱𝑘)𝜕2𝑓𝜕𝑥𝑛2(𝐱𝑘)]𝑛×𝑛

Instead of computing the inverse explicitly, we solve the linear system:

2𝑓(𝐱𝑘)𝐩𝑘=𝑓(𝐱𝑘)[𝜕2𝑓𝜕𝑥12(𝐱𝑘)𝜕2𝑓𝜕𝑥1𝜕𝑥2(𝐱𝑘)𝜕2𝑓𝜕𝑥1𝜕𝑥𝑛(𝐱𝑘)𝜕2𝑓𝜕𝑥2𝜕𝑥1(𝐱𝑘)𝜕2𝑓𝜕𝑥22(𝐱𝑘)𝜕2𝑓𝜕𝑥2𝜕𝑥𝑛(𝐱𝑘)𝜕2𝑓𝜕𝑥𝑛𝜕𝑥1(𝐱𝑘)𝜕2𝑓𝜕𝑥𝑛2𝜕𝑥2(𝐱𝑘)𝜕2𝑓𝜕𝑥𝑛2(𝐱𝑘)][𝑝1𝑝2𝑝𝑛]=[𝜕𝑓𝜕𝑥1(𝐱𝑘)𝜕𝑓𝜕𝑥2(𝐱𝑘)𝜕𝑓𝜕𝑥𝑛(𝐱𝑘)]𝜕2𝑓𝜕𝑥12(𝐱𝑘)𝑝1+𝜕2𝑓𝜕𝑥1𝜕𝑥2(𝐱𝑘)𝑝2++𝜕2𝑓𝜕𝑥1𝜕𝑥𝑛(𝐱𝑘)𝑝𝑛=𝜕𝑓𝜕𝑥1(𝐱𝑘)𝜕2𝑓𝜕𝑥2𝜕𝑥1(𝐱𝑘)𝑝1+𝜕2𝑓𝜕𝑥22(𝐱𝑘)𝑝2++𝜕2𝑓𝜕𝑥2𝜕𝑥𝑛(𝐱𝑘)𝑝𝑛=𝜕𝑓𝜕𝑥2(𝐱𝑘)𝜕2𝑓𝜕𝑥𝑛𝜕𝑥1(𝐱𝑘)𝑝1+𝜕2𝑓𝜕𝑥𝑛2𝜕𝑥2(𝐱𝑘)𝑝2++𝜕2𝑓𝜕𝑥𝑛2(𝐱𝑘)𝑝𝑛=𝜕𝑓𝜕𝑥𝑛(𝐱𝑘)

Then update:

𝐱𝑘+1=𝐱𝑘𝐩𝑘
Example
𝑓(𝑥,𝑦)=𝑥2+𝑥𝑦+𝑦2

Step 1. Compute Gradient

𝑓(𝑥,𝑦)=[𝜕𝑓𝜕𝑥𝜕𝑓𝜕𝑦]=[2𝑥+𝑦𝑥+2𝑦]

Step 2. Compute Hessian

2𝑓(𝑥,𝑦)=[𝜕2𝑓𝜕𝑥2𝜕2𝑓𝜕𝑥𝜕𝑦𝜕2𝑓𝜕𝑦𝜕𝑥𝜕2𝑓𝜕𝑦2]=

Step 0. Setup

We want to minimize a function 𝑓(𝑥,𝑦)

At some iteration 𝑘, we compute:

𝑔=𝑓(𝑥𝑘,𝑦𝑘)=[𝑔1𝑔2]𝐻=2𝑓(𝑥𝑘,𝑦𝑘)=[𝑎𝑏𝑏𝑐]

We need the Newton step vector 𝑝 from:

𝐻𝑝=𝑔

so that the update is:

[𝑥𝑘+1𝑦𝑘+1]=[𝑥𝑘𝑦𝑘]𝑝

Step 1. We need the Newton step 𝑝 from:

[𝑎𝑏𝑏𝑐][𝑝1𝑝2]=[𝑔1𝑔2]

Which is two equations:

𝑎𝑝1+𝑏𝑝2=𝑔1𝑏𝑝1+𝑐𝑝2=𝑔2

Step 2. Solve without inversion

This is a simple linear system.

For example, solve the first equation for 𝑝1:

𝑝1=𝑔1𝑏𝑝2𝑎

Plug into the second:

𝑏(𝑔1𝑏𝑝2𝑎)+𝑐𝑝2=𝑔2𝑏𝑔1𝑎𝑏2𝑎𝑝2+𝑐𝑝2=𝑔2(𝑐=𝑏2𝑎)𝑝2=𝑔2𝑏𝑔1𝑎𝑝2=𝑎𝑔2𝑏𝑔1𝑎𝑐𝑏2

Then substitute back for 𝑝1:

𝑝1=𝑔1𝑏𝑝2𝑎

Step 3. Newton update

[𝑥𝑘+1𝑦𝑘+1]=[𝑥𝑘𝑦𝑘][𝑝1𝑝2]