[Robast-commits] r819 - branches/robast-1.0/pkg/RobLox/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun May 3 15:29:47 CEST 2015


Author: stamats
Date: 2015-05-03 15:29:47 +0200 (Sun, 03 May 2015)
New Revision: 819

Modified:
   branches/robast-1.0/pkg/RobLox/R/showdown.R
Log:
minor modification of code to avoid ambiguities

Modified: branches/robast-1.0/pkg/RobLox/R/showdown.R
===================================================================
--- branches/robast-1.0/pkg/RobLox/R/showdown.R	2015-05-03 13:28:56 UTC (rev 818)
+++ branches/robast-1.0/pkg/RobLox/R/showdown.R	2015-05-03 13:29:47 UTC (rev 819)
@@ -20,21 +20,21 @@
     }
 
     set.seed(seed)
-    r <- rbinom(n*M, prob = eps, size = 1)
+    rad <- rbinom(n*M, prob = eps, size = 1)
     Mid <- rnorm(n*M)
     Mcont <- r(contD)(n*M)
-    Mre <- matrix((1-r)*Mid + r*Mcont, ncol = n)
-    ind <- rowSums(matrix(r, ncol = n)) >= n/2
+    Mre <- matrix((1-rad)*Mid + rad*Mcont, ncol = n)
+    ind <- rowSums(matrix(rad, ncol = n)) >= n/2
     while(any(ind)){
         M1 <- sum(ind)
         cat("Samples to re-simulate:\t", M1, "\n")
-        r <- rbinom(n*M1, prob = eps, size = 1)
+        rad <- rbinom(n*M1, prob = eps, size = 1)
         Mid <- rnorm(n*M1)
         Mcont <- r(contD)(n*M1)
-        Mre[ind,] <- (1-r)*Mid + r*Mcont
-        ind[ind] <- rowSums(matrix(r, ncol = n)) >= n/2
+        Mre[ind,] <- (1-rad)*Mid + rad*Mcont
+        ind[ind] <- rowSums(matrix(rad, ncol = n)) >= n/2
     }
-    rm(Mid, Mcont, r, ind)
+    rm(Mid, Mcont, rad, ind)
 
 
     if(plot2){



More information about the Robast-commits mailing list