] [mailto:[EMAIL PROTECTED]
On Behalf Of Yasir Kaheil
Sent: Monday, August 11, 2008 3:58 PM
To: r-help@r-project.org
Subject: [R] generating a random signal with a known correlation
Hi,
How can I generate a random signal that's correlated with a given signal
at
a given correlation (say 0.7)?
sowas package by douglas mauran. Type sowas into google.
On Tue, Aug 12, 2008 at 12:14 AM, Yasir Kaheil <[EMAIL PROTECTED]> wrote:
>
> OK, here is the code for those who are interested:
> x<-rnorm(1000, mean=20, sd=100);
> x.s<-scale(x)
> xp<-pnorm(x.s);
> xix<- sort(xp,index.return=TRUE)$ix
> no
OK, here is the code for those who are interested:
x<-rnorm(1000, mean=20, sd=100);
x.s<-scale(x)
xp<-pnorm(x.s);
xix<- sort(xp,index.return=TRUE)$ix
norm.cop <- normalCopula(0.6) #correlation of 0.6, other libraries can be
used instead of copula
y <- rcopula(norm.cop, length(x))
yp<-pnorm(y)
ypix
Hi,
How can I generate a random signal that's correlated with a given signal at
a given correlation (say 0.7)?
I've been looking at rmvnorm etc but don't seem to figure it out. Thanks
-
Yasir H. Kaheil
Columbia University
--
View this message in context:
http://www.nabble.com/generating-a-
4 matches
Mail list logo