[Robast-commits] r1125 - in branches/robast-1.2/pkg: ROptEstOld/inst ROptRegTS/R ROptRegTS/inst

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Aug 11 16:53:01 CEST 2018


Author: ruckdeschel
Date: 2018-08-11 16:53:01 +0200 (Sat, 11 Aug 2018)
New Revision: 1125

Modified:
   branches/robast-1.2/pkg/ROptEstOld/inst/NEWS
   branches/robast-1.2/pkg/ROptRegTS/R/Av2CondContIC.R
   branches/robast-1.2/pkg/ROptRegTS/R/getAsRiskRegTS.R
   branches/robast-1.2/pkg/ROptRegTS/R/getIneffDiff.R
   branches/robast-1.2/pkg/ROptRegTS/R/getInfRobRegTypeIC_asBias.R
   branches/robast-1.2/pkg/ROptRegTS/R/getInfRobRegTypeIC_asCov.R
   branches/robast-1.2/pkg/ROptRegTS/R/getInfRobRegTypeIC_asGRisk_c2.R
   branches/robast-1.2/pkg/ROptRegTS/R/getInfStandRegTS.R
   branches/robast-1.2/pkg/ROptRegTS/R/leastFavorableRadius.R
   branches/robast-1.2/pkg/ROptRegTS/R/optIC.R
   branches/robast-1.2/pkg/ROptRegTS/R/radiusMinimaxIC.R
   branches/robast-1.2/pkg/ROptRegTS/inst/NEWS
Log:
[ROptRegTS] branch 1.2 
+ now specified that we want to use distr::solve
(and updated NEWS in ROptEstOld) 


Modified: branches/robast-1.2/pkg/ROptEstOld/inst/NEWS
===================================================================
--- branches/robast-1.2/pkg/ROptEstOld/inst/NEWS	2018-08-11 14:46:52 UTC (rev 1124)
+++ branches/robast-1.2/pkg/ROptEstOld/inst/NEWS	2018-08-11 14:53:01 UTC (rev 1125)
@@ -8,6 +8,13 @@
  information)
 
 #######################################
+version 1.2
+#######################################
+
+under the hood
++ now specified that we want to use distr::solve
+
+#######################################
 version 1.1
 #######################################
 

Modified: branches/robast-1.2/pkg/ROptRegTS/R/Av2CondContIC.R
===================================================================
--- branches/robast-1.2/pkg/ROptRegTS/R/Av2CondContIC.R	2018-08-11 14:46:52 UTC (rev 1124)
+++ branches/robast-1.2/pkg/ROptRegTS/R/Av2CondContIC.R	2018-08-11 14:53:01 UTC (rev 1125)
@@ -29,7 +29,7 @@
         ICfct <- vector(mode = "list", length = 1)
         L2 <- L2Fam at ErrorL2deriv[[1]]
         k <- dimension(img(L2Fam at RegDistr))
-        K.inv <- solve(E(L2Fam at RegDistr, fun = function(x){ x %*% t(x) }))
+        K.inv <- distr::solve(E(L2Fam at RegDistr, fun = function(x){ x %*% t(x) }))
         trafo <- L2Fam at param@trafo
 
         if(!is.null(d)){

Modified: branches/robast-1.2/pkg/ROptRegTS/R/getAsRiskRegTS.R
===================================================================
--- branches/robast-1.2/pkg/ROptRegTS/R/getAsRiskRegTS.R	2018-08-11 14:46:52 UTC (rev 1124)
+++ branches/robast-1.2/pkg/ROptRegTS/R/getAsRiskRegTS.R	2018-08-11 14:53:01 UTC (rev 1125)
@@ -19,7 +19,7 @@
         if(!is.finite(neighbor at radius))
             return(list(asMSE = Inf))
         else{
-            K.inv <- solve(E(Regressor, fun = function(x){ x %*% t(x) }))
+            K.inv <- distr::solve(E(Regressor, fun = function(x){ x %*% t(x) }))
             return(list(asMSE = stand * sum(diag(t(trafo) %*% K.inv))))
         }
     })
@@ -178,7 +178,7 @@
         K <- E(Regressor, fun = function(x){ x %*% t(x) })
         z <- q.l(ErrorL2deriv)(0.5)
         Eu <- E(ErrorL2deriv, function(x, z){abs(x - z)}, z = z)
-        b <- sqrt(sum(diag(trafo %*% solve(K) %*% t(trafo))))/Eu
+        b <- sqrt(sum(diag(trafo %*% distr::solve(K) %*% t(trafo))))/Eu
         
         return(list(asBias = b))        
     })

Modified: branches/robast-1.2/pkg/ROptRegTS/R/getIneffDiff.R
===================================================================
--- branches/robast-1.2/pkg/ROptRegTS/R/getIneffDiff.R	2018-08-11 14:46:52 UTC (rev 1124)
+++ branches/robast-1.2/pkg/ROptRegTS/R/getIneffDiff.R	2018-08-11 14:53:01 UTC (rev 1125)
@@ -90,7 +90,7 @@
                         trafo = L2Fam at param@trafo, upper = upper.b, maxiter = MaxIter, 
                         tol = eps, warn = warn)
             trafo <- L2Fam at param@trafo
-            K.inv <- solve(E(L2Fam at RegDistr, fun = function(x){ x %*% t(x) }))
+            K.inv <- distr::solve(E(L2Fam at RegDistr, fun = function(x){ x %*% t(x) }))
             ineffLo <- (res$A*sum(diag(t(trafo) %*% K.inv)) - res$b^2*(radius^2-loRad^2))/loRisk
             if(upRad == Inf)
                 ineffUp <- res$b^2/upRisk

Modified: branches/robast-1.2/pkg/ROptRegTS/R/getInfRobRegTypeIC_asBias.R
===================================================================
--- branches/robast-1.2/pkg/ROptRegTS/R/getInfRobRegTypeIC_asBias.R	2018-08-11 14:46:52 UTC (rev 1124)
+++ branches/robast-1.2/pkg/ROptRegTS/R/getInfRobRegTypeIC_asBias.R	2018-08-11 14:53:01 UTC (rev 1125)
@@ -114,7 +114,7 @@
         K <- E(Regressor, fun = function(x){ x %*% t(x) })
         z <- q.l(ErrorL2deriv)(0.5)
         Eu <- E(ErrorL2deriv, function(x, z){abs(x - z)}, z = z)
-        b <- sqrt(sum(diag(trafo %*% solve(K) %*% t(trafo))))/Eu
+        b <- sqrt(sum(diag(trafo %*% distr::solve(K) %*% t(trafo))))/Eu
         
         if(is(ErrorL2deriv, "AbscontDistribution")){
             ws0 <- 0

Modified: branches/robast-1.2/pkg/ROptRegTS/R/getInfRobRegTypeIC_asCov.R
===================================================================
--- branches/robast-1.2/pkg/ROptRegTS/R/getInfRobRegTypeIC_asCov.R	2018-08-11 14:46:52 UTC (rev 1124)
+++ branches/robast-1.2/pkg/ROptRegTS/R/getInfRobRegTypeIC_asCov.R	2018-08-11 14:53:01 UTC (rev 1125)
@@ -8,7 +8,7 @@
     function(ErrorL2deriv, Regressor, risk, neighbor, ErrorL2derivDistrSymm, 
              RegSymm, Finfo, trafo){
             info <- c("optimal IC in sense of Cramer-Rao bound")
-            A <- trafo %*% solve(Finfo)
+            A <- trafo %*% distr::solve(Finfo)
             b <- max(abs(as.vector(A)))*max(q.l(ErrorL2deriv)(1),abs(q.l(ErrorL2deriv)(0)))
             if(is(Regressor, "UnivariateDistribution"))
                 b <- b*max(abs(q.l(Regressor)(1)), abs(q.l(Regressor)(0)))
@@ -24,7 +24,7 @@
     function(ErrorL2deriv, Regressor, risk, neighbor, ErrorL2derivDistrSymm, 
              RegSymm, Finfo, trafo){
             info <- c("optimal IC in sense of Cramer-Rao bound")
-            A <- trafo %*% solve(Finfo)
+            A <- trafo %*% distr::solve(Finfo)
             b <- abs(as.vector(A))*(q.l(ErrorL2deriv)(1) - q.l(ErrorL2deriv)(0))
             b <- b*(abs(q.l(Regressor)(1)) + abs(q.l(Regressor)(0)))
             Risk <- list(asCov = A %*% t(trafo), asBias = b)
@@ -38,7 +38,7 @@
     function(ErrorL2deriv, Regressor, risk, neighbor, ErrorL2derivDistrSymm, 
              RegSymm, Finfo, trafo){
             info <- c("optimal IC in sense of Cramer-Rao bound")
-            A <- trafo %*% solve(Finfo)
+            A <- trafo %*% distr::solve(Finfo)
             b <- max(abs(as.vector(A)))*max(q.l(ErrorL2deriv)(1),abs(q.l(ErrorL2deriv)(0)))
             if(is(Regressor, "UnivariateDistribution"))
                 b <- b*max(abs(q.l(Regressor)(1)), abs(q.l(Regressor)(0)))
@@ -57,7 +57,7 @@
     function(ErrorL2deriv, Regressor, risk, neighbor, ErrorL2derivDistrSymm, 
              RegSymm, Finfo, trafo){
             info <- c("optimal IC in sense of Cramer-Rao bound")
-            A <- trafo %*% solve(Finfo)
+            A <- trafo %*% distr::solve(Finfo)
             b <- abs(as.vector(A))*(q.l(ErrorL2deriv)(1) - q.l(ErrorL2deriv)(0))
             if(is(Regressor, "UnivariateDistribution"))
                 b <- b*(abs(q.l(Regressor)(1)) + abs(q.l(Regressor)(0)))
@@ -80,7 +80,7 @@
     function(ErrorL2deriv, Regressor, risk, neighbor, ErrorL2derivDistrSymm, 
              RegSymm, Finfo, trafo){
             info <- c("optimal IC in sense of Cramer-Rao bound")
-            A <- trafo %*% solve(Finfo)
+            A <- trafo %*% distr::solve(Finfo)
             b <- max(abs(as.vector(A)))*max(q.l(ErrorL2deriv)(1),abs(q.l(ErrorL2deriv)(0)))
             if(is(Regressor, "UnivariateDistribution"))
                 b <- b*max(abs(q.l(Regressor)(1)), abs(q.l(Regressor)(0)))
@@ -100,7 +100,7 @@
     function(ErrorL2deriv, Regressor, risk, neighbor, ErrorL2derivDistrSymm, 
              RegSymm, Finfo, trafo){
             info <- c("optimal IC in sense of Cramer-Rao bound")
-            A <- trafo %*% solve(Finfo)
+            A <- trafo %*% distr::solve(Finfo)
             b <- max(abs(as.vector(A)))*max(q.l(ErrorL2deriv)(1),abs(q.l(ErrorL2deriv)(0)))
             if(is(Regressor, "UnivariateDistribution"))
                 b <- b*max(abs(q.l(Regressor)(1)), abs(q.l(Regressor)(0)))
@@ -115,7 +115,7 @@
     function(ErrorL2deriv, Regressor, risk, neighbor, ErrorL2derivDistrSymm, 
              RegSymm, Finfo, trafo){
             info <- c("optimal IC in sense of Cramer-Rao bound")
-            A <- trafo %*% solve(Finfo)
+            A <- trafo %*% distr::solve(Finfo)
             b <- max(abs(as.vector(A)))*abs(q.l(ErrorL2deriv)(1) - q.l(ErrorL2deriv)(0))
             if(is(Regressor, "UnivariateDistribution"))
                 b <- b*(q.l(Regressor)(1) - q.l(Regressor)(0))
@@ -132,7 +132,7 @@
                                           neighbor = "ContNeighborhood"),
     function(ErrorL2deriv, Regressor, risk, neighbor, ErrorDistr, Finfo, trafo){
             info <- c("optimal IC in sense of Cramer-Rao bound")
-            A <- trafo %*% solve(Finfo)
+            A <- trafo %*% distr::solve(Finfo)
 
             if(is(ErrorDistr, "UnivariateDistribution")){
                 lower <- ifelse(is.finite(q.l(ErrorDistr)(0)), q.l(ErrorDistr)(1e-8), q.l(ErrorDistr)(0))
@@ -155,7 +155,7 @@
                                           neighbor = "Av1CondContNeighborhood"),
     function(ErrorL2deriv, Regressor, risk, neighbor, ErrorDistr, Finfo, trafo){
             info <- c("optimal IC in sense of Cramer-Rao bound")
-            A <- trafo %*% solve(Finfo)
+            A <- trafo %*% distr::solve(Finfo)
 
             if(is(ErrorDistr, "UnivariateDistribution")){
                 lower <- ifelse(is.finite(q.l(ErrorDistr)(0)), q.l(ErrorDistr)(1e-8), q.l(ErrorDistr)(0))

Modified: branches/robast-1.2/pkg/ROptRegTS/R/getInfRobRegTypeIC_asGRisk_c2.R
===================================================================
--- branches/robast-1.2/pkg/ROptRegTS/R/getInfRobRegTypeIC_asGRisk_c2.R	2018-08-11 14:46:52 UTC (rev 1124)
+++ branches/robast-1.2/pkg/ROptRegTS/R/getInfRobRegTypeIC_asGRisk_c2.R	2018-08-11 14:53:01 UTC (rev 1125)
@@ -72,7 +72,7 @@
         A <- getInfStandRegTS(ErrorL2deriv = ErrorL2deriv, Regressor = Regressor,
                     neighbor = neighbor, z.comp = z.comp, clip = c0, cent = z, 
                     stand = A, trafo = trafo)
-        b <- c0*A*sqrt(sum(diag(solve(E(Regressor, fun = function(x){ x %*% t(x) })))))
+        b <- c0*A*sqrt(sum(diag(distr::solve(E(Regressor, fun = function(x){ x %*% t(x) })))))
         
         info <- paste("optimally robust IC for", sQuote(class(risk)[1]))
         Risk <- getAsRiskRegTS(risk = risk, ErrorL2deriv = ErrorL2deriv, 

Modified: branches/robast-1.2/pkg/ROptRegTS/R/getInfStandRegTS.R
===================================================================
--- branches/robast-1.2/pkg/ROptRegTS/R/getInfStandRegTS.R	2018-08-11 14:46:52 UTC (rev 1124)
+++ branches/robast-1.2/pkg/ROptRegTS/R/getInfStandRegTS.R	2018-08-11 14:53:01 UTC (rev 1125)
@@ -92,7 +92,7 @@
             res <- E(Regressor, Afct, clip = clip, stand = stand, D1 = ErrorL2deriv)
         }
 
-        return(trafo %*% solve(res))
+        return(trafo %*% distr::solve(res))
     })
 setMethod("getInfStandRegTS", signature(ErrorL2deriv = "UnivariateDistribution",
                                         Regressor = "UnivariateDistribution", 
@@ -142,7 +142,7 @@
             res <- E(Regressor, Afct, clip = clip, stand = stand, D1 = ErrorL2deriv)
         }
 
-        return(trafo %*% solve(res))
+        return(trafo %*% distr::solve(res))
     })
 setMethod("getInfStandRegTS", signature(ErrorL2deriv = "UnivariateDistribution",
                                         Regressor = "Distribution", 
@@ -180,7 +180,7 @@
 
             return((x %*% t(x))*(m2df(D1, cx) - m2df(D1, gx) + gx*m1df(D1, gx) - cx*m1df(D1, cx)))
         }
-        return(trafo %*% solve(E(Regressor, Afct, cent = cent, clip = clip, 
+        return(trafo %*% distr::solve(E(Regressor, Afct, cent = cent, clip = clip,
                                  stand = stand, D1 = ErrorL2deriv)))
     })
 setMethod("getInfStandRegTS", signature(ErrorL2deriv = "RealRandVariable",
@@ -263,7 +263,7 @@
             }
         res[col(res) < row(res)] <- res[col(res) > row(res)]
 
-        return(trafo %*% solve(res))
+        return(trafo %*% distr::solve(res))
     })
 setMethod("getInfStandRegTS", signature(ErrorL2deriv = "RealRandVariable",
                                         Regressor = "Distribution", 
@@ -334,5 +334,5 @@
             }
         res[col(res) < row(res)] <- res[col(res) > row(res)]
 
-        return(trafo %*% solve(res))
+        return(trafo %*% distr::solve(res))
     })

Modified: branches/robast-1.2/pkg/ROptRegTS/R/leastFavorableRadius.R
===================================================================
--- branches/robast-1.2/pkg/ROptRegTS/R/leastFavorableRadius.R	2018-08-11 14:46:52 UTC (rev 1124)
+++ branches/robast-1.2/pkg/ROptRegTS/R/leastFavorableRadius.R	2018-08-11 14:53:01 UTC (rev 1125)
@@ -122,7 +122,7 @@
                     trafo <- L2Fam at param@trafo
                     if(identical(all.equal(loRad, 0), TRUE)){
                         loRad <- 0
-                        loRisk <- sum(diag(solve(L2Fam at FisherInfo)))
+                        loRisk <- sum(diag(distr::solve(L2Fam at FisherInfo)))
                     }else{
                         neighbor at radius <- loRad
                         resLo <- getInfRobRegTypeIC(ErrorL2deriv = ErrorL2deriv, 

Modified: branches/robast-1.2/pkg/ROptRegTS/R/optIC.R
===================================================================
--- branches/robast-1.2/pkg/ROptRegTS/R/optIC.R	2018-08-11 14:46:52 UTC (rev 1124)
+++ branches/robast-1.2/pkg/ROptRegTS/R/optIC.R	2018-08-11 14:53:01 UTC (rev 1125)
@@ -3,7 +3,7 @@
 ###############################################################################
 setMethod("optIC", signature(model = "L2RegTypeFamily", risk = "asCov"),
     function(model, risk){
-        Curve <- as((model at param@trafo %*% solve(model at FisherInfo)) %*% model at L2deriv, "EuclRandVariable")
+        Curve <- as((model at param@trafo %*% distr::solve(model at FisherInfo)) %*% model at L2deriv, "EuclRandVariable")
         return(IC(
             name = paste("Classical optimal influence curve for", model at name), 
             CallL2Fam = call("L2RegTypeFamily", 
@@ -24,7 +24,7 @@
                             ErrorL2derivDistrSymm = model at ErrorL2derivDistrSymm,
                             FisherInfo = model at FisherInfo),
             Curve = EuclRandVarList(Curve), 
-            Risks = list(asCov = model at param@trafo %*% solve(model at FisherInfo) %*% t(model at param@trafo)),
+            Risks = list(asCov = model at param@trafo %*% distr::solve(model at FisherInfo) %*% t(model at param@trafo)),
             Infos = matrix(c("optIC", "optimal IC in sense of Cramer-Rao bound"), 
                         ncol = 2, dimnames = list(character(0), c("method", "message")))))
     })

Modified: branches/robast-1.2/pkg/ROptRegTS/R/radiusMinimaxIC.R
===================================================================
--- branches/robast-1.2/pkg/ROptRegTS/R/radiusMinimaxIC.R	2018-08-11 14:46:52 UTC (rev 1124)
+++ branches/robast-1.2/pkg/ROptRegTS/R/radiusMinimaxIC.R	2018-08-11 14:53:01 UTC (rev 1125)
@@ -26,7 +26,7 @@
 
             if(identical(all.equal(loRad, 0), TRUE)){
                 loRad <- 0
-                loRisk <- sum(diag(solve(L2Fam at FisherInfo)))
+                loRisk <- sum(diag(distr::solve(L2Fam at FisherInfo)))
             }else{
                 neighbor at radius <- loRad
                 resLo <- getInfRobRegTypeIC(ErrorL2deriv = L2Fam at ErrorL2derivDistr[[1]], 
@@ -118,7 +118,7 @@
 
                 if(identical(all.equal(loRad, 0), TRUE)){
                     loRad <- 0
-                    loRisk <- sum(diag(solve(L2Fam at FisherInfo)))
+                    loRisk <- sum(diag(distr::solve(L2Fam at FisherInfo)))
                 }else{
                     neighbor at radius <- loRad
                     resLo <- getInfRobRegTypeIC(ErrorL2deriv = ErrorL2deriv, 

Modified: branches/robast-1.2/pkg/ROptRegTS/inst/NEWS
===================================================================
--- branches/robast-1.2/pkg/ROptRegTS/inst/NEWS	2018-08-11 14:46:52 UTC (rev 1124)
+++ branches/robast-1.2/pkg/ROptRegTS/inst/NEWS	2018-08-11 14:53:01 UTC (rev 1125)
@@ -7,6 +7,13 @@
  to ease updating "depends" information)
 
 #######################################
+version 1.2
+#######################################
+
+under the hood
++ now specified that we want to use distr::solve
+
+#######################################
 version 1.1
 #######################################
 



More information about the Robast-commits mailing list