[R] random number generator
Prof Brian Ripley
ripley at stats.ox.ac.uk
Tue Nov 28 15:36:57 CET 2000
> Date: Tue, 28 Nov 2000 14:23:46 +0000
> From: AHMED MAMI <amami at ma.man.ac.uk>
> I have an inquire about the RNG in R
(I don't think so: this is nothing to do with the `random number generator'.)
> It is known that when we use the " rnorm " function , we pass the
> arguments :
> 1- number of variables to be generated
> 2- mean vector of the normal random errors.
> 3- standard deviation vector of the normal random errors.
> my question is the following
> Is the a way (a function) in R that we could specify the covariance
> matrix in step 3, instead of the
> standard deviation vector of the normal random errors, since we want to
> generate multivariate
> correlated random data.
Perhpas, you do, but you don't use rnorm for that. Try mvrnorm in
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272860 (secr)
Oxford OX1 3TG, UK Fax: +44 1865 272595
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
More information about the R-help