[Robast-commits] r1155 - in branches/robast-1.2/pkg/RobAStBase: R inst man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Aug 16 20:20:34 CEST 2018


Author: ruckdeschel
Date: 2018-08-16 20:20:34 +0200 (Thu, 16 Aug 2018)
New Revision: 1155

Modified:
   branches/robast-1.2/pkg/RobAStBase/R/CheckMakeIC.R
   branches/robast-1.2/pkg/RobAStBase/R/kStepEstimator.R
   branches/robast-1.2/pkg/RobAStBase/inst/NEWS
   branches/robast-1.2/pkg/RobAStBase/man/kStepEstimator.Rd
Log:
[RobAStBase] branch 1.2
+ kStepEstimator, getboundedIC, getRiskIC for signature (IC, asCov, missing, L2ParamFamily),
  checkIC and makeIC gain argument diagnostic to be able to show diagnostic 
  information on integrations; this information (if argument "diagnostic" is TRUE)
  is stored in attribute "diagnostic" of the return value


Modified: branches/robast-1.2/pkg/RobAStBase/R/CheckMakeIC.R
===================================================================
--- branches/robast-1.2/pkg/RobAStBase/R/CheckMakeIC.R	2018-08-16 15:27:54 UTC (rev 1154)
+++ branches/robast-1.2/pkg/RobAStBase/R/CheckMakeIC.R	2018-08-16 18:20:34 UTC (rev 1155)
@@ -83,6 +83,9 @@
            print(attr(res$E.IC.L,"diagnostic"))
         }
 
+        if(diagnostic)
+           attr(prec,"diagnostic") <- c(attr(res$E.IC,"diagnostic"),
+                                        attr(res$E.IC.L,"diagnostic"))
         return(prec)
     })
 
@@ -124,14 +127,19 @@
 
         CallL2Fam <- L2Fam at fam.call
 
-        return(IC(name = name(IC),
+        IC.0 <- IC(name = name(IC),
                   Curve = EuclRandVarList(Y),
                   Risks = list(),
                   Infos=matrix(c("IC<-",
                                  "generated by affine linear trafo to enforce consistency"),
                                ncol=2, dimnames=list(character(0), c("method", "message"))),
                   CallL2Fam = CallL2Fam,
-                  modifyIC = modifyIC))
+                  modifyIC = modifyIC)
+
+        if(diagnostic)
+           attr(IC.0,"diagnostic") <- c(attr(res$E.IC,"diagnostic"),
+                                        attr(res$E.IC.L,"diagnostic"))
+        return(IC.0)
     })
 
 ## make some L2function a pIC at a model

Modified: branches/robast-1.2/pkg/RobAStBase/R/kStepEstimator.R
===================================================================
--- branches/robast-1.2/pkg/RobAStBase/R/kStepEstimator.R	2018-08-16 15:27:54 UTC (rev 1154)
+++ branches/robast-1.2/pkg/RobAStBase/R/kStepEstimator.R	2018-08-16 18:20:34 UTC (rev 1155)
@@ -55,7 +55,8 @@
                            withPICList = getRobAStBaseOption("withPICList"),
                            na.rm = TRUE, startArgList = NULL, ...,
                            withLogScale = TRUE, withEvalAsVar = TRUE,
-                           withMakeIC = FALSE, E.argList = NULL){
+                           withMakeIC = FALSE, E.argList = NULL,
+                           diagnostic = FALSE){
 
         time <- proc.time()
         on.exit(message("Timing stopped at: ", ppt(proc.time() - time)))
@@ -65,6 +66,11 @@
 
         if(is.null(E.argList)) E.argList <- list()
         if(is.null(E.argList$useApply)) E.argList$useApply <- FALSE
+        diagn <- NULL
+        if(diagnostic){
+           E.argList$diagnostic <- TRUE
+           diagn <- list()
+        }
         if(missing(IC.UpdateInKer)) IC.UpdateInKer <- NULL
 
 ## get some dimensions
@@ -185,15 +191,22 @@
 #                   print(L2Fam)
                    L2Fam <- modifyModel(L2Fam, Param,
                                .withL2derivDistr = L2Fam at .withEvalL2derivDistr)
-                   sytm <<- .addTime(sytm,paste("modifyModel-PreModif-",updStp))
-#                   print(L2Fam)
+                   mmPreNm <- paste("modifyModel-PreModif-",updStp)
+                   sytm <<- .addTime(sytm,mmPreNm)
+                   if(diagnostic) diagn[[mmPreNm]] <<- attr(L2Fam,"diagnostic")
+# print(L2Fam)
+
                    modifyICargs <- c(list(L2Fam, IC, withMakeIC = FALSE), E.argList)
                    IC <- do.call(modifyIC(IC),modifyICargs)
-                   sytm <<- .addTime(sytm,paste("modifyIC-PreModif-",updStp))
+                   mmPreICNm <- paste("modifyIC-PreModif-",updStp)
+                   sytm <<- .addTime(sytm,mmPreICNm)
+                   if(diagnostic) diagn[[mmPreICNm]] <<- attr(IC,"diagnostic")
                    if(steps==1L && withMakeIC){
                       makeICargs <- c(list(IC, L2Fam),E.argList)
                       IC <- do.call(makeIC, makeICargs)
-                      sytm <<- .addTime(sytm,paste("modifyIC-makeIC-",updStp))
+                      mmPreMkICNm <- paste("modifyIC-makeIC-",updStp)
+                      sytm <<- .addTime(sytm,mmPreMkICNm)
+                      if(diagnostic) diagn[[mmPreMkICNm]] <<- attr(IC,"diagnostic")
                     }
                 }
 
@@ -220,10 +233,14 @@
                             if(is.null(IC.UpdateInKer)){
                                  getBoundedICargs <- c(list(L2Fam, D = projker),E.argList)
                                  IC.tot2 <- do.call(getBoundedIC, getBoundedICargs)
-                                 sytm <<- .addTime(sytm,paste("getBoundedIC-",updStp))
+                                 mmgtBDICNm <- paste("getBoundedIC-",updStp)
+                                 sytm <<- .addTime(sytm,mmgtBDICNm)
+                                 if(diagnostic) diagn[[mmgtBDICNm]] <<- attr(IC.tot2,"diagnostic")
                             }else{
                                  IC.tot2 <- as(projker %*% IC.UpdateInKer at Curve, "EuclRandVariable")
-                                 sytm <<- .addTime(sytm,paste("IC.tot2<-as(projker...-",updStp))
+                                 mmgtAsPrICNm <- paste("IC.tot2<-as(projker...-",updStp)
+                                 sytm <<- .addTime(sytm,mmgtAsPrICNm)
+                                 if(diagnostic) diagn[[mmgtAsPrICNm]] <<- attr(IC.tot2,"diagnostic")
                             }
                             IC.tot2.isnull <- FALSE
                             IC.tot.0 <- IC.tot1 + IC.tot2
@@ -281,16 +298,24 @@
                                    L2F0 = L2Fam, IC0 = IC.tot.0, dim0 = k,
                                    dimn0 = list(cnms,cnms)))
                       sytm <<- .addTime(sytm,paste("u.var-",updStp))
-                      if(withEvalAsVar.0) u.var <- eval(u.var)
-                      sytm <<- .addTime(sytm,paste("u.var-eval-",updStp))
+                      if(withEvalAsVar.0){
+                         u.var <- eval(u.var)
+                         uvEvnm <- paste("u.var-eval-",updStp)
+                         sytm <<- .addTime(sytm,uvEvnm)
+                         if(diagnostic) diagn[[uvEvnm]] <<- attr(u.var,"diagnostic")
+                      }
                    }
                    if(!var.to.be.c){
                       var0 <- substitute(do.call(cfct, args = list(L2F0, IC0,
                                    dim0, dimn0)), list(cfct = cvar.fct,
                                    L2F0 = L2Fam, IC0 = IC.c, dim0 = p))
                       sytm <<- .addTime(sytm,paste("var0-",updStp))
-                      if(withEvalAsVar.0) var0 <- eval(var0)
-                      sytm <<- .addTime(sytm,paste("var0-eval-",updStp))
+                      if(withEvalAsVar.0) {
+                         var0 <- eval(var0)
+                         vEvnm <- paste("var0-eval-",updStp)
+                         sytm <<- .addTime(sytm,paste("var0-eval-",updStp))
+                         if(diagnostic) diagn[[vEvnm]] <<- attr(var0,"diagnostic")
+                      }
                    }
                 }
                 if(withPostModif){
@@ -298,10 +323,15 @@
                    if (lnx) nuisance(Param)[] <- .deleteDim(u.theta[nuis.idx])
                    L2Fam <- modifyModel(L2Fam, Param,
                                .withL2derivDistr = L2Fam at .withEvalL2derivDistr)
-                   sytm <<- .addTime(sytm,paste("modifyModel-PostModif-",updStp))
+                   mmPostNm <- paste("modifyModel-PostModif-",updStp)
+                   sytm <<- .addTime(sytm,mmPostNm)
+                   if(diagnostic) diagn[[mmPostNm]] <<- attr(L2Fam,"diagnostic")
+
                    modifyICargs <- c(list(L2Fam, IC, withMakeIC = withMakeIC), E.argList)
                    IC <- do.call(modifyIC(IC),modifyICargs)
-                   sytm <<- .addTime(sytm,paste("modifyIC-PostModif-",updStp))
+                   mmPostICNm <- paste("modifyIC-PostModif-",updStp)
+                   sytm <<- .addTime(sytm,mmPostICNm)
+                   if(diagnostic) diagn[[mmPostICNm]] <<- attr(IC,"diagnostic")
                 }
 
                 li <- list(IC = IC, Param = Param, L2Fam = L2Fam,
@@ -331,7 +361,9 @@
                   if((i==steps)&&withMakeIC){
                       makeICargs <- c(list(IC, L2Fam),E.argList)
                       IC <- do.call(makeIC, makeICargs)
-                      sytm <- .addTime(sytm,paste("makeIC-",i))
+                      mkICnm <- paste("makeIC-",i)
+                      sytm <- .addTime(sytm,mkICnm)
+                      if(diagnostic) diagn[[mkICnm]] <- attr(IC,"diagnostic")
                   }
 
                   Param <- upd$Param
@@ -372,7 +404,9 @@
               if(withMakeIC){
                   makeICargs <- c(list(IC, L2Fam),E.argList)
                   IC <- do.call(makeIC, makeICargs)
-                  sytm <- .addTime(sytm,"makeIC-useLast")
+                  mkICULnm <- paste("makeIC-useLast")
+                  sytm <- .addTime(sytm,mkICULnm)
+                  if(diagnostic) diagn[[mkICULnm]] <- attr(IC,"diagnostic")
               }
            }else{
               Infos <- rbind(Infos, c("kStepEstimator",
@@ -420,6 +454,7 @@
                 riskAsVar <- do.call(getRiskIC, getRiskICasVarArgs)
                 asVar <- riskAsVar$asCov$value
                 sytm <- .addTime(sytm,"getRiskIC-Var")
+                if(diagnostic) diagn[["getRiskICVar"]] <- attr(asVar,"diagnostic")
            }
 
         }else asVar <- var0
@@ -473,6 +508,7 @@
         estres <- .checkEstClassForParamFamily(L2Fam,estres)
 
         attr(estres,"timings") <- apply(sytm,2,diff)
+        if(diagnostic) attr(estres,"diagnostic") <- diagn
         on.exit()
         return(estres)
 

Modified: branches/robast-1.2/pkg/RobAStBase/inst/NEWS
===================================================================
--- branches/robast-1.2/pkg/RobAStBase/inst/NEWS	2018-08-16 15:27:54 UTC (rev 1154)
+++ branches/robast-1.2/pkg/RobAStBase/inst/NEWS	2018-08-16 18:20:34 UTC (rev 1155)
@@ -26,6 +26,10 @@
 + particular checkIC methods are now documented in documentation 
   object checkIC (and no longer with class IC); there argument out
   is documented
++ kStepEstimator, getboundedIC, getRiskIC for signature (IC, asCov, missing, L2ParamFamily),
+  checkIC and makeIC gain argument diagnostic to be able to show diagnostic 
+  information on integrations; this information (if argument "diagnostic" is TRUE)
+  is stored in attribute "diagnostic" of the return value
   
 bugfixes  
 + and a forgotten no longer used instance of oldmodif in kStepEstimator
@@ -93,9 +97,6 @@
   overwrites existing entries).
 + getboundedIC now uses coordinate-wise integration with useApply = FALSE and 
   only computing the upper half of E LL'w 
-+ getboundedIC, getRiskIC for signature (IC, asCov, missing, L2ParamFamily),
-  checkIC and makeIC gain argument diagnostic to be able to show diagnostic 
-  information on integrations
   
 #######################################
 version 1.1
@@ -128,7 +129,8 @@
 + getRiskIC and getBiasIC gain argument withCheck to speed up things if one does not want to call checkIC 
 + in kStepEstimator, withCheck is set to FALSE when getRiskIC is called, and makeIC is only called just 
   before the last update, and, if useLast == TRUE for the last update (of course, only if withMakeIC ==TRUE)
-
++ kStepEstimator, 
+  
 Return value of "roptest"
 + the return value of "roptest", an object of class "kStepEstimate" has a slot "estimate.call" which
   contains the (matched) call to "roptest"; internally "roptest" calls "robest"; the call to "robest"

Modified: branches/robast-1.2/pkg/RobAStBase/man/kStepEstimator.Rd
===================================================================
--- branches/robast-1.2/pkg/RobAStBase/man/kStepEstimator.Rd	2018-08-16 15:27:54 UTC (rev 1154)
+++ branches/robast-1.2/pkg/RobAStBase/man/kStepEstimator.Rd	2018-08-16 18:20:34 UTC (rev 1155)
@@ -14,7 +14,7 @@
       withPICList = getRobAStBaseOption("withPICList"),
       na.rm = TRUE, startArgList = NULL, ...,
       withLogScale = TRUE, withEvalAsVar = TRUE,
-      withMakeIC = FALSE, E.argList = NULL)
+      withMakeIC = FALSE, E.argList = NULL, diagnostic = FALSE)
 }
 \arguments{
   \item{x}{ sample }
@@ -56,6 +56,10 @@
         the items of argument list \code{E.argList} as named items to the argument
         lists, so in case of collisions the item of \code{E.argList} overwrites the
         existing one from \code{\dots}.}
+  \item{diagnostic}{ logical; if \code{TRUE},
+    diagnostic information on the performed integrations is gathered and
+    shipped out as an attribute \code{diagnostic} of the return value
+    of \code{kStepEstimator}. }
 }
 \details{
   Given an initial estimation \code{start}, a sample \code{x} 



More information about the Robast-commits mailing list