"Céldor " <
ze...@op.pl> wrote in message <jh3i3j$fdf$
1...@newscl01ah.mathworks.com>...
>
> Thanks for the answer. When I read hessian from fminunc--this hessian is similar to the one returned from fmincon, I get negative numbers. I think it is not right. When the Hessian is all positive, sometimes when I calculate its inverse it gets also negative numbers. It is like Covariance contains negative numbers. What am I doing wrong and how to handle this problem?
=================
You probably need to compute the Hessian analytically in order for this application to work well. The numerical approximations used by FMINUNC will be subject to various kinds of inaccuracies.
Incidentally, though, there's no reason the Hessian (or it's inverse) shouldn't contain negative numbers. If your minimum has a strictly positive definite Hessian, then the diagonals should be >0, but nowhere else in the matrix is this guaranteed, and moreover that's only if you've converged sufficiently closely to the minimum.