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

Re: st: Recovering Jacobian from gmm estimate

 From "Brian P. Poi" <[email protected]> To [email protected] Subject Re: st: Recovering Jacobian from gmm estimate Date Fri, 04 Oct 2013 13:30:53 -0500

```On 10/04/2013 10:52 AM, Tony Stata wrote:
```
```Hello everyone,

To calculate the asymptotic variance of the gmm estimate, Stata
numerically calculates the Jacobian matrix (unless the analytic
derivatives are supplied manually). What is the best way to recover
this matrix and store it locally?

(i) For reference, I'm referring to the G_bar(Beta_hat) matrix in
equation 5 in the gmm section of the Stata Reference Manual (Release
12)

(ii) It would be possible to numerically calculate the Jacobian after
estimation, but that could be computationally costly, and Stata has
already done that computation, so it would be nice to avoid that
redundancy

(iii) From what I can tell, all the other matrices in the asymptotic
variance calculation are being saved in e() by gmm: e(W) is the weight
matrix, e(S) is the moment var-cov matrix, and e(V) is the parameter
var-cov matrix, but I can't find the Jacobian

Thanks!
```
```
Tony,

Although not documented, you can get the final G matrix in the saved results.  It is stored as e(G).  Note that this matrix does not have the row and column names set.  We'll get this added to the documentation in a future update.

Here's a silly example:

. sysuse auto
. gmm (mpg - {b0} - {b1}*gear), inst(gear turn head) onestep vce(unadj)
. mat G = e(G)
. mat W = e(W)
. mat V = invsym(G'*W*G) / 74     /* N = 74 observations */
. di sqrt(V[1,1])
3.5392953
. di sqrt(V[2,2])
1.1609056

-- Brian Poi
-- [email protected]

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