[Robast-commits] r147 - branches/robast-0.6/pkg/RobLox/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Aug 6 15:42:14 CEST 2008


Author: stamats
Date: 2008-08-06 15:42:14 +0200 (Wed, 06 Aug 2008)
New Revision: 147

Modified:
   branches/robast-0.6/pkg/RobLox/R/rlOptIC.R
   branches/robast-0.6/pkg/RobLox/R/rlsOptIC_AL.R
   branches/robast-0.6/pkg/RobLox/R/roblox.R
   branches/robast-0.6/pkg/RobLox/R/rsOptIC.R
Log:
adaption to new implementation of L2ParamFamily and subclasses

Modified: branches/robast-0.6/pkg/RobLox/R/rlOptIC.R
===================================================================
--- branches/robast-0.6/pkg/RobLox/R/rlOptIC.R	2008-08-06 13:41:27 UTC (rev 146)
+++ branches/robast-0.6/pkg/RobLox/R/rlOptIC.R	2008-08-06 13:42:14 UTC (rev 147)
@@ -19,19 +19,18 @@
                                normW = NormType())
 
         modIC <- function(L2Fam, IC){
-#            if(is(L2Fam, "L2LocationFamily") && is(distribution(L2Fam), "Norm")){
-            if(is(distribution(L2Fam), "Norm")){
-                CallL2New <- call("NormLocationFamily", 
-                                  mean = main(L2Fam))
-                CallL2Fam(IC) <- CallL2New
+            if(is(L2Fam, "L2LocationFamily") && is(distribution(L2Fam), "Norm")){
+                CallL2Fam(IC) <- L2Fam at fam.call
                 return(IC)
             }else{
-                stop("'L2Fam' is not compatible with 'CallL2Fam' of 'IC'!")
+                makeIC(IC, L2Fam)
             }
         }
 
+        L2Fam <- substitute(NormLocationFamily(mean = m1, sd = s1), 
+                            list(m1 = mean, s1 = sd))
         return(generateIC(neighbor = ContNeighborhood(radius = r), 
-                    L2Fam = NormLocationFamily(mean = mean, sd = sd), 
+                    L2Fam = eval(L2Fam), 
                     res = list(A = as.matrix(A), a = 0, b = b, d = NULL, 
                                risk = list(asMSE = A, asBias = b, asCov = A - r^2*b^2), 
                                info = c("rlOptIC", "optimally robust IC for AL estimators and 'asMSE'"),

Modified: branches/robast-0.6/pkg/RobLox/R/rlsOptIC_AL.R
===================================================================
--- branches/robast-0.6/pkg/RobLox/R/rlsOptIC_AL.R	2008-08-06 13:41:27 UTC (rev 146)
+++ branches/robast-0.6/pkg/RobLox/R/rlsOptIC_AL.R	2008-08-06 13:42:14 UTC (rev 147)
@@ -159,8 +159,7 @@
 
         modIC <- function(L2Fam, IC){
             ICL2Fam <- eval(CallL2Fam(IC))
-#            if(is(L2Fam, "L2LocationScaleFamily") && is(distribution(L2Fam), "Norm")){
-            if(is(distribution(L2Fam), "Norm")){
+            if(is(L2Fam, "L2LocationScaleFamily") && is(distribution(L2Fam), "Norm")){
                 sdneu <- main(L2Fam)[2]
                 sdalt <- main(ICL2Fam)[2]
                 w <- weight(IC)
@@ -190,12 +189,14 @@
                 addInfo(IC) <- c("modifyIC", "The entries in 'Infos' may be wrong")
                 return(IC)
             }else{
-                stop("'L2Fam' is not compatible with 'CallL2Fam' of 'IC'!")
+                makeIC(IC, L2Fam)
             }
         }
 
+        L2Fam <- substitute(NormLocationScaleFamily(mean = m1, sd = s1), 
+                            list(m1 = mean, s1 = sd))
         return(generateIC(neighbor = ContNeighborhood(radius = r), 
-                    L2Fam = NormLocationScaleFamily(mean = mean, sd = sd), 
+                    L2Fam = eval(L2Fam), 
                     res = list(A = as.matrix(A), a = a, b = b, d = NULL, 
                                risk = list(asMSE = mse, asBias = b, trAsCov = mse - r^2*b^2,
                                            asCov = asVar), 

Modified: branches/robast-0.6/pkg/RobLox/R/roblox.R
===================================================================
--- branches/robast-0.6/pkg/RobLox/R/roblox.R	2008-08-06 13:41:27 UTC (rev 146)
+++ branches/robast-0.6/pkg/RobLox/R/roblox.R	2008-08-06 13:42:14 UTC (rev 147)
@@ -298,8 +298,10 @@
                         stop("'L2Fam' is not compatible with 'CallL2Fam' of 'IC'!")
                     }
                 }
+                L2Fam <- substitute(NormLocationScaleFamily(mean = m1, sd = s1), 
+                                    list(m1 = robEst$est[1], s1 = robEst$est[2]))
                 IC1 <- generateIC(neighbor = ContNeighborhood(radius = r), 
-                                  L2Fam = NormLocationScaleFamily(mean = robEst$est[1], sd = robEst$est[2]), 
+                                  L2Fam = eval(L2Fam), 
                                   res = list(A = diag(c(robEst$A1, robEst$A2)), a = robEst$a, 
                                       b = robEst$b, d = NULL, 
                                       risk = list(asMSE = mse, asBias = robEst$b, 
@@ -406,8 +408,10 @@
                         stop("'L2Fam' is not compatible with 'CallL2Fam' of 'IC'!")
                     }
                 }
+                L2Fam <- substitute(NormLocationScaleFamily(mean = m1, sd = s1), 
+                                    list(m1 = robEst$est[1], s1 = robEst$est[2]))
                 IC1 <- generateIC(neighbor = ContNeighborhood(radius = r), 
-                                  L2Fam = NormLocationScaleFamily(mean = robEst$est[1], sd = robEst$est[2]), 
+                                  L2Fam = eval(L2Fam), 
                                   res = list(A = diag(c(robEst$A1, robEst$A2)), a = robEst$a, 
                                       b = robEst$b, d = NULL, 
                                       risk = list(asMSE = mse, asBias = robEst$b, 
@@ -480,8 +484,10 @@
                             stop("'L2Fam' is not compatible with 'CallL2Fam' of 'IC'!")
                         }
                     }
+                    L2Fam <- substitute(NormLocationFamily(mean = m1, sd = s1), 
+                                        list(m1 = robEst, s1 = sd))
                     IC1 <- generateIC(neighbor = ContNeighborhood(radius = r), 
-                                      L2Fam = NormLocationFamily(mean = robEst, sd = sd), 
+                                      L2Fam = eval(L2Fam), 
                                       res = list(A = as.matrix(A), a = 0, b = b, d = NULL, 
                                           risk = list(asMSE = A, asBias = b, asCov = A-r^2*b^2), 
                                           info = c("roblox", "optimally robust IC for AL estimators and 'asMSE'"),
@@ -550,8 +556,10 @@
                             stop("'L2Fam' is not compatible with 'CallL2Fam' of 'IC'!")
                         }
                     }
+                    L2Fam <- substitute(NormLocationFamily(mean = m1, sd = s1), 
+                                        list(m1 = robEst, s1 = sd))
                     IC1 <- generateIC(neighbor = ContNeighborhood(radius = r), 
-                                      L2Fam = NormLocationFamily(mean = robEst, sd = sd), 
+                                      L2Fam = eval(L2Fam), 
                                       res = list(A = as.matrix(A), a = 0, b = b, d = NULL, 
                                           risk = list(asMSE = A, asBias = b, asCov = A-r^2*b^2), 
                                           info = c("roblox", "optimally robust IC for AL estimators and 'asMSE'"),
@@ -645,8 +653,10 @@
                             stop("'L2Fam' is not compatible with 'CallL2Fam' of 'IC'!")
                         }
                     }
+                    L2Fam <- substitute(NormScaleFamily(mean = m1, sd = s1), 
+                                        list(m1 = mean, s1 = robEst$est))
                     IC1 <- generateIC(neighbor = ContNeighborhood(radius = r), 
-                                      L2Fam = NormScaleFamily(mean = mean, sd = robEst$est), 
+                                      L2Fam = eval(L2Fam), 
                                       res = list(A = as.matrix(robEst$A), a = robEst$a, b = robEst$b, d = NULL, 
                                           risk = list(asMSE = robEst$A, asBias = robEst$b, 
                                                       asCov = robEst$A-r^2*robEst$b^2), 
@@ -737,8 +747,10 @@
                             stop("'L2Fam' is not compatible with 'CallL2Fam' of 'IC'!")
                         }
                     }
+                    L2Fam <- substitute(NormScaleFamily(mean = m1, sd = s1), 
+                                        list(m1 = mean, s1 = robEst$est))
                     IC1 <- generateIC(neighbor = ContNeighborhood(radius = r), 
-                                      L2Fam = NormScaleFamily(mean = mean, sd = robEst$est), 
+                                      L2Fam = eval(L2Fam), 
                                       res = list(A = as.matrix(robEst$A), a = robEst$a, b = robEst$b, d = NULL, 
                                           risk = list(asMSE = robEst$A, asBias = robEst$b, 
                                                       asCov = robEst$A-r^2*robEst$b^2), 

Modified: branches/robast-0.6/pkg/RobLox/R/rsOptIC.R
===================================================================
--- branches/robast-0.6/pkg/RobLox/R/rsOptIC.R	2008-08-06 13:41:27 UTC (rev 146)
+++ branches/robast-0.6/pkg/RobLox/R/rsOptIC.R	2008-08-06 13:42:14 UTC (rev 147)
@@ -72,8 +72,7 @@
 
         modIC <- function(L2Fam, IC){
             ICL2Fam <- eval(CallL2Fam(IC))
-#            if(is(L2Fam, "L2ScaleFamily") && is(distribution(L2Fam), "Norm")){
-            if(is(distribution(L2Fam), "Norm")){
+            if(is(L2Fam, "L2ScaleFamily") && is(distribution(L2Fam), "Norm")){
                 sdneu <- main(L2Fam)
                 sdalt <- main(ICL2Fam)
                 w <- weight(IC)
@@ -96,12 +95,14 @@
                 addInfo(IC) <- c("modifyIC", "The entries in 'Infos' may be wrong")
                 return(IC)
             }else{
-                stop("'L2Fam' is not compatible with 'CallL2Fam' of 'IC'!")
+                makeIC(IC, L2Fam)
             }
         }
 
+        L2Fam <- substitute(NormLocationFamily(mean = m1, sd = s1), 
+                            list(m1 = mean, s1 = sd))
         return(generateIC(neighbor = ContNeighborhood(radius = r), 
-                    L2Fam = NormScaleFamily(sd = sd, mean = mean), 
+                    L2Fam = eval(L2Fam), 
                     res = list(A = as.matrix(A), a = a, b = b, d = NULL, 
                                risk = list(asMSE = A, asBias = b, asCov = A - r^2*b^2), 
                                info = c("rlOptIC", "optimally robust IC for AL estimators and 'asMSE'"),



More information about the Robast-commits mailing list