[Robast-commits] r1161 - in branches/robast-1.2/pkg/ROptEst: . R inst man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sat Aug 18 23:07:33 CEST 2018
Author: ruckdeschel
Date: 2018-08-18 23:07:33 +0200 (Sat, 18 Aug 2018)
New Revision: 1161
Modified:
branches/robast-1.2/pkg/ROptEst/NAMESPACE
branches/robast-1.2/pkg/ROptEst/R/AllGeneric.R
branches/robast-1.2/pkg/ROptEst/R/roptest.new.R
branches/robast-1.2/pkg/ROptEst/inst/NEWS
branches/robast-1.2/pkg/ROptEst/man/ORobEstimate-class.Rd
branches/robast-1.2/pkg/ROptEst/man/RMXEOMSEMBREOBRE.Rd
branches/robast-1.2/pkg/ROptEst/man/robest.Rd
branches/robast-1.2/pkg/ROptEst/man/roptest.Rd
Log:
[ROptEst] branch 1.2:
+ new accessors "timings" and "kStepTimings" to attributes "timings" and and "kStepTimings"
of an object of class "ORobEstimate"
+ roptest, robest, and particular checkIC/makeIC methods for ContIC now if (diagnostic==TRUE)
return diagnostic attributes of S3 class "DiagnosticClass"
+ roptest and its wrappers RMX|OBR|MBR|OMSEstimator can now also digest robest-arguments
arguments \code{startCtrl}, \code{startICCtrl}, and \code{kStepCtrl}, in which case
information in these arguments in case of collision overrides information given through
the "usual" arguments; this allows for individual settings of \code{E.argList},
\code{withEvalAsVar}, and \code{withMakeIC} for the different steps.
Modified: branches/robast-1.2/pkg/ROptEst/NAMESPACE
===================================================================
--- branches/robast-1.2/pkg/ROptEst/NAMESPACE 2018-08-18 20:55:25 UTC (rev 1160)
+++ branches/robast-1.2/pkg/ROptEst/NAMESPACE 2018-08-18 21:07:33 UTC (rev 1161)
@@ -40,7 +40,7 @@
exportMethods("updateNorm", "scaleUpdateIC", "eff",
"get.asGRisk.fct", "getStartIC", "plot",
"comparePlot", "getRiskFctBV", "roptestCall",
- "checkIC", "makeIC")
+ "checkIC", "makeIC", "kStepTimings")
export("getL2normL2deriv",
"asAnscombe", "asL1", "asL4",
"getReq", "getMaxIneff", "getRadius")
Modified: branches/robast-1.2/pkg/ROptEst/R/AllGeneric.R
===================================================================
--- branches/robast-1.2/pkg/ROptEst/R/AllGeneric.R 2018-08-18 20:55:25 UTC (rev 1160)
+++ branches/robast-1.2/pkg/ROptEst/R/AllGeneric.R 2018-08-18 21:07:33 UTC (rev 1161)
@@ -93,3 +93,6 @@
if(!isGeneric("roptestCall")){
setGeneric("roptestCall", function(object) standardGeneric("roptestCall"))
}
+if(!isGeneric("kStepTimings")){
+ setGeneric("kStepTimings", function(object, ...) standardGeneric("kStepTimings"))
+}
Modified: branches/robast-1.2/pkg/ROptEst/R/roptest.new.R
===================================================================
--- branches/robast-1.2/pkg/ROptEst/R/roptest.new.R 2018-08-18 20:55:25 UTC (rev 1160)
+++ branches/robast-1.2/pkg/ROptEst/R/roptest.new.R 2018-08-18 21:07:33 UTC (rev 1161)
@@ -77,8 +77,16 @@
#####################################################################
setMethod("roptestCall", "ORobEstimate", function(object) object at roptestCall)
+setMethod("timings", "ORobEstimate", function(object, withKStep = FALSE ,...){
+ if(!withKStep) return(attr(object,"timings")) else{
+ return(list(timings = attr(object,"timings"),
+ kStepTimings = attr(object,"kStepTimings")))
+ }
+})
+setMethod("timings", "ORobEstimate", function(object,...) attr(object,"kStepTimings"))
+
roptest <- function(x, L2Fam, eps, eps.lower, eps.upper, fsCor = 1, initial.est,
neighbor = ContNeighborhood(), risk = asMSE(), steps = 1L,
distance = CvMDist, startPar = NULL, verbose = NULL,
@@ -104,12 +112,15 @@
if(diagnostic) if(!missing(E.argList)&&!is.null(E.argList)) E.argList[["diagnostic"]] <- TRUE
+ if(is.null(dots$startICCtrl)){
startICCtrl <- list()
startICCtrl[["withMakeIC"]] <- if(!missing(withMakeIC)) withMakeIC else FALSE
startICCtrl[["withEvalAsVar"]] <- if(!missing(withEvalAsVar)) withEvalAsVar else NULL
startICCtrl[["modifyICwarn"]] <- if(!missing(modifyICwarn)) modifyICwarn else FALSE
startICCtrl[["E.argList"]] <- if(!missing(E.argList)) E.argList else NULL
+ }else startICCtrl <- dots$startICCtrl
+ if(is.null(dots$startCtrl)){
startCtrl <- list()
if(!missing(initial.est)) startCtrl[["initial.est"]] <- initial.est
if(!missing(initial.est.ArgList))
@@ -118,7 +129,9 @@
startCtrl[["distance"]] <- if(!missing(distance)) distance else NULL
startCtrl[["withMDE"]] <- if(!missing(withMDE)) withMDE else NULL
startCtrl[["E.argList"]] <- if(!missing(E.argList)) E.argList else NULL
+ }else startCtrl <- dots$startCtrl
+ if(is.null(dots$kStepCtrl)){
kStepCtrl <- list()
kStepCtrl[["useLast"]] <- if(!missing(useLast)) useLast else getRobAStBaseOption("kStepUseLast")
kStepCtrl[["withUpdateInKer"]] <- if(!missing(withUpdateInKer)) withUpdateInKer else getRobAStBaseOption("withUpdateInKer")
@@ -130,6 +143,7 @@
kStepCtrl[["withEvalAsVar"]] <- if(!missing(withEvalAsVar)) withEvalAsVar else NULL
kStepCtrl[["withMakeIC"]] <- if(!missing(withMakeIC)) withMakeIC else FALSE
kStepCtrl[["E.argList"]] <- if(!missing(E.argList)) E.argList else NULL
+ }else kStepCtrl <- dots$kStepCtrl
retV <- robest(x=x, L2Fam=L2Fam, fsCor = fsCor,
risk = risk, steps = steps, verbose = verbose,
@@ -149,8 +163,12 @@
retV <- .checkEstClassForParamFamily(L2Fam,retV)
attr(retV,"timings") <- tim
attr(retV,"kStepTimings") <- timK
- attr(retV,"diagnostic") <- diagn
- attr(retV,"kStepDiagnostic") <- kStpDiagn
+ if(diagnostic){
+ attr(retV,"diagnostic") <- diagn
+ class(attr(retV,"diagnostic")) <- "DiagnosticClass"
+ attr(retV,"kStepDiagnostic") <- kStpDiagn
+ class(attr(retV,"kStepDiagnostic")) <- "DiagnosticClass"
+ }
retV at roptestCall <- mc
return(retV)
}
@@ -423,7 +441,11 @@
res at start <- initial.est
attr(res, "timings") <- sy
attr(res, "kStepTimings") <- sy.OnlykStep
- if(diagnostic) attr(res,"kStepDiagnostic") <- kStpDiagn
- if(diagnostic) attr(res,"diagnostic") <- diagn
+ if(diagnostic){
+ attr(res,"kStepDiagnostic") <- kStpDiagn
+ class(attr(res,"kStepDiagnostic")) <- "DiagnosticClass"
+ attr(res,"diagnostic") <- diagn
+ class(attr(res,"diagnostic")) <- "DiagnosticClass"
+ }
return(res)
}
Modified: branches/robast-1.2/pkg/ROptEst/inst/NEWS
===================================================================
--- branches/robast-1.2/pkg/ROptEst/inst/NEWS 2018-08-18 20:55:25 UTC (rev 1160)
+++ branches/robast-1.2/pkg/ROptEst/inst/NEWS 2018-08-18 21:07:33 UTC (rev 1161)
@@ -30,10 +30,17 @@
Potential clashes with arguments of the same name in \code{\dots} are resolved by inserting
the items of argument list \code{E.argList} as named items, so in case of collisions the
item of \code{E.argList} overwrites the existing one from \code{\dots}.
++ roptest and its wrappers RMX|OBR|MBR|OMSEstimator can now also digest robest-arguments
+ arguments \code{startCtrl}, \code{startICCtrl}, and \code{kStepCtrl}, in which case
+ information in these arguments in case of collision overrides information given through
+ the "usual" arguments; this allows for individual settings of \code{E.argList},
+ \code{withEvalAsVar}, and \code{withMakeIC} for the different steps.
+ roptest and its wrappers RMX|OBR|MBR|OMSEstimator, getStartIC for asGRisk, asBias, RMX, and
asAnscombe, as well as the particular checkIC/makeIC methods for ContIC 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
++ accessors "timings" and "kStepTimings" to attributes "timings" and and "kStepTimings"
+ of an object of class "ORobEstimate"
bug fixes
@@ -81,6 +88,8 @@
than in the default method. This can be overriden by argument forceContICMethod.
+ the particular checkIC and makeIC methods gain argument diagnostic to be able to
show diagnostic information on integrations
++ roptest, robest, and particular checkIC/makeIC methods for ContIC now if (diagnostic==TRUE)
+ return diagnostic attributes of S3 class "DiagnosticClass"
#######################################
Modified: branches/robast-1.2/pkg/ROptEst/man/ORobEstimate-class.Rd
===================================================================
--- branches/robast-1.2/pkg/ROptEst/man/ORobEstimate-class.Rd 2018-08-18 20:55:25 UTC (rev 1160)
+++ branches/robast-1.2/pkg/ROptEst/man/ORobEstimate-class.Rd 2018-08-18 21:07:33 UTC (rev 1161)
@@ -21,6 +21,9 @@
\alias{ustartval}
\alias{ustartval,ORobEstimate-method}
\alias{show,ORobEstimate-method}
+\alias{timings,ORobEstimate-method}
+\alias{kStepTimings}
+\alias{kStepTimings,ORobEstimate-method}
\title{ORobEstimate-class.}
\description{Class of optimally robust asymptotically linear estimates.}
@@ -137,6 +140,17 @@
\item{roptestCall}{\code{signature(object = "ORobEstimate")}:
accessor function for slot \code{roptestCall}. }
+ \item{timings}{\code{signature(object = "ORobEstimate")}:
+ accessor function for attribute \code{"timings"}.
+ with additional argument \code{withKStep} defaulting to \code{FALSE};
+ in case argument \code{withKStep==TRUE}, the return value is a list
+ with items \code{timings} and \code{kStepTimings} combining the
+ two timing informaion attributes.
+ }
+
+ \item{kSteptimings}{\code{signature(object = "ORobEstimate")}:
+ accessor function for attribute \code{"timings"}. }
+
\item{show}{\code{signature(object = "ORobEstimate")}: a show method; [*]}
}
}
Modified: branches/robast-1.2/pkg/ROptEst/man/RMXEOMSEMBREOBRE.Rd
===================================================================
--- branches/robast-1.2/pkg/ROptEst/man/RMXEOMSEMBREOBRE.Rd 2018-08-18 20:55:25 UTC (rev 1160)
+++ branches/robast-1.2/pkg/ROptEst/man/RMXEOMSEMBREOBRE.Rd 2018-08-18 21:07:33 UTC (rev 1161)
@@ -199,6 +199,21 @@
in attributes \code{timings}, and for the step of the
\code{kStepEstimator} in \code{kStepTimings}.
+ One may also use the arguments \code{startCtrl}, \code{startICCtrl}, and
+ \code{kStepCtrl} of function \code{\link{robest}}. This allows for individual
+ settings of \code{E.argList}, \code{withEvalAsVar}, and
+ \code{withMakeIC} for the different steps. If any of the three arguments
+ \code{startCtrl}, \code{startICCtrl}, and \code{kStepCtrl} is used, the
+ respective attributes set in the correspondig argument are used and, if
+ colliding with arguments directly passed to the estimator function, the directly
+ passed ones are ignored.
+
+ Diagnostics on the involved integrations are available if argument
+ \code{diagnostic} is \code{TRUE}. Then there are attributes \code{diagnostic}
+ and \code{kStepDiagnostic} attached to the return value, which may be inspected
+ and assessed through \code{\link[distrEx:distrExIntegrate]{showDiagnostic}} and
+ \code{\link[distrEx:distrExIntegrate]{getDiagnostic}}.
+
}
\value{Object of class \code{"kStepEstimate"}. In addition, it has
an attribute \code{"timings"} where computation time is stored.}
Modified: branches/robast-1.2/pkg/ROptEst/man/robest.Rd
===================================================================
--- branches/robast-1.2/pkg/ROptEst/man/robest.Rd 2018-08-18 20:55:25 UTC (rev 1160)
+++ branches/robast-1.2/pkg/ROptEst/man/robest.Rd 2018-08-18 21:07:33 UTC (rev 1161)
@@ -68,6 +68,12 @@
\code{\link[=inputGenerators]{genstartCtrl}},
\code{\link[=inputGenerators]{genstartICCtrl}}, and
\code{\link[=inputGenerators]{kStepCtrl}}
+
+ Diagnostics on the involved integrations are available if argument
+ \code{diagnostic} is \code{TRUE}. Then there are attributes \code{diagnostic}
+ and \code{kStepDiagnostic} attached to the return value, which may be inspected
+ and assessed through \code{\link[distrEx:distrExIntegrate]{showDiagnostic}} and
+ \code{\link[distrEx:distrExIntegrate]{getDiagnostic}}.
}
\value{Object of class \code{"kStepEstimate"}. In addition, it has
an attribute \code{"timings"} where computation time is stored.}
Modified: branches/robast-1.2/pkg/ROptEst/man/roptest.Rd
===================================================================
--- branches/robast-1.2/pkg/ROptEst/man/roptest.Rd 2018-08-18 20:55:25 UTC (rev 1160)
+++ branches/robast-1.2/pkg/ROptEst/man/roptest.Rd 2018-08-18 21:07:33 UTC (rev 1161)
@@ -204,6 +204,20 @@
in attributes \code{timings}, and for the step of the
\code{kStepEstimator} in \code{kStepTimings}.
+ One may also use the arguments \code{startCtrl}, \code{startICCtrl}, and
+ \code{kStepCtrl} of function \code{\link{robest}}. This allows for individual
+ settings of \code{E.argList}, \code{withEvalAsVar}, and
+ \code{withMakeIC} for the different steps. If any of the three arguments
+ \code{startCtrl}, \code{startICCtrl}, and \code{kStepCtrl} is used, the
+ respective attributes set in the correspondig argument are used and, if
+ colliding with arguments directly passed to \code{roptest}, the directly
+ passed ones are ignored.
+
+ Diagnostics on the involved integrations are available if argument
+ \code{diagnostic} is \code{TRUE}. Then there are attributes \code{diagnostic}
+ and \code{kStepDiagnostic} attached to the return value, which may be inspected
+ and assessed through \code{\link[distrEx:distrExIntegrate]{showDiagnostic}} and
+ \code{\link[distrEx:distrExIntegrate]{getDiagnostic}}.
}
\value{Object of class \code{"kStepEstimate"}. In addition, it has
an attribute \code{"timings"} where computation time is stored.}
More information about the Robast-commits
mailing list