Hessian in optimValues of fminunc

1 回表示 (過去 30 日間)
Alexander Andreychenko
Alexander Andreychenko 2016 年 2 月 13 日
コメント済み: Alan Weiss 2016 年 2 月 16 日
Hello everyone! I have the function which I minimize with fminunc. So far, no problems with that. I have the analytical expression of the Hessian for my function. I want to be able to plot the conditional number of Hessian during the course of the optimization. Is there any way to pass the Hessian/its conditional number to outputFcn (via optimValues)?

採用された回答

Alan Weiss
Alan Weiss 2016 年 2 月 16 日
While I am not sure that I understand your question, it seems that you have an analytic expression for the Hessian you want to plot. The syntax of a cutom output function is
function stop = outfun(x,optimValues,state)
So you have the current point x available to your output function, meaning you can calculate the Hessian in your output function.
If I misunderstand what you are asking, please try again.
Alan Weiss
MATLAB mathematical toolbox documentation
  2 件のコメント
Alexander Andreychenko
Alexander Andreychenko 2016 年 2 月 16 日
編集済み: Alexander Andreychenko 2016 年 2 月 16 日
Thank you for the answer! This is exacly what I did recently. However, this leads to one additional computation of the function (together with the Hessian) which in my case is quite expensive. I was looking for some way to "send" the Hessian matrix via optimValues in the same fashion as it is done for gradient vector. But it seems like it is not possible (at least not by users :)).
Alan Weiss
Alan Weiss 2016 年 2 月 16 日
Oh, I did not realize that what you were looking for was a way to avoid another calculation of the Hessian. It is possible that something along the lines of the nested function technique used in this documentation could save you from computing the Hessian twice.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by