[R] Uncorrelated random vectors

Moshe Olshansky m_olshansky at yahoo.com
Wed Jul 8 05:10:25 CEST 2009


As mentioned by somebody before, there is no problem for the normal case - use mvrnorm function from MASS package with any mu and make Sigma be any diagonal matrix (with strictly positive diagonal). Note that even though all the correlations are 0, the SAMPLE correlations won't be 0. If you want to create a set of vectors whose SAMPLE correlations are 0 you will have to use a variant of Gramm-Schmidt.
I do not know whether a variant of mvrnorm exists for logistic distribution (my guess is that it does not).

--- On Tue, 7/7/09, Stein, Luba (AIM SE) <LUBA.STEIN at allianz.com> wrote:

> From: Stein, Luba (AIM SE) <LUBA.STEIN at allianz.com>
> Subject: [R] Uncorrelated random vectors
> To: "r-help at r-project.org" <r-help at r-project.org>
> Received: Tuesday, 7 July, 2009, 11:45 PM
> Hello,
> 
> is it possible to create two uncorrelated random vectors
> for a given distribution.
> 
> In fact, I would like to have something like the function
> "rnorm" or "rlogis" with the extra property that they are
> uncorrelated.
> 
> Thanks for your help,
> Luba
> 
> 
> 
> 
>     [[alternative HTML version deleted]]
> 
> ______________________________________________
> 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.
>




More information about the R-help mailing list