[Robast-commits] r292 - pkg/RobLoxBioC/inst/scripts
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Apr 21 18:50:26 CEST 2009
Author: stamats
Date: 2009-04-21 18:50:26 +0200 (Tue, 21 Apr 2009)
New Revision: 292
Modified:
pkg/RobLoxBioC/inst/scripts/AffySimStudyFunction.R
Log:
forgot to include correction for 50% or more outliers
Modified: pkg/RobLoxBioC/inst/scripts/AffySimStudyFunction.R
===================================================================
--- pkg/RobLoxBioC/inst/scripts/AffySimStudyFunction.R 2009-04-21 10:01:21 UTC (rev 291)
+++ pkg/RobLoxBioC/inst/scripts/AffySimStudyFunction.R 2009-04-21 16:50:26 UTC (rev 292)
@@ -35,7 +35,18 @@
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
+ while(any(ind)){
+ M1 <- sum(ind)
+ cat("Samples to re-simulate:\t", M1, "\n")
+ r <- 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
+ }
+
if(plot2){
library(lattice)
ind <- sample(1:M, 20)
More information about the Robast-commits
mailing list