Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
fminunc Hessian: good covariance matrix estimator?

Subject: fminunc Hessian: good covariance matrix estimator?

From: Luca

Date: 12 Apr, 2013 10:05:07

Message: 1 of 2

Hi everybody!

Now, I have this problem. I need to estimate the covariance matrix of the minimum of a chi^2 fitting. I'm using fminunc to minimize the objective function.
I have only 4 parameters, so a pretty easy task. (of course I've set "LargeScale" to off).
The minimization works perfectly.

Since I need the covariance matrix I was thinking about inverting the hessian given as an output by fminunc.
While googling I've found some guys saying that is not necessarily good to do so because the estimate might have some bias/problem/unpreciseness that might give a very bad covariance matrix estimate.
I didn't understand it very much, also because I'm not too much into optimization.
Can somebody expert tell me if it's good enough for what I have to do or, in case, which are the hypothesis under which it's not good anymore?

Subject: fminunc Hessian: good covariance matrix estimator?

From: Luca

Date: 12 Apr, 2013 15:19:07

Message: 2 of 2

I've tried comparing the hessian given by fminunc with two different others.
I tried multiplying the function jacobian with its transpose. (I expect it to be equal to the hessian in a chi^2 minimization problem, near the minimum).
If I take the ratio of this hessian to the fminunc one I get a matrix of ones, with a 0.1% agreement in the worst case, usually much better. And that's very fine.
(I've tried with the same fitting function but with independent datasets)

Then, suspecting that fminunc uses the same approximation, I also tried to estimate the hessian without approximations but using finite differences.
If I do so and compute the ratio of this hessian to one of the other two I get a matrix of values spread around 1.... (-20%,+50%!!!!)
Which is not fine!!
I wonder which method is correct now, as I know that computing second derivatives with finite differences is not trivial.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us