Re: [R] Using loop for a random vector (Montecarlo method)

2013-01-29 Thread mlell08
> # This assumes you have a parameter list which looks like this: > # l: list(n = c(5, 10, 20), > # a = c(0.1, 0.2, 0.3), > # E = c(5,10), > # L = c(0.01, 0.025, 1)) etc... > # > # > # indVec:c(n= 1, a=1, E=2, L=1) > # The function selects the approproate sub-list by the n

Re: [R] Using loop for a random vector (Montecarlo method)

2013-01-29 Thread mlell08
On 29.01.2013 13:10, mary wrote: > > Hi, > I've understand how to do a permutation matrix but how I can utilize it? > I would like to have a sample of 5 unit with rotation parameters! The same > with 10 unit or 20 unit... You could rewrite your tab function that is accepts a list with named entr

Re: [R] Using loop for a random vector (Montecarlo method)

2013-01-29 Thread mary
Hi, I've understand how to do a permutation matrix but how I can utilize it? I would like to have a sample of 5 unit with rotation parameters! The same with 10 unit or 20 unit... Thanks -- View this message in context: http://r.789695.n4.nabble.com/Using-loop-for-a-random-vector-Montecarlo-m

Re: [R] Using loop for a random vector (Montecarlo method)

2013-01-28 Thread mlell08
On 28.01.2013 12:06, mary wrote: > Hi, > > I would like to replicate a sort of Montecarlo experiment: > > I have to generate a random variable N(0,1) with 100 observations but I have > to contaminate this values at certain point in order to obtain different > vectors with different samples: Hi,

[R] Using loop for a random vector (Montecarlo method)

2013-01-28 Thread mary
Hi, I would like to replicate a sort of Montecarlo experiment: I have to generate a random variable N(0,1) with 100 observations but I have to contaminate this values at certain point in order to obtain different vectors with different samples: tab<-function(N,n,E,L){ for(i in 1:100){ X1<-rnorm(