[R] help about random generation of a Normal distribution of several variables

Peng Jiang jp021 at sjtu.edu.cn
Sat Jul 5 18:41:38 CEST 2008


Hi, Arnau,

  mvrnorm() in MASS library is what you need.
  ? mvrnorm to see the detail but first you need to load the MASS  
library, i.e,library(MASS)
  regards/
On 2008-7-6, at 上午12:21, Arnau Mir wrote:

> Hello.
>
> Somebody knows how can I generate a set of n random vectors  of a  
> normal
> distribution of several variables?
> For example, I want to generate n=100 random vectors of two  
> dimensions for
> a normal with mean c(0,1)  and  variance matrix:  matrix(c(2,1,1,3), 
> 2,2).
>
> Thanks in advance,
>
> Arnau.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-----------------------------------------------
Peng Jiang 江鹏 ,Ph.D. Candidate
Antai College of Economics & Management
安泰经济管理学院
Department of Mathematics
数学系
Shanghai Jiaotong University (Minhang Campus)
800 Dongchuan Road
200240 Shanghai
P. R. China



More information about the R-help mailing list