Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: fmincon Hessian is not a square matrix
Replies: 3   Last Post: Aug 8, 2013 9:44 AM

 Messages: [ Previous | Next ]
 Alan Weiss Posts: 1,430 Registered: 11/27/08
Re: fmincon Hessian is not a square matrix
Posted: Aug 8, 2013 8:47 AM

On 8/8/2013 7:23 AM, Olga Petrik wrote:
> Hi,
> I optimize a function with 157 parameters using fmincon and the result
> hessian is not a square matrix but just a vector of 157 elements (some
> of them are zeros and some are not). The diagnostic info for the
> optimization is:
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> Diagnostic Information Number of variables: 157
>
> Functions Objective: optimfcnchk/checkfun
> Hessian: finite-differencing (or
> Quasi-Newton)
>
> Algorithm selected
> medium-scale: Quasi-Newton line search
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
> Is there any way to get the square hessian matrix? (as I would like to
> compute using it sigma=sqrt(diag(inv(hessian)))') Or should I choose
> different optimization algorithm? Thanks!

There are two points here. One is the returned Hessian should be a
157-by-157 matrix. Are you sure that it is just a 157-element vector?

The other is that fmincon generally does not give accurate Hessians, as
documented here:
http://www.mathworks.com/help/optim/ug/hessian.html#bsapedt
It appears that you are using the active-set algorithm, so read that
part of the description.

Alan Weiss
MATLAB mathematical toolbox documentation

Date Subject Author
8/8/13 Olga Petrik
8/8/13 Alan Weiss
8/8/13 Olga Petrik
8/8/13 Olga Petrik