# Hessian output using simulannealbnd and fmincon

23 views (last 30 days)
Girija Bahety on 5 Apr 2021
Commented: Girija Bahety on 14 Apr 2021
For an optimisation problem to estimate parameters of a model, I run "simulannealbnd" along with the hybrid options of "fmincon" to get the global minima. The codes are below:
rng(1234,'twister') % for reproducibility
options = optimoptions('simulannealbnd','PlotFcns',{@saplotbestx,@saplotbestf,@saplotx,@saplotf});
options = optimoptions(options,'MaxIterations',2000);
options = optimoptions(options,'FunctionTolerance',10^-8);
hybridoptions = optimoptions('fmincon','Display','iter','FunctionTolerance',10^-8,'PlotFcn',@optimplotfval);
options = optimoptions(options,'HybridFcn',{@fmincon,hybridoptions});
[param,fval,exitFlag,output] = simulannealbnd(@function_name,param_0,param_lb,param_ub,options);
How can I calculate the Hessian for the parameters that I estimate given fmincon is a hybrid option and "simulannealbnd" does not support "hessian" as an output.

Matt J on 6 Apr 2021
Edited: Matt J on 6 Apr 2021
I'm assuming you can't simply do an analytical Hessian computation at the solution you found...
One alternative would be to run an iteration of fmincon with the solution from simulannealbnd as the initial guess, x0. Since x0 is already a solution, fmincon should stop in zero iterations and report the Hessian at x0 as output.
Another alternative would be to use a finite differencing tool from the File Exchange to compute the Hessian, e.g.,
Girija Bahety on 14 Apr 2021
Thank you so much!