Provide partial gradient and Hessian to fminunc.

2 ビュー (過去 30 日間)
Michael Stollenwerk
Michael Stollenwerk 2022 年 8 月 24 日
編集済み: Torsten 2022 年 8 月 24 日
I have the gradient and Hessian in closed form only for a subset of the variables of my objective function. As an example consider
function [f, g, H] = rosenboth(x)
f = 100*(x(2) - x(1)^2)^2 + (1-x(1))^2;
g = -400*(x(2)-x(1)^2)*x(1)-2*(1-x(1));
H = 1200*x(1)^2-400*x(2)+2;
end
where g and H are only w.r.t. x(1). If g and H where the full gradient and Hessian, I would simply use fminunc using
options = optimoptions('fminunc','Algorithm','trust-region',...
'SpecifyObjectiveGradient',true,'HessianFcn','objective');
It it possible to provide fminunc only with a partial gradient and Hessian and let it do numerical gradient and Hessian estimation for the rest?

採用された回答

Torsten
Torsten 2022 年 8 月 24 日
編集済み: Torsten 2022 年 8 月 24 日
It it possible to provide fminunc only with a partial gradient and Hessian and let it do numerical gradient and Hessian estimation for the rest?
No. But you could supply the rest by your own finite-difference approximation.

その他の回答 (0 件)

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by