Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

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

From |
Cyrus Levy <levy.cyrus@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
st: how to calculate variance covariance matrix in ml program |

Date |
Sun, 17 Feb 2013 08:20:15 -0600 |

capture program drop myprog program myprog version 11 args todo b lnf tempvar xb lnsigv2 lnsigu2 mleval `xb' = `b', eq(1) mleval `lnsigv2' = `b', eq(2) mleval `lnsigu2' = `b', eq(3) tempvar sigs2 epsilon lambda quietly gen double `sigs2' = exp(`lnsigv2') + exp(`lnsigu2') quietly gen double `epsilon' = $ML_y1 - `xb' quietly gen double `lambda' = sqrt( exp(`lnsigu2')/exp(`lnsigv2') ) mlsum `lnf' = 0.5 * ln(2/_pi) - ln(sqrt(`sigs2')) /*

end ml model d0 myprog (main: y = x1 x2) (lnsig2u: s1) (lnsig2v: s2) ml max * * 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/

- Prev by Date:
**Re: st: Need help with regular expression** - Next by Date:
**Re: st: mlogit problem** - Previous by thread:
**st: mlogit problem** - Next by thread:
**st: Need help sorting values** - Index(es):