[Robast-commits] r610 - in branches/robast-0.9/pkg/ROptEst: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Feb 16 15:57:53 CET 2013


Author: ruckdeschel
Date: 2013-02-16 15:57:53 +0100 (Sat, 16 Feb 2013)
New Revision: 610

Modified:
   branches/robast-0.9/pkg/ROptEst/R/internal.roptest.R
   branches/robast-0.9/pkg/ROptEst/R/roptest.new.R
   branches/robast-0.9/pkg/ROptEst/man/inputGenerator.Rd
   branches/robast-0.9/pkg/ROptEst/man/roptest.Rd
Log:
roptest (the new one) gains argument withMDE to skip call to MDE when starting estimator is robust anyway;
similarly genstartCtrl() gains optional argument withMDE

Modified: branches/robast-0.9/pkg/ROptEst/R/internal.roptest.R
===================================================================
--- branches/robast-0.9/pkg/ROptEst/R/internal.roptest.R	2013-02-16 14:36:01 UTC (rev 609)
+++ branches/robast-0.9/pkg/ROptEst/R/internal.roptest.R	2013-02-16 14:57:53 UTC (rev 610)
@@ -10,7 +10,7 @@
            nm0 <- names(matchCall)[match.i]
            if(!nm0 %in% names(form0)){
               es.call.0[[nm0]] <- if(is.call(matchCall[[match.i]])){
-                       dprint("HU");eval(matchCall[[match.i]])
+                       eval(matchCall[[match.i]])
                        }else matchCall[[match.i]]
               matchCall[[match.i]] <- NULL
            }else match.i <- match.i + 1
@@ -35,7 +35,7 @@
                   if(!is.null(form0[[form.i]])){
                       dprint(dum <- str(form0[[form.i]]))
                       xu <- if(is.call(form0[[form.i]])){
-                               dprint("HU1"); eval(form0[[form.i]])
+                               eval(form0[[form.i]])
                                }else form0[[form.i]]
                       if(!is.null(xu)) {dprint(xu)
                       matchCall[[nam0]] <- xu
@@ -107,13 +107,10 @@
    mc <- as.list(match.call(expand.dots=TRUE)[-1])
 
    eps <- eps.lower <- eps.upper <- NULL
-#   print(names(mc))
-#   lapply(mc, function(xx) print(str(xx)))
 
    ine <- is.null(mc[["eps"]]) || is.symbol(mc[["eps"]])
    inl <- is.null(mc[["eps.lower"]]) || is.symbol(mc[["eps.lower"]])
    inu <- is.null(mc[["eps.upper"]]) || is.symbol(mc[["eps.upper"]])
-#   print(c(ine=ine,inl=inl,inu=inu))
    if(ine && inl && inu){
         eps.lower <- 0
         eps.upper <- 0.5
@@ -224,7 +221,7 @@
  return(es.list)
 }
 genstartCtrl<- function(initial.est = NULL, initial.est.ArgList = NULL,
-                        startPar = NULL, distance = CvMDist){
+                        startPar = NULL, distance = CvMDist, withMDE = NULL){
   es.call <- match.call()
   es.list <- as.list(es.call[-1])
   es.list <- .fix.in.defaults(es.list,genstartCtrl)

Modified: branches/robast-0.9/pkg/ROptEst/R/roptest.new.R
===================================================================
--- branches/robast-0.9/pkg/ROptEst/R/roptest.new.R	2013-02-16 14:36:01 UTC (rev 609)
+++ branches/robast-0.9/pkg/ROptEst/R/roptest.new.R	2013-02-16 14:57:53 UTC (rev 610)
@@ -13,7 +13,7 @@
                     withPICList = getRobAStBaseOption("withPICList"),
                     na.rm = TRUE, initial.est.ArgList, ...,
                     withLogScale = TRUE,..withCheck=FALSE,
-                    withTimings = FALSE){
+                    withTimings = FALSE, withMDE = NULL){
     es.call <- match.call()
     es.call0 <- match.call(expand.dots=FALSE)
     mwt <- !is.null(es.call$withTimings)
@@ -66,7 +66,8 @@
                     nbCtrl = gennbCtrl(),
                     startCtrl = genstartCtrl(),
                     kStepCtrl = genkStepCtrl(),
-                    na.rm = TRUE, ..., debug = FALSE, withTimings = FALSE){
+                    na.rm = TRUE, ..., debug = FALSE,
+                    withTimings = FALSE){
 
     es.call <- match.call()
     es.call0 <- match.call(expand.dots=FALSE)
@@ -118,10 +119,19 @@
         startCtrl$initial.est <- "BLUB"
       }
     }else{
-      if(is.null(startCtrl$initial.est))
-         startCtrl$initial.est <- MDEstimator(x = x, ParamFamily = L2Fam,
+      if(is.null(startCtrl$initial.est)){
+         startPar0 <- if(is.null(startCtrl$startPar))
+                         L2Fam at startPar else startCtrl$startPar
+         wMDE <- if(is.null(startCtrl$withMDE))
+                         L2Fam at .withMDE else startCtrl$withMDE
+         if(is(startPar0, "function")) if(!wMDE){
+            startCtrl$initial.est <- function(x,...)startPar0(x)
+         }else
+            startCtrl$initial.est <- MDEstimator(x = x, ParamFamily = L2Fam,
                                   distance = startCtrl$distance,
                                   startPar = startCtrl$startPar, ...)
+
+      }
     }
     nrvalues <-  length(L2Fam at param)
 

Modified: branches/robast-0.9/pkg/ROptEst/man/inputGenerator.Rd
===================================================================
--- branches/robast-0.9/pkg/ROptEst/man/inputGenerator.Rd	2013-02-16 14:36:01 UTC (rev 609)
+++ branches/robast-0.9/pkg/ROptEst/man/inputGenerator.Rd	2013-02-16 14:57:53 UTC (rev 610)
@@ -15,7 +15,7 @@
                     withPICList = getRobAStBaseOption("withPICList"),
                     scalename = "scale", withLogScale = TRUE)
 genstartCtrl(initial.est = NULL, initial.est.ArgList = NULL,
-                        startPar = NULL, distance = CvMDist)
+                        startPar = NULL, distance = CvMDist, withMDE = NULL)
 gennbCtrl(neighbor = ContNeighborhood(), eps, eps.lower, eps.upper)
 }
 \arguments{
@@ -48,8 +48,13 @@
     in the multivariate case, \code{startPar} may also be of class \code{Estimate},
     in which case slot \code{untransformed.estimate} is used.}
   \item{distance}{ distance function }
+  \item{withMDE}{ logical or NULL: Shall a minimum distance estimator be used as
+       starting estimator in \code{roptest()} / \code{robest()}---in addition to
+       the function given in argument \code{startPar} of the current function
+       or, if the argument is \code{NULL}, in slot \code{startPar} of the L2
+       family? If \code{NULL} (default) the content of slot \code{.withMDE} in
+       the L2 family is used instead to take this decision.}
 
-
   \item{neighbor}{ object of class \code{"UncondNeighborhood"} }
   \item{eps}{ positive real (0 < \code{eps} <= 0.5): amount of gross errors.
           See details below. }

Modified: branches/robast-0.9/pkg/ROptEst/man/roptest.Rd
===================================================================
--- branches/robast-0.9/pkg/ROptEst/man/roptest.Rd	2013-02-16 14:36:01 UTC (rev 609)
+++ branches/robast-0.9/pkg/ROptEst/man/roptest.Rd	2013-02-16 14:57:53 UTC (rev 610)
@@ -17,7 +17,8 @@
         withICList = getRobAStBaseOption("withICList"),
         withPICList = getRobAStBaseOption("withPICList"),
         na.rm = TRUE, initial.est.ArgList, ...,
-        withLogScale = TRUE, ..withCheck = FALSE, withTimings = FALSE)
+        withLogScale = TRUE, ..withCheck = FALSE, withTimings = FALSE,
+        withMDE = NULL)
 roptest.old(x, L2Fam, eps, eps.lower, eps.upper, fsCor = 1, initial.est,
         neighbor = ContNeighborhood(), risk = asMSE(), steps = 1L,
         distance = CvMDist, startPar = NULL, verbose = NULL,
@@ -88,6 +89,11 @@
    timings for the three steps evaluating the starting value, finding
    the starting influence curve, and evaluating the k-step estimator is
    issued.}
+  \item{withMDE}{ logical or NULL: Shall a minimum distance estimator be used as
+       starting estimator---in addition to the function given in slot
+       \code{startPar} of the L2 family? If \code{NULL} (default) the content
+       of slot \code{.withMDE} in the L2 family is used instead to take
+       this decision.}
 }
 \details{
   Computes the optimally robust estimator for a given L2 differentiable



More information about the Robast-commits mailing list