[Robast-commits] r1140 - in branches/robast-1.2/pkg/ROptEst: R inst man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sun Aug 12 23:43:47 CEST 2018
Author: ruckdeschel
Date: 2018-08-12 23:43:47 +0200 (Sun, 12 Aug 2018)
New Revision: 1140
Modified:
branches/robast-1.2/pkg/ROptEst/R/CheckMakeContIC.R
branches/robast-1.2/pkg/ROptEst/inst/NEWS
branches/robast-1.2/pkg/ROptEst/man/checkmakeIC.Rd
Log:
[ROptEst] branch 2.8:
+ particular checkIC, makeIC methods for ContICs: They compute the integrals E w, E L w,
E LL w using symmetry information through .getComp, and based on these numbers computes
does checking / the affine transformation to give the proper pIC. These methods by
default are only used if it pays off, i.e., if the number of computed integrals is smaller
than in the default method. [was there already] NEW: This can be overriden by
new argument forceContICMethod.
Modified: branches/robast-1.2/pkg/ROptEst/R/CheckMakeContIC.R
===================================================================
--- branches/robast-1.2/pkg/ROptEst/R/CheckMakeContIC.R 2018-08-12 21:41:45 UTC (rev 1139)
+++ branches/robast-1.2/pkg/ROptEst/R/CheckMakeContIC.R 2018-08-12 21:43:47 UTC (rev 1140)
@@ -2,13 +2,13 @@
## faster check for ContICs
setMethod("checkIC", signature(IC = "ContIC", L2Fam = "L2ParamFamily"),
- function(IC, L2Fam, out = TRUE, ...){
+ function(IC, L2Fam, out = TRUE, forceContICMethod = FALSE, ...){
D1 <- L2Fam at distribution
if( dimension(Domain(IC at Curve[[1]])) != dimension(img(D1)))
stop("dimension of 'Domain' of 'Curve' != dimension of 'img' of 'distribution' of 'L2Fam'")
- res <- .prepareCheckMakeIC(L2Fam, w = IC at weight, ...)
+ res <- .prepareCheckMakeIC(L2Fam, w = IC at weight, forceContICMethod, ...)
## if it pays off to use symmetry/ to compute integrals in L2deriv space
## we compute the following integrals:
## G1 = E w, G2 = E Lambda w, G3 = E Lambda Lambda' w
@@ -47,7 +47,7 @@
## make some L2function a pIC at a model
setMethod("makeIC", signature(IC = "ContIC", L2Fam = "L2ParamFamily"),
- function(IC, L2Fam, ...){
+ function(IC, L2Fam, forceContICMethod = FALSE, ...){
D1 <- L2Fam at distribution
if( dimension(Domain(IC at Curve[[1]])) != dimension(img(D1)))
@@ -57,7 +57,7 @@
if(dimension(IC at Curve) != dims)
stop("Dimension of IC and parameter must be equal")
- res <- .prepareCheckMakeIC(L2Fam, w = IC at weight, ...)
+ res <- .prepareCheckMakeIC(L2Fam, w = IC at weight, forceContICMethod, ...)
## if it pays off to use symmetry/ to compute integrals in L2deriv space
## we compute the following integrals:
@@ -70,7 +70,7 @@
if(is.null(res))
return(getMethod("makeIC", signature(IC = "IC",
- L2Fam = "L2ParamFamily"))(IC,L2Fam))
+ L2Fam = "L2ParamFamily"))(IC,L2Fam,...))
G1 <- res$G1; G2 <- res$G2; G3 <- res$G3
trafO <- trafo(L2Fam at param)
@@ -116,7 +116,7 @@
return(cIC1)
})
-.prepareCheckMakeIC <- function(L2Fam, w, ...){
+.prepareCheckMakeIC <- function(L2Fam, w, forceContICMethod, ...){
dims <- length(L2Fam at param)
trafo <- trafo(L2Fam at param)
@@ -132,15 +132,16 @@
z.comp <- rep(TRUE,dims)
A.comp <- matrix(TRUE, dims, dims)
# print(list(z.comp,A.comp))
- # otherwise if trafo == unitMatrix may use symmetry info
- if(.isUnitMatrix(trafo)){
+ # otherwise if nrvalues > 1 # formerly: trafo == unitMatrix #
+ # may use symmetry info
+ if(dims>1){
comp <- .getComp(L2deriv, L2Fam at distrSymm, L2Fam at L2derivSymm, L2Fam at L2derivDistrSymm)
z.comp <- comp$"z.comp"
A.comp <- comp$"A.comp"
t.comp.i <- sum(z.comp)+sum(A.comp)+1
}
- if(to.comp.a < to.comp.i) return(NULL)
+ if(to.comp.a < to.comp.i && !forceContICMethod) return(NULL)
res <- .getG1G2G3Stand(L2deriv = L2deriv, Distr = L2Fam at distribution,
Modified: branches/robast-1.2/pkg/ROptEst/inst/NEWS
===================================================================
--- branches/robast-1.2/pkg/ROptEst/inst/NEWS 2018-08-12 21:41:45 UTC (rev 1139)
+++ branches/robast-1.2/pkg/ROptEst/inst/NEWS 2018-08-12 21:43:47 UTC (rev 1140)
@@ -58,8 +58,6 @@
have to be computed, now fills the lower triangle of A with FALSE (was not used so far,
but can be used in a faster computation method for checkIC makeIC to determine whether
it is cleverer to integrate in k or in p space)
-+ particular checkIC and makeIC methods for ContICs which allow for speed up
- if in k space many entries of the LMs can be skipped due to symmetry
+ several methods (getRiskIC, getBiasIC, getBoundedIC, makeIC, checkIC, modifyIC)
gain argument "..." to pass on arguments to E(). This holds in particular for the
functions used to compute the optimally-robust ICs, i.e. getInfRob_asBias, getInfRob_asHampel,
@@ -72,6 +70,11 @@
+ the local .modifyIC0 functions only used to produce the new IC but not for filling
slot modifyIC loose argument withMakeIC (and dots) -- this is now done in the outer
modifyIC function
++ particular checkIC, makeIC methods for ContICs: They compute the integrals E w, E L w,
+ E LL w using symmetry information through .getComp, and based on these numbers computes
+ does checking / the affine transformation to give the proper pIC. These methods by
+ default are only used if it pays off, i.e., if the number of computed integrals is smaller
+ than in the default method. This can be overriden by argument forceContICMethod.
#######################################
version 1.1
Modified: branches/robast-1.2/pkg/ROptEst/man/checkmakeIC.Rd
===================================================================
--- branches/robast-1.2/pkg/ROptEst/man/checkmakeIC.Rd 2018-08-12 21:41:45 UTC (rev 1139)
+++ branches/robast-1.2/pkg/ROptEst/man/checkmakeIC.Rd 2018-08-12 21:43:47 UTC (rev 1140)
@@ -11,13 +11,32 @@
IC possibly violating the conditions so far.
}
\usage{
-\S4method{checkIC}{ContIC,L2ParamFamily}(IC, L2Fam, out = TRUE,...)
-\S4method{makeIC}{ContIC,L2ParamFamily}(IC, L2Fam, ...)
+\S4method{checkIC}{ContIC,L2ParamFamily}(IC, L2Fam, out = TRUE,
+ forceContICMethod = FALSE, ...)
+\S4method{makeIC}{ContIC,L2ParamFamily}(IC, L2Fam,
+ forceContICMethod = FALSE, ...)
}
\arguments{
\item{IC}{ object of class \code{"IC"} }
\item{L2Fam}{ L2-differentiable family of probability measures. }
\item{out}{ logical: Should the values of the checks be printed out?}
+ \item{forceContICMethod}{ logical: Should we force to use the method for
+ signature \code{ContIC,L2ParamFamily}
+ in any case (even if it is not indicated by symmetry arguments)?
+ Otherwise it uses internal method \code{.getComp} to compute the number
+ of integrals to be computed, taking care of symmetries as indicated through
+ the symmetry slots of the model \code{L2Fam}. Only if this
+ number is smaller than the number of integrals to be computed in the range
+ of the pIC the present method is used, otherwise it switches back to the
+ \code{IC,L2ParamFamily} method.
+ -- The \code{ContIC,L2ParamFamily} up to skipped entries due to further
+ symmetry arguments is $\code{(k+1)k/2+k+1=(k+1)(k+2)/2} for \code{k} the
+ length of the unknown parameter / length of slot \code{L2deriv} of \code{L2Fam},
+ while the number of integrals on the pIC scale underlying the more general
+ method for signature \code{ContIC,L2ParamFamily} is \code{p (k+1)} where
+ \code{p} is the length of the pIC / the length of the parameter of interest
+ as indicated in the number of rows in the \code{trafo} slot of the underlying
+ slot \code{param} of \code{L2Fam}.}
\item{\dots}{ additional parameters to be passed on to expectation
\code{E}. }
}
More information about the Robast-commits
mailing list