The steepest ascent method finds a local maximum of f(x,y) by repeatedly moving in the direction of the gradient.
Gradient
The gradient of f(x,y) is
∇f(x,y)=∂x∂fi+∂y∂fj
f(x,y) increases fastest in the direction of ∇f and decreases fastest in the opposite direction.
Procedure
Given a starting point (x0,y0)
- Evaluate the gradient ∇f(xi,yi)
- Search along the gradient direction for the hi that maximizes
g(hi)=f(xi+hi∂x∂f(xi,yi), yi+hi∂y∂f(xi,yi))
- Set g′(hi)=0 and solve for hi
- Update
xi+1=xi+hi∂x∂f(xi,yi),yi+1=yi+hi∂y∂f(xi,yi)
Worked Example
Maximize
f(x,y)=2xy+2x−x2−2y2
with initial guess x0=−1, y0=1. The partial derivatives are
∂x∂f=2y+2−2x,∂y∂f=2x−4y
Iteration 1
∂x∂f(−1,1)=6,∂y∂f(−1,1)=−6
g(h0)=f(−1+6h0, 1−6h0)=−180h02+72h0−7
g′(h0)=−360h0+72=0⟹h0=0.2
x1=−1+6(0.2)=0.2,y1=1−6(0.2)=−0.2
Iteration 2
∂x∂f(0.2,−0.2)=1.2,∂y∂f(0.2,−0.2)=1.2
g(h1)=f(0.2+1.2h1, −0.2+1.2h1)=−1.44h12+2.88h1+0.2
g′(h1)=−2.88h1+2.88=0⟹h1=1
x2=0.2+1.2(1)=1.4,y2=−0.2+1.2(1)=1
Iteration 3
∂x∂f(1.4,1)=1.2,∂y∂f(1.4,1)=−1.2
g(h2)=f(1.4+1.2h2, 1−1.2h2)=−7.2h22+2.88h2+1.64
g′(h2)=−14.4h2+2.88=0⟹h2=0.2
x3=1.4+1.2(0.2)=1.64,y3=1−1.2(0.2)=0.76
The iterations continue toward the maximum at (2,1), where f(2,1)=2.