search for: simr

Displaying 2 results from an estimated 2 matches for "simr".

Did you mean: simd
2003 Sep 24
1
Problem using C random generator called from R
...When values are returned to R, they are not in [0,1]. A simple C program using drand48() gives values in [0,1] so I suppose there is a problem (type definition ?) between C and R. Here are R and C function and an example. # R function simulC <- function(n) { dyn.load("test.so") simR <- runif(n) simC <- .C("test", as.integer(n), res=double(n))$res out <- list(simR=simR,simC=simC) out } // C function void test(int *n,double *res) { int i; for(i=0;i<*n;i++) {res[i] = drand48();} } # Result of x <- simulC(5) > x $simR [1] 0.39...
2011 Feb 19
2
reading simulations
Hi to all the people (again), I'm doing some simulations with the memisc package of an own function, but I've the problem that I didn't know how to read the result of such simulations. My function is: > Torre<-function(a1,N1,a2,N2) + {Etorre<-(a1*N1)/(1+a1*N1) + Efuera<-(a2*N2)/(1+a2*N2) + if(Etorre>Efuera)Subir=TRUE + if (Etorre<Efuera)Subir=FALSE +