[R] simulated correlated vectors

Karl Ove Hufthammer karl at huftis.org
Fri Nov 13 09:10:46 CET 2009

On Thu, 12 Nov 2009 08:10:12 -0800 (PST) carol white <wht_crl at yahoo.com> 
> Having a vector x of float type without any assumption of its distribution 
> (mean, variance etc), how to generate another vector that is 
> correlated with x?

Define an arbitrary function 'f', where 'f' may have a random component, 
and calculate f(x).

> Extensibility: how to simulate more than two correlated vectors (again 
> float type and no preference for their distribution and without having 
> vector x)?

Repeat step 1 several times. If you don't have 'x', define an arbitrary 
vector 'x' first ...


Karl Ove Hufthammer

More information about the R-help mailing list