[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

From |
"Michael Anthony Carlton" <carlto12@msu.edu> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
RE: st: gradient for each observation from ml |

Date |
Sat, 19 Jul 2008 08:52:22 -0400 |

Unfortunately the multivariate normal does not have a closed form for the CDF, so I am using the mdraws, mvnp plug-in from Capalleri and Jenkins (2006). This is an lf method, and I know for certain that Stata calculates the OPG for each observation before summing it and displaying the variance matrix...I am just not sure how to get it to print these observation level OPGs either into the dataset or a matrix. There has to be a simple way to get these since it is a necessary calculation in the estimation of the ml problem. -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Stas Kolenikov Sent: Friday, July 18, 2008 1:21 PM To: statalist@hsphsun2.harvard.edu Subject: Re: st: gradient for each observation from ml If you are coding this as -d1- or -d2- method, you have to code the derivatives, anyway. If you are using -lf-, then there should be some technical temporary variables created by Stata, but you should not mess with them (I tried for some of my projects, and it never worked as intended). You might want to switch to Mata and -optimize- where a lot of things come more naturally in terms of matrix computations. On 7/18/08, Michael Anthony Carlton <carlto12@msu.edu> wrote: > Does anyone know if there is a way to get the calculated gradient (or outer > product of the gradient) for each observation used in an ml command? I am > estimating a multivariate fractional response model where the first step is > to estimate a multivariate "probit" for each time period and the second step > is to estimate the final parameters using minimum distance. I need to use > the observation level OPG to estimate the correlation between time periods > in order to create the optimal weighting matrix for the MD estimation. -- Stas Kolenikov, also found at http://stas.kolenikov.name Small print: Please do not reply to my Gmail address as I don't check it regularly. * * 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/ * * 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/

**References**:**st: gradient for each observation from ml***From:*"Michael Anthony Carlton" <carlto12@msu.edu>

**Re: st: gradient for each observation from ml***From:*"Stas Kolenikov" <skolenik@gmail.com>

- Prev by Date:
**RE: st: Command related to putting categories into separate columns** - Next by Date:
**Re: st: adding a variable to a macro** - Previous by thread:
**Re: st: gradient for each observation from ml** - Next by thread:
**st: transposing data set** - Index(es):

© Copyright 1996–2017 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |