Re: [R] generating a random signal with a known correlation

2008-08-21 Thread Pedro.Rodriguez
] [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)?

Re: [R] generating a random signal with a known correlation

2008-08-12 Thread stephen sefick
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

Re: [R] generating a random signal with a known correlation

2008-08-11 Thread Yasir Kaheil
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

[R] generating a random signal with a known correlation

2008-08-11 Thread Yasir Kaheil
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-