Re: [R] Random walk

2010-05-11 Thread Sergio Andrés Estay Cabrera
28095 0.7144861 0.6932104 0.7061211 0.6781331 0.6898726 0.6926878 [15] 0.6949656 0.6995899 0.7524582 0.6912938 0.6931928 0.6820243 Best, Giovanni On Mon, 2010-05-10 at 14:55 -0400, Sergio Andrés Estay Cabrera wrote: Dear R users and specially Albyn and Giovanni, thanks for your answers, but in fact I

Re: [R] Random walk

2010-05-10 Thread Sergio Andrés Estay Cabrera
,] 1.000 0.4909281 [2,] 0.4909281 1.000 So, unless you meant that you want the _sample_ correlation to be pre-specified, you are all set. albyn On Sun, May 09, 2010 at 09:20:25PM -0400, Sergio Andrés Estay Cabrera wrote: Hi everybody, I am trying to generate two random walks with an sp

[R] Random walk

2010-05-09 Thread Sergio Andrés Estay Cabrera
Hi everybody, I am trying to generate two random walks with an specific correlation, for example, two random walks of 200 time steps with a correlation 0.7. I built the random walks with: x<-cumsum(rnorm(200, mean=0,sd=1)) y<-cumsum(rnorm(200, mean=0,sd=1)) but I don't know how to fix the c