[Robast-commits] r1019 - in branches/robast-1.1/pkg/RobAStBase: R inst man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Jul 22 18:43:20 CEST 2018


Author: ruckdeschel
Date: 2018-07-22 18:43:20 +0200 (Sun, 22 Jul 2018)
New Revision: 1019

Modified:
   branches/robast-1.1/pkg/RobAStBase/R/kStepEstimator.R
   branches/robast-1.1/pkg/RobAStBase/R/oneStepEstimator.R
   branches/robast-1.1/pkg/RobAStBase/R/optIC.R
   branches/robast-1.1/pkg/RobAStBase/inst/NEWS
   branches/robast-1.1/pkg/RobAStBase/man/kStepEstimator.Rd
   branches/robast-1.1/pkg/RobAStBase/man/oneStepEstimator.Rd
   branches/robast-1.1/pkg/RobAStBase/man/optIC.Rd
Log:
[RobAStBase] branch 1.1 
  + oneStepEstimator and kStepEstimator gain an argument withMakeIC
  + optIC gains an argument withMakeIC

Modified: branches/robast-1.1/pkg/RobAStBase/R/kStepEstimator.R
===================================================================
--- branches/robast-1.1/pkg/RobAStBase/R/kStepEstimator.R	2018-07-22 11:41:27 UTC (rev 1018)
+++ branches/robast-1.1/pkg/RobAStBase/R/kStepEstimator.R	2018-07-22 16:43:20 UTC (rev 1019)
@@ -12,7 +12,8 @@
                            withICList = getRobAStBaseOption("withICList"),
                            withPICList = getRobAStBaseOption("withPICList"),
                            na.rm = TRUE, startArgList = NULL, ...,
-                           withLogScale = TRUE, withEvalAsVar = TRUE){
+                           withLogScale = TRUE, withEvalAsVar = TRUE,
+                           withMakeIC = FALSE){
 
         if(missing(IC.UpdateInKer)) IC.UpdateInKer <- NULL
 ## save call
@@ -235,6 +236,11 @@
                if(i>1){
                   IC <- upd$IC
                   L2Fam <- upd$L2Fam
+                  modif.old <- modifyIC(IC)
+                  if((i==steps)&&withMakeIC){
+                     IC <- makeIC(IC,L2Fam)
+                     IC at modifyIC <- modif.old
+                  }
                   Param <- upd$Param
                   tf <- trafo(L2Fam, Param)
                   withPre <- FALSE

Modified: branches/robast-1.1/pkg/RobAStBase/R/oneStepEstimator.R
===================================================================
--- branches/robast-1.1/pkg/RobAStBase/R/oneStepEstimator.R	2018-07-22 11:41:27 UTC (rev 1018)
+++ branches/robast-1.1/pkg/RobAStBase/R/oneStepEstimator.R	2018-07-22 16:43:20 UTC (rev 1019)
@@ -6,7 +6,7 @@
                              useLast = getRobAStBaseOption("kStepUseLast"),
                              withUpdateInKer = getRobAStBaseOption("withUpdateInKer"),
                              IC.UpdateInKer = getRobAStBaseOption("IC.UpdateInKer"),
-                             na.rm = TRUE, startArgList = NULL, ...){
+                             na.rm = TRUE, startArgList = NULL, withMakeIC = FALSE, ...){
         es.call <- match.call()
         es.call[[1]] <- as.name("oneStepEstimator")
 
@@ -17,7 +17,7 @@
             erg <- kStepEstimator(x = x, IC = IC, start = start, steps = 1L,
                            useLast = useLast, withUpdateInKer = withUpdateInKer,
                            IC.UpdateInKer = IC.UpdateInKer, na.rm = na.rm,
-                           startArgList = startArgList, ...)
+                           startArgList = startArgList, withMakeIC = withMakeIC, ...)
             Infos(erg) <- gsub("kStep","oneStep", Infos(erg))
             erg at estimate.call <- es.call
             return(erg)

Modified: branches/robast-1.1/pkg/RobAStBase/R/optIC.R
===================================================================
--- branches/robast-1.1/pkg/RobAStBase/R/optIC.R	2018-07-22 11:41:27 UTC (rev 1018)
+++ branches/robast-1.1/pkg/RobAStBase/R/optIC.R	2018-07-22 16:43:20 UTC (rev 1019)
@@ -2,19 +2,21 @@
 ## Classical optimal IC (optimal in sense of the Cramer-Rao bound)
 ###############################################################################
 setMethod("optIC", signature(model = "L2ParamFamily", risk = "asCov"),
-    function(model, risk){
+    function(model, risk, withMakeIC = FALSE){
         Curve <- as((trafo(model at param) %*% solve(model at FisherInfo)) %*% model at L2deriv, "EuclRandVariable")
         asCov <- trafo(model at param) %*% solve(model at FisherInfo) %*% t(trafo(model at param))
 
         modifyIC <- function(L2Fam, IC){ optIC(L2Fam, asCov()) }
         L2call <- model at fam.call
         L2call$trafo <- trafo(model)
-        return(IC(
+        IC.o <- IC(
             name = paste("Classical optimal influence curve for", model at name), 
             CallL2Fam = L2call,
             Curve = EuclRandVarList(Curve),
             modifyIC = modifyIC,
             Risks = list(asCov = asCov, trAsCov = sum(diag(asCov))),
             Infos = matrix(c("optIC", "optimal IC in sense of Cramer-Rao bound"), 
-                        ncol = 2, dimnames = list(character(0), c("method", "message")))))
+                        ncol = 2, dimnames = list(character(0), c("method", "message"))))
+        if(withMakeIC) IC.o <- makeIC(IC.o,model)
+        return(IC.o)
     })

Modified: branches/robast-1.1/pkg/RobAStBase/inst/NEWS
===================================================================
--- branches/robast-1.1/pkg/RobAStBase/inst/NEWS	2018-07-22 11:41:27 UTC (rev 1018)
+++ branches/robast-1.1/pkg/RobAStBase/inst/NEWS	2018-07-22 16:43:20 UTC (rev 1019)
@@ -19,7 +19,9 @@
 \code{ggplot}) to produce the plot in a different framework. A more detailed description will follow in a subsequent version.
 + new methods for returnlevelplot for RobModel, InfRobModel, kStepEstimate (as qqplot) 
 + unified return values for qqplot
-             
++ oneStepEstimator and kStepEstimator gain an argument withMakeIC
++ optIC gains an argument withMakeIC             
+
 bug fix: 
 + slot modifyIC was set to a wrong value in makeIC / former (potential) move was overridden 
  

Modified: branches/robast-1.1/pkg/RobAStBase/man/kStepEstimator.Rd
===================================================================
--- branches/robast-1.1/pkg/RobAStBase/man/kStepEstimator.Rd	2018-07-22 11:41:27 UTC (rev 1018)
+++ branches/robast-1.1/pkg/RobAStBase/man/kStepEstimator.Rd	2018-07-22 16:43:20 UTC (rev 1019)
@@ -13,7 +13,8 @@
       withICList = getRobAStBaseOption("withICList"),
       withPICList = getRobAStBaseOption("withPICList"),
       na.rm = TRUE, startArgList = NULL, ...,
-      withLogScale = TRUE, withEvalAsVar = TRUE)
+      withLogScale = TRUE, withEvalAsVar = TRUE,
+      withMakeIC = FALSE)
 }
 \arguments{
   \item{x}{ sample }
@@ -47,6 +48,8 @@
    backtransformed afterwards (default). This avoids crossing 0. }
   \item{withEvalAsVar}{logical; if \code{TRUE} (default), tells R to evaluate
    the asymptotic variance or just to produces a call to do so.}
+  \item{withMakeIC}{logical; if \code{TRUE} the [p]IC is passed through
+        \code{makeIC} before return.}
 }
 \details{
   Given an initial estimation \code{start}, a sample \code{x} 

Modified: branches/robast-1.1/pkg/RobAStBase/man/oneStepEstimator.Rd
===================================================================
--- branches/robast-1.1/pkg/RobAStBase/man/oneStepEstimator.Rd	2018-07-22 11:41:27 UTC (rev 1018)
+++ branches/robast-1.1/pkg/RobAStBase/man/oneStepEstimator.Rd	2018-07-22 16:43:20 UTC (rev 1019)
@@ -10,7 +10,7 @@
       useLast = getRobAStBaseOption("kStepUseLast"),
       withUpdateInKer = getRobAStBaseOption("withUpdateInKer"),
       IC.UpdateInKer = getRobAStBaseOption("IC.UpdateInKer"),
-      na.rm = TRUE, startArgList = NULL, ...)
+      na.rm = TRUE, startArgList = NULL, withMakeIC = FALSE, ...)
 }
 \arguments{
   \item{x}{ sample }
@@ -35,6 +35,8 @@
    the sample \code{x}, and the model \code{eval(CallL2Fam(IC))}; in case \code{IC}
    is not of class \code{IC}, the model argument \code{L2Fam} will be set
    to \code{NULL}.}
+  \item{withMakeIC}{logical; if \code{TRUE} the [p]IC is passed through
+        \code{makeIC} before return.}
   \item{...}{ additional arguments }
 }
 \details{

Modified: branches/robast-1.1/pkg/RobAStBase/man/optIC.Rd
===================================================================
--- branches/robast-1.1/pkg/RobAStBase/man/optIC.Rd	2018-07-22 11:41:27 UTC (rev 1018)
+++ branches/robast-1.1/pkg/RobAStBase/man/optIC.Rd	2018-07-22 16:43:20 UTC (rev 1019)
@@ -10,12 +10,14 @@
 \usage{
 optIC(model, risk, ...)
 
-\S4method{optIC}{L2ParamFamily,asCov}(model, risk)
+\S4method{optIC}{L2ParamFamily,asCov}(model, risk, withMakeIC = FALSE)
 }
 \arguments{
   \item{model}{ probability model. }
   \item{risk}{ object of class \code{"RiskType"}. }
   \item{\dots}{ additional parameters. }
+  \item{withMakeIC}{logical; if \code{TRUE} the [p]IC is passed through
+        \code{makeIC} before return.}
 }
 \details{ 
   The classical optimal IC which ist optimal in sense of the Cramer-Rao bound



More information about the Robast-commits mailing list