[Robast-commits] r287 - pkg/RobLoxBioC/inst/scripts

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Apr 20 14:58:51 CEST 2009


Author: stamats
Date: 2009-04-20 14:58:51 +0200 (Mon, 20 Apr 2009)
New Revision: 287

Modified:
   pkg/RobLoxBioC/inst/scripts/AffySimStudy.R
   pkg/RobLoxBioC/inst/scripts/AffySimStudyFunction.R
   pkg/RobLoxBioC/inst/scripts/AffymetrixExample.R
Log:
some updates

Modified: pkg/RobLoxBioC/inst/scripts/AffySimStudy.R
===================================================================
--- pkg/RobLoxBioC/inst/scripts/AffySimStudy.R	2009-04-18 15:06:02 UTC (rev 286)
+++ pkg/RobLoxBioC/inst/scripts/AffySimStudy.R	2009-04-20 12:58:51 UTC (rev 287)
@@ -34,28 +34,20 @@
 (res4 <- AffySimStudy(n = n, M = M, eps = eps, seed = seed, 
                      eps.lower = eps.lower, eps.upper = eps.upper, 
                      contD = contD, plot1 = FALSE, plot2 = FALSE, plot3 = FALSE))
-contD <- Norm(5, 1)
+contD <- Norm(10, 1)
 (res5 <- AffySimStudy(n = n, M = M, eps = eps, seed = seed, 
                      eps.lower = eps.lower, eps.upper = eps.upper, 
                      contD = contD, plot1 = FALSE, plot2 = FALSE, plot3 = FALSE))
-contD <- Norm(10, 1)
+contD <- Dirac(1.51)
 (res6 <- AffySimStudy(n = n, M = M, eps = eps, seed = seed, 
                      eps.lower = eps.lower, eps.upper = eps.upper, 
                      contD = contD, plot1 = FALSE, plot2 = FALSE, plot3 = FALSE))
-contD <- Norm(5, 9)
+contD <- Dirac(1000)
 (res7 <- AffySimStudy(n = n, M = M, eps = eps, seed = seed, 
                      eps.lower = eps.lower, eps.upper = eps.upper, 
                      contD = contD, plot1 = FALSE, plot2 = FALSE, plot3 = FALSE))
-contD <- Dirac(100)
-(res8 <- AffySimStudy(n = n, M = M, eps = eps, seed = seed, 
-                     eps.lower = eps.lower, eps.upper = eps.upper, 
-                     contD = contD, plot1 = FALSE, plot2 = FALSE, plot3 = FALSE))
-contD <- Dirac(1.51)
-(res9 <- AffySimStudy(n = n, M = M, eps = eps, seed = seed, 
-                     eps.lower = eps.lower, eps.upper = eps.upper, 
-                     contD = contD, plot1 = FALSE, plot2 = FALSE, plot3 = FALSE))
 
-eps <- 0.025
+eps <- 0.02
 contD <- Norm(0, 9)
 (res11 <- AffySimStudy(n = n, M = M, eps = eps, seed = seed, 
                      eps.lower = eps.lower, eps.upper = eps.upper, 
@@ -72,28 +64,20 @@
 (res14 <- AffySimStudy(n = n, M = M, eps = eps, seed = seed, 
                      eps.lower = eps.lower, eps.upper = eps.upper, 
                      contD = contD, plot1 = FALSE, plot2 = FALSE, plot3 = FALSE))
-contD <- Norm(5, 1)
+contD <- Norm(10, 1)
 (res15 <- AffySimStudy(n = n, M = M, eps = eps, seed = seed, 
                      eps.lower = eps.lower, eps.upper = eps.upper, 
                      contD = contD, plot1 = FALSE, plot2 = FALSE, plot3 = FALSE))
-contD <- Norm(10, 1)
+contD <- Dirac(1.51)
 (res16 <- AffySimStudy(n = n, M = M, eps = eps, seed = seed, 
                      eps.lower = eps.lower, eps.upper = eps.upper, 
                      contD = contD, plot1 = FALSE, plot2 = FALSE, plot3 = FALSE))
-contD <- Norm(5, 9)
+contD <- Dirac(1000)
 (res17 <- AffySimStudy(n = n, M = M, eps = eps, seed = seed, 
                      eps.lower = eps.lower, eps.upper = eps.upper, 
                      contD = contD, plot1 = FALSE, plot2 = FALSE, plot3 = FALSE))
-contD <- Dirac(100)
-(res18 <- AffySimStudy(n = n, M = M, eps = eps, seed = seed, 
-                     eps.lower = eps.lower, eps.upper = eps.upper, 
-                     contD = contD, plot1 = FALSE, plot2 = FALSE, plot3 = FALSE))
-contD <- Dirac(1.51)
-(res19 <- AffySimStudy(n = n, M = M, eps = eps, seed = seed, 
-                     eps.lower = eps.lower, eps.upper = eps.upper, 
-                     contD = contD, plot1 = FALSE, plot2 = FALSE, plot3 = FALSE))
 
-eps <- 0.05
+eps <- 0.04
 contD <- Norm(0, 9)
 (res21 <- AffySimStudy(n = n, M = M, eps = eps, seed = seed, 
                      eps.lower = eps.lower, eps.upper = eps.upper, 
@@ -110,23 +94,15 @@
 (res24 <- AffySimStudy(n = n, M = M, eps = eps, seed = seed, 
                      eps.lower = eps.lower, eps.upper = eps.upper, 
                      contD = contD, plot1 = FALSE, plot2 = FALSE, plot3 = FALSE))
-contD <- Norm(5, 1)
+contD <- Norm(10, 1)
 (res25 <- AffySimStudy(n = n, M = M, eps = eps, seed = seed, 
                      eps.lower = eps.lower, eps.upper = eps.upper, 
                      contD = contD, plot1 = FALSE, plot2 = FALSE, plot3 = FALSE))
-contD <- Norm(10, 1)
+contD <- Norm(1.51)
 (res26 <- AffySimStudy(n = n, M = M, eps = eps, seed = seed, 
                      eps.lower = eps.lower, eps.upper = eps.upper, 
                      contD = contD, plot1 = FALSE, plot2 = FALSE, plot3 = FALSE))
-contD <- Norm(5, 9)
+contD <- Dirac(1000)
 (res27 <- AffySimStudy(n = n, M = M, eps = eps, seed = seed, 
                      eps.lower = eps.lower, eps.upper = eps.upper, 
                      contD = contD, plot1 = FALSE, plot2 = FALSE, plot3 = FALSE))
-contD <- Dirac(100)
-(res28 <- AffySimStudy(n = n, M = M, eps = eps, seed = seed, 
-                     eps.lower = eps.lower, eps.upper = eps.upper, 
-                     contD = contD, plot1 = FALSE, plot2 = FALSE, plot3 = FALSE))
-contD <- Norm(1.51)
-(res29 <- AffySimStudy(n = n, M = M, eps = eps, seed = seed, 
-                     eps.lower = eps.lower, eps.upper = eps.upper, 
-                     contD = contD, plot1 = FALSE, plot2 = FALSE, plot3 = FALSE))

Modified: pkg/RobLoxBioC/inst/scripts/AffySimStudyFunction.R
===================================================================
--- pkg/RobLoxBioC/inst/scripts/AffySimStudyFunction.R	2009-04-18 15:06:02 UTC (rev 286)
+++ pkg/RobLoxBioC/inst/scripts/AffySimStudyFunction.R	2009-04-20 12:58:51 UTC (rev 287)
@@ -58,17 +58,13 @@
     Tukey <- cbind(Tukey, Mad)
 
     ## Radius-minimax estimator
-    RadMinmax1 <- estimate(rowRoblox(Mre, eps.lower = eps.lower, 
+    RadMinmax <- estimate(rowRoblox(Mre, eps.lower = eps.lower, 
                                     eps.upper = eps.upper, k = steps,
                                     fsCor = fsCor))
-    RadMinmax2 <- estimate(rowRoblox(Mre, sd = Mad, eps.lower = eps.lower, 
-                                    eps.upper = eps.upper, k = steps,
-                                    fsCor = fsCor))
-    RadMinmax2 <- cbind(RadMinmax2, Mad)
 
     if(plot3){
-        Ergebnis1 <- list(Mean, Median, Tukey[,1], RadMinmax1[,1], RadMinmax2[,1])
-        Ergebnis2 <- list(Sd, Mad, Tukey[,2], RadMinmax1[,2], RadMinmax2[,2])
+        Ergebnis1 <- list(Mean, Median, Tukey[,1], RadMinmax[,1])
+        Ergebnis2 <- list(Sd, Mad, Tukey[,2], RadMinmax[,2])
         myCol <- brewer.pal(4, "Dark2")
         if(plot1 || plot2) dev.new()
         layout(matrix(c(1, 1, 1, 1, 3, 2, 2, 2, 2, 3), ncol = 2))
@@ -78,7 +74,7 @@
         abline(h = 1)
         op <- par(mar = rep(2, 4))
         plot(c(0,1), c(1, 0), type = "n", axes = FALSE)
-        legend("center", c("ML", "Med/MAD", "biweight", "rmx", "rmx/MAD"),
+        legend("center", c("ML", "Med/MAD", "biweight", "rmx"),
                fill = myCol, ncol = 5, cex = 1.5)
         par(op)
     }
@@ -90,11 +86,12 @@
     ## Tukey
     MSE3.1 <- n*mean(Tukey[,1]^2)
     ## Radius-minimax
-    MSE4.1 <- n*mean(RadMinmax1[,1]^2)
-    MSE5.1 <- n*mean(RadMinmax2[,1]^2)
-    empMSE <- data.frame(ML = MSE1.1, Med = MSE2.1, Tukey = MSE3.1, 
-                         "rmx" = MSE4.1, "rmx1" = MSE5.1)
+    MSE4.1 <- n*mean(RadMinmax[,1]^2)
+    empMSE <- data.frame(ML = MSE1.1, Med = MSE2.1, Tukey = MSE3.1, "rmx" = MSE4.1)
     rownames(empMSE) <- "n x empMSE (loc)"
+    relMSE <- empMSE[1,]/empMSE[1,4]
+    empMSE <- rbind(empMSE, relMSE)
+    rownames(empMSE)[2] <- "relMSE (loc)"
 
     ## ML-estimator
     MSE1.2 <- n*mean((Sd-1)^2)
@@ -103,13 +100,18 @@
     ## Tukey
     MSE3.2 <- MSE2.2
     ## Radius-minimax
-    MSE4.2 <- n*mean((RadMinmax1[,2]-1)^2)
-    MSE5.2 <- n*mean((RadMinmax2[,2]-1)^2)
-    empMSE <- rbind(empMSE, c(MSE1.2, MSE2.2, MSE3.2, MSE4.2, MSE5.2))
-    rownames(empMSE)[2] <- "n x empMSE (scale)"
+    MSE4.2 <- n*mean((RadMinmax[,2]-1)^2)
+    empMSE <- rbind(empMSE, c(MSE1.2, MSE2.2, MSE3.2, MSE4.2))
+    rownames(empMSE)[3] <- "n x empMSE (scale)"
+    relMSE <- empMSE[3,]/empMSE[3,4]
+    empMSE <- rbind(empMSE, relMSE)
+    rownames(empMSE)[4] <- "relMSE (scale)"
     empMSE <- rbind(empMSE, c(MSE1.1 + MSE1.2, MSE2.1 + MSE2.2, MSE3.1 + MSE3.2, 
-                              MSE4.1 + MSE4.2, MSE5.1 + MSE5.2))
-    rownames(empMSE)[3] <- "n x empMSE (loc + scale)"
+                              MSE4.1 + MSE4.2))
+    rownames(empMSE)[5] <- "n x empMSE (loc + scale)"
+    relMSE <- empMSE[5,]/empMSE[5,4]
+    empMSE <- rbind(empMSE, relMSE)
+    rownames(empMSE)[6] <- "relMSE (loc + scale)"
 
     empMSE
 }

Modified: pkg/RobLoxBioC/inst/scripts/AffymetrixExample.R
===================================================================
--- pkg/RobLoxBioC/inst/scripts/AffymetrixExample.R	2009-04-18 15:06:02 UTC (rev 286)
+++ pkg/RobLoxBioC/inst/scripts/AffymetrixExample.R	2009-04-20 12:58:51 UTC (rev 287)
@@ -162,8 +162,8 @@
 dev.off()
 
 ## Comparison of median distances
-abs(sapply(res1, median) - sapply(res3, median))
-abs(sapply(res2, median) - sapply(res3, median)[-c(1,2,4,7)])
+round(sapply(res1, median) - sapply(res3, median), 4)
+round(sapply(res2, median) - sapply(res3, median)[-c(1,2,4,7)], 4)
 
 
 ###########################################################



More information about the Robast-commits mailing list