Measuring the Hessian matrix for lsqnonlin
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hello
I am optimising a multiobjective function using the lsqnonlin function with the trust-region reflective algorithm.
I was wondering how I can get the hessian matrix as an output?
Is it possible to calculate it using the Jacobian matrix at the optimum solution that lsnqnonlin provides?
Thanks
0 comentarios
Respuestas (1)
Nipun
el 4 de Jun. de 2024
Hi SM,
I understand that you are optimizing a multiobjective function using the lsqnonlin function with the trust-region reflective algorithm and are interested in obtaining the Hessian matrix at the optimum solution.
It is possible to estimate the Hessian from the Jacobian matrix at the optimum, especially when using the trust-region reflective algorithm.
Here is one way to calculate this approximation in MATLAB after running lsqnonlin:
% Assuming 'fun' is your function and 'x0' is your initial guess
options = optimoptions('lsqnonlin', 'Algorithm', 'trust-region-reflective', 'Jacobian','on', 'Display','final');
[x,resnorm,residual,exitflag,output,lambda,jacobian] = lsqnonlin(fun,x0,[],[],options);
% Approximating the Hessian from the Jacobian
Hessian_approx = jacobian'*jacobian;
This approach gives you an approximation of the Hessian based on the Jacobian provided by lsqnonlin. Please note that this is a simplification and may not capture the full curvature of your objective function, especially if the residuals are significantly non-linear in the region of interest.
Refer to the following MathWorks documentation on "lsqnonlin" function in MATLAB:
Hope this helps.
Regards,
Nipun
0 comentarios
Ver también
Categorías
Más información sobre Numerical Integration and Differential Equations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!