[Robast-commits] r81 - pkg/ROptEst/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Mar 28 12:36:49 CET 2008


Author: ruckdeschel
Date: 2008-03-28 12:36:49 +0100 (Fri, 28 Mar 2008)
New Revision: 81

Modified:
   pkg/ROptEst/R/getAsRisk.R
   pkg/ROptEst/R/getInfRobIC_asGRisk.R
Log:
changed the formula asMSE = tr A D' to
asMSE = tr M A D'  
for M = unit matrix by default, and else 
if a quadratic form is used as norm (as in self- / information standardization) M is this quadratic form

Modified: pkg/ROptEst/R/getAsRisk.R
===================================================================
--- pkg/ROptEst/R/getAsRisk.R	2008-03-28 02:21:40 UTC (rev 80)
+++ pkg/ROptEst/R/getAsRisk.R	2008-03-28 11:36:49 UTC (rev 81)
@@ -20,8 +20,13 @@
     function(risk, L2deriv, neighbor, biastype, clip = NULL, cent = NULL, stand, trafo){
         if(!is.finite(neighbor at radius))
             mse <- Inf
-        else
-            mse <- sum(diag(stand %*% t(trafo)))
+        else{
+            p <- nrow(trafo)
+            std <- if(is(normtype(risk),"QFNorm")) 
+                      QuadForm(normtype(risk)) else diag(p)
+                        
+            mse <- sum(diag( std %*% stand %*% t(trafo)))
+        }
         return(list(asMSE = mse))
     })
 

Modified: pkg/ROptEst/R/getInfRobIC_asGRisk.R
===================================================================
--- pkg/ROptEst/R/getInfRobIC_asGRisk.R	2008-03-28 02:21:40 UTC (rev 80)
+++ pkg/ROptEst/R/getInfRobIC_asGRisk.R	2008-03-28 11:36:49 UTC (rev 81)
@@ -203,10 +203,8 @@
                                 z.start = z.start, A.start = A.start, trafo = trafo, 
                                 maxiter = maxiter, tol = tol)
                 Risk <- getAsRisk(risk = risk, L2deriv = L2deriv, neighbor = neighbor, 
-                                  biastype = biastype, Distr = Distr,  
-                                  cent = res$a, stand = res$A, 
-                                  V.comp =  matrix(TRUE, ncol = nrow(res$A), 
-                                            nrow = nrow(res$A)), w = res$w)
+                                  biastype = biastype, clip = NULL,   
+                                  cent = res$a, stand = res$A, trafo = trafo)
                 res$risk <- c(Risk, res$risk)
                 return(res)
             }



More information about the Robast-commits mailing list