search for: permpar

Displaying 1 result from an estimated 1 matches for "permpar".

Did you mean: perma
2013 Jan 28
1
Using loop for a random vector (Montecarlo method)
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(N*(1-a),0,1) X2<-rnorm(N*(a),E,L) X_tab<-sample(c(X1,X2),n,replace=T) } return(X_tab)}