```Date: Fri, 22 Sep 2000 14:45:39 -0400 Reply-To: Baskin_R Sender: "SAS(r) Discussion" From: Baskin_R Subject: Re: random number generation from of a multivariate normal distri bution Comments: To: "SAS-L (E-mail)" Content-Type: text/plain; charset="iso-8859-1" >Date: Fri, 22 Sep 2000 17:19:37 GMT >From: Isabelle Auger >Subject: random number generation from of a multivariate normal distribution > >Hi! > >I need a SAS program (or an algorithm) that generate random numbers from a >multivariate normal distribution and I would like to be able to specify a >matrix of covariance. Anyone know a WEB site or an article that talk about >this? Or anyone have the program to do that? > >Thank you >Isabelle > on sas-l archives there are several emails on this, but in response to an earlier question on generating multivariate normals: >In article , Wen Xu > wrote: > >> Hi, Does anyone have codes for generating some random vectors with >> a specified multivariate normal distribution ? > > >The following is from Khattree and Naik's APPLIED MULTIVARIATE STATISTICS >WITH SAS SOFTWARE, (publ. no. 55234), p. 21. A prose description of the >program's example appears on pages 13-14. Hope this helps. > >/* Program 1.3 */ > > title 'Output 1.3: Multivariate Normal Sample'; > /*Generate n random vector from a p dimensional population with > mean mu and the covariance matrix sigma */ > > options ls = 76 nodate nonumber; > proc iml ; > seed = 549065467 ; > n = 4 ; > sigma = { 4 2 1, > 2 3 1, > 1 1 5 }; > > > mu = {1, 3, 0}; > p = nrow(sigma); > m = repeat(mu`,n,1) ; > g =inv(root(sigma)) ; > z =normal(repeat(seed,n,p)) ; > y = z*g + m ; > print y ; > run; > >-- >****************************** >Jon Wainwright >LBJ School of Public Affairs >University of Texas at Austin >e-mail: jsw@mail.utexas.edu >****************************** > ```

Back to: Top of message | Previous page | Main SAS-L page