Quadratic Optimization using Newtons Method

I am writing Newtons method to solve an optimization problem. I have written the following code:
function estimate = newtonMethod(f,df,x0,tolerance) %f & df are functions that contain OP & gradient respectively, x0 is initial guess, tolerance is 1e-12
estimate = x0; % Initial guess
iterations = 40; % Maximum number of iterations
for j = 1:iterations;
dx = f(estimate) / df(estimate)';
estimate = estimate - dx';
% Stop criterion:
if abs(dx) < tolerance
return
end
end
end
However, the vector 'u' doesn't seem to be a good solution. My question is: Is this the correct way of solving this OP using Newtons Method? I would highly appreciate suggestions on this.

댓글 수: 10

Torsten
Torsten 2015년 11월 27일
Which OP ?
Best wishes
Torsten.
rihab
rihab 2015년 11월 27일
편집: rihab 2015년 11월 27일
Its a Quadratic OP expressed as: f = sigma(k)norm(u' * A_k * u - b_k) ; with gradient df = sigma(k)4*(u'* A_k * u - b_k) * A_k * u (I have found the gradient by matrix calculus;A_k is symmetric,positive definite).
Torsten
Torsten 2015년 11월 27일
편집: Torsten 2015년 11월 27일
Why a quadratic OP ? You take the norm of a quadratic in u - the result will have terms of order 4 in u, and a square root, too.
Best wishes
Torsten.
rihab
rihab 2015년 11월 27일
편집: rihab 2015년 11월 27일
I see. Eventually I am interested in the square norm, and I am trying to solve it by Newtons Method (that approximates it to a quadratic problem). Somehow I see that the estimate generated by the code i have written (mentioned above) isn't a good one. Is this the correct way of implementing it in MATLAB?
Torsten
Torsten 2015년 11월 27일
Why not use fminsearch again for control ?
Best wishes
Torsten.
rihab
rihab 2015년 11월 27일
I have already solved it using fminsearch which gave a very close estimate. I just want to see if Newtons method yields the same estimate or not so I wrote the code for it and wanted to know if its the correct way of implementing it or not :-)
Torsten
Torsten 2015년 11월 27일
편집: Torsten 2015년 11월 27일
If you want to use Newton's method, you must apply it to the equation df/du = 0.
So you will have to calculate the Hessian of f: d^2f/du^2.
Best wishes
Torsten.
rihab
rihab 2015년 11월 27일
I see. So you mean instead of dx = f(estimate) / df(estimate); i should write dx = df(estimate) / dfHessian(estimate); (where df is the gradient and dfHessian is hessian of f)
Torsten
Torsten 2015년 11월 27일
Yes.
rihab
rihab 2015년 11월 27일
thank you so much Torsten :-)

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Quadratic Programming and Cone Programming에 대해 자세히 알아보기

질문:

2015년 11월 27일

댓글:

2015년 11월 27일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by