Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: Putting a multivariate normal draw into a matrix?


From   Nick Chandler-Klein <nickck@uw.edu>
To   statalist <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Putting a multivariate normal draw into a matrix?
Date   Tue, 7 May 2013 03:02:05 -0700

This looks like it will work. Thank you!

On Tue, 7 May 2013 09:29:01, Maarten Buis wrote:

>What about this:
>
>*------------------ begin example ------------------
>mata:
>
>V = 1, .2 \ .2, 1
>
>A = cholesky(V)
>draw= rnormal(10000,2,0,1)
>draw = (A*draw')'
>
>end
*
*   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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index