Calculate the gradient vector g(x) of function f(x) and Hessian matrix H(x), which are respectively:
g(x) = [2x 1,8x2]T
H(x) = [2,0; 0, 8]
Where t represents the transposition of the vector.
Select the starting point x0, and calculate the values of the function f(x) and the gradient vector g(x) at x0:
f(x0)= x 1^2+4x2^2 = 1+ 16 = 17
g(x0) = [2,8]T
According to Newton's iteration formula, calculate the next iteration point x 1:
x 1 = x0-[h(x0)]^- 1 g(x0)]
Where-1 represents the inverse of the matrix.
Substitute H(x0) and g(x0) into the above formula to obtain:
x 1 = x0 - [2,0; 0, 1/2] [2,8]
= x0 - [4,4]T
= [ 1,2]T - [4,4]T
= [-3,-2]T
Calculate the value of function f(x) at x 1
f(x 1)=(-3)^2+4(-2)^2 = 13
If the termination condition is met, the iteration is stopped; Otherwise, return to step 2 and continue the iteration with x 1 as a new starting point.
The termination condition can be that the maximum number of iterations is reached, the change of function value is less than a certain threshold, or the length of gradient vector is less than a certain threshold. In this example, you can set a fixed number of iterations or a threshold, and then stop iterating.
According to the above steps, Newton method can be used to solve the minimum value of function f (x f (x) = x12+4x2 22. In this example, the starting point is x0 = [1, 2] t, and after an iteration, we get x1= [-3,2] t, and the function value is f(x 1) = 13. Iteration can be continued as needed until the termination condition is met.