Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Mata : getting covariance matrix with optimize()


From   Gordon Hughes <[email protected]>
To   [email protected]
Subject   Re: st: Mata : getting covariance matrix with optimize()
Date   Tue, 08 Mar 2011 20:57:15 +0000

You haven't provided sufficient information for readers to answer your question properly. For example:

1. What kind of function are you optimizing? I assume that it is a likelihood function, but are you relying upon numerical or analytical gradients & Hessian?

2. When you say that Mata does not compute the covariance matrix, what are you expecting it to do?

If you use -optimize_result_Hessian(S)- after the optimization is complete, this should return the value of the Hessian at the converged values of the parameters. This is available even if gradients and the Hessian are calculated numerically, but it is, of course, only an approximation in that case. There is no reason why this would fail to work with weights, since the Hessian of log-likelihood is perfectly well defined with or without weights.

Or, have you been relying upon -optimize_result_V with or without _oim, etc? I find it safer to work with the Hessian and it is possible that these functions may not work with weights, though I would be surprised at this.

Gordon Hughes
[email protected]

=============================

Hi all,

I sent a message a couple of weeks ago but have no answer.
I am using mata and the optimize function to estimate a model.

I try to use the Gauss Newton Algorithm to optimize my objective function. This works well. The problem is that mata does not compute the covariance matrix.

I had a look to ado files and it seems that since I specifyed a matrix of weights, stata automatically gives a zero matrix as the covariance matrix.

Can you tell me why is it so? Is there a way to ask stata/mata to compute the covariance matrix or do I have to compute it "by hand"?

Thanks;
Maxime

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index