Question: 1. Write a function M-file to solve min f(x) 1 by the exact gradient descent method, where f(2)= TAc and A is one of the

 1. Write a function M-file to solve min f(x) 1 by

1. Write a function M-file to solve min f(x) 1 by the exact gradient descent method, where f(2)= TAc and A is one of the following SPD matrices [92] 21 8 41 18] 2 6 8 9 18 14 (This is a strictly convex problem, the minimizer is r* = 0 and the minimum is 0.) The first line of your M-file should read function (x,min, err,iter] = Exact Gradient_ (x0, tol,N,A) The sub-functions that compute the gradient descent direction and f(x + a) are as follows. function p=GD (x) p=-A*x; end function y=f(x,p, alpha) z=x+alpha*p; y=.5*Z' *A*Z; end Use the initial guess 2) x0= and set N to be 200 and the tolerance to be 10-10 in your computations. Create a diary (HW3Diary-) that records your computations. You diary should contain the results for all three choices of A. (You will get bonus points by including in the diary some brief comments on what you have observed.) Email your M-file and diary as separate attachments

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!