[R] How to generate two dimensional random variable for normal distributed

Bernd Weiss bernd.weiss at uni-koeln.de
Thu May 17 09:15:44 CEST 2007


Am 16 May 2007 um 23:20 hat Patrick Wang geschrieben:

Date sent:      	Wed, 16 May 2007 23:20:25 -0700 (PDT)
From:           	"Patrick Wang" <pwang at berkeley.edu>
To:             	r-help at stat.math.ethz.ch
Subject:        	[R] How to generate two dimensional random variable 
for normal
	distributed

> Hi,
> 
> I can use runif to generate 1 dimensional random variables,
> 
> assume the dimesion of the random variable is 2, X(x1, x2), how do I
> generate the  2 dimensional random variable with normal distribution?

library(MASS)
?mvrnorm

HTH,

Bernd



More information about the R-help mailing list