MATLAB: Fminunc does not find the true global minimum

algorithmfminconfminuncoptimization

Hi all, I should solve this unconstrained optimization problem (attached). I know that the function has the global minimum at [1 2 2 3]. However, if I set as starting value [1 2 2 3], the algorithm ends up at [1.1667 2.4221 2.2561 3]. I have some doubts to clarify (I'm not familiar with this topic, sorry for my trivial questions):
1) The algorithm output reveals that at iteration 0 the function takes value 5.47709e-06 and at iteration 10 the function takes value 1.41453e-06. But, if I compute the function value at [1 2 2 3] I get 1.4140e-06 and if I compute the function value at [1.1667 2.4221 2.2561 3] I get 1.5635e-06. Why are these values different from the starting and final function values reported in the algorithm output?
2) How can I force the algorithm to keep searching until it arrives at [1 2 2 3]?
Thanks!

Best Answer

When you call fminunc with all 5 outputs
[x,fval,exitflag,output,grad,hessian]= fminunc(...)
what are the values of these outputs?
In particular, if the true Hessian is singular at the global min [1 2 2 3], I can imagine its finite difference estimate, as computed by fminunc, could be numerically problematic, e.g., not positive definite.