[Robast-commits] r1220 - branches/robast-1.3/pkg/ROptEst branches/robast-1.3/pkg/ROptEst/R branches/robast-1.3/pkg/ROptEst/inst branches/robast-1.3/pkg/ROptEst/man branches/robast-1.3/pkg/ROptEst/tests/Examples branches/robast-1.3/pkg/RobAStBase branches/robast-1.3/pkg/RobAStBase/R branches/robast-1.3/pkg/RobAStBase/inst branches/robast-1.3/pkg/RobAStBase/man branches/robast-1.3/pkg/RobAStBase/tests/Examples pkg/ROptEst pkg/ROptEst/R pkg/ROptEst/inst pkg/ROptEst/man pkg/ROptEst/tests/Examples pkg/RobAStBase pkg/RobAStBase/R pkg/RobAStBase/inst pkg/RobAStBase/man pkg/RobAStBase/tests/Examples

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Apr 7 12:38:46 CEST 2019


Author: ruckdeschel
Date: 2019-04-07 12:38:45 +0200 (Sun, 07 Apr 2019)
New Revision: 1220

Modified:
   branches/robast-1.3/pkg/ROptEst/DESCRIPTION
   branches/robast-1.3/pkg/ROptEst/R/CheckMakeContIC.R
   branches/robast-1.3/pkg/ROptEst/inst/NEWS
   branches/robast-1.3/pkg/ROptEst/man/0ROptEst-package.Rd
   branches/robast-1.3/pkg/ROptEst/tests/Examples/ROptEst-Ex.Rout.save
   branches/robast-1.3/pkg/RobAStBase/DESCRIPTION
   branches/robast-1.3/pkg/RobAStBase/R/CheckMakeIC.R
   branches/robast-1.3/pkg/RobAStBase/inst/NEWS
   branches/robast-1.3/pkg/RobAStBase/man/0RobAStBase-package.Rd
   branches/robast-1.3/pkg/RobAStBase/tests/Examples/RobAStBase-Ex.Rout.save
   pkg/ROptEst/DESCRIPTION
   pkg/ROptEst/R/CheckMakeContIC.R
   pkg/ROptEst/inst/NEWS
   pkg/ROptEst/man/0ROptEst-package.Rd
   pkg/ROptEst/tests/Examples/ROptEst-Ex.Rout.save
   pkg/RobAStBase/DESCRIPTION
   pkg/RobAStBase/R/CheckMakeIC.R
   pkg/RobAStBase/inst/NEWS
   pkg/RobAStBase/man/0RobAStBase-package.Rd
   pkg/RobAStBase/tests/Examples/RobAStBase-Ex.Rout.save
Log:
[RobAStBase, ROptEst] 
Kurt Hornik spotted that we failed to really fix the issue about machine-dependent diagnostic output on accuracies in checkL2deriv. This is fixed now in trunk in 
RobAStBase_1.2.1, ROptEst_1.2.1 and merged back to branch 1.3. From the entry in NEWS 

#######################################
version 1.2.1
#######################################

user-visible CHANGES:
+ revised code to delete fuzz when checking the centering/consistency of pICs varying from -- relative accuracy is now determined by the size of trafo-matrix  
under the hood:
+ use S3 method distrMod::print.relMatrix) to capture the fact that when computing relative differences in consistency matrices, some entries in the denominator 
  may be 0; in order to avoid output of Inf / NaN we catch the output and replace such entries by "."



Modified: branches/robast-1.3/pkg/ROptEst/DESCRIPTION
===================================================================
--- branches/robast-1.3/pkg/ROptEst/DESCRIPTION	2019-04-05 05:59:55 UTC (rev 1219)
+++ branches/robast-1.3/pkg/ROptEst/DESCRIPTION	2019-04-07 10:38:45 UTC (rev 1220)
@@ -1,10 +1,10 @@
 Package: ROptEst
 Version: 1.3.0
-Date: 2019-03-13
+Date: 2019-04-07
 Title: Optimally Robust Estimation
 Description: Optimally robust estimation in general smoothly parameterized models using S4
             classes and methods.
-Depends: R(>= 3.4), methods, distr(>= 2.8.0), distrEx(>= 2.8.0), distrMod(>= 2.8.0),
+Depends: R(>= 3.4), methods, distr(>= 2.8.0), distrEx(>= 2.8.0), distrMod(>= 2.8.1),
             RandVar(>= 1.2.0), RobAStBase(>= 1.2.0)
 Imports: startupmsg, MASS, stats, graphics, utils, grDevices
 Suggests: RobLox
@@ -19,4 +19,4 @@
 Encoding: latin1
 LastChangedDate: {$LastChangedDate$}
 LastChangedRevision: {$LastChangedRevision$}
-VCS/SVNRevision: 1205
+VCS/SVNRevision: 1213

Modified: branches/robast-1.3/pkg/ROptEst/R/CheckMakeContIC.R
===================================================================
--- branches/robast-1.3/pkg/ROptEst/R/CheckMakeContIC.R	2019-04-05 05:59:55 UTC (rev 1219)
+++ branches/robast-1.3/pkg/ROptEst/R/CheckMakeContIC.R	2019-04-07 10:38:45 UTC (rev 1220)
@@ -27,22 +27,36 @@
         G1 <- res$G1;  G2 <- res$G2;  G3 <- res$G3
         Delta1 <- A%*%G2- a*G1
         Delta2 <- A%*%G3 - a%*%t(G2)
-        Delta2 <- Delta2 - trafo(L2Fam)
+        trafoL <- trafo(L2Fam)
+        Delta2 <- Delta2 - trafoL
 
-        if(out)
-            cat("precision of centering:\t", Delta1, "\n")
+        Prec <- ceiling(12-round(max(log(abs(trafoL)+1e-14,10)))/2)
 
+    ## PR 20190407: in output in if(out)
+		## deleting all digits beyond 1e-12 (as numeric fuzz) --
+		## but check for relative accuracy by means of the "size" of the Fisher information
+		## measured in by the max(trafo)
         if(out){
-            cat("precision of Fisher consistency:\n")
-            print(Delta2)
-            cat("precision of Fisher consistency - relative error [%]:\n")
-            print(100*Delta2/trafo)
+            cent.out <- round(Delta1*10^Prec)/10^Prec
+            cat("precision of centering:\t", cent.out, "\n")
 
-            if(diagnostic){
+            oldOps <- options()
+            on.exit(do.call(options,oldOps))
+            consist.out <- round(Delta2*10^Prec)/10^Prec
+            options(digits=5,scipen=-2)
+            cat("precision of Fisher information:\n")
+            print(consist.out)
+
+            cat("precision of Fisher information - relativ error [%]:\n")
+            relconsist.out <- round(Delta2/trafoL*10^(Prec+2))/10^Prec
+            class(relconsist.out) <- c("relMatrix",class(consist.out))
+            print(relconsist.out)
+
+          if(diagnostic){
                print(attr(res$G1, "diagnostic"))
                print(attr(res$G2, "diagnostic"))
                print(attr(res$G3, "diagnostic"))
-            }
+          }
         }
 
         prec <- max(abs(Delta1), abs(Delta2))

Modified: branches/robast-1.3/pkg/ROptEst/inst/NEWS
===================================================================
--- branches/robast-1.3/pkg/ROptEst/inst/NEWS	2019-04-05 05:59:55 UTC (rev 1219)
+++ branches/robast-1.3/pkg/ROptEst/inst/NEWS	2019-04-07 10:38:45 UTC (rev 1220)
@@ -8,6 +8,22 @@
  information)
 
 #######################################
+version 1.3
+#######################################
+
+#######################################
+version 1.2.1
+#######################################
+
+user-visible CHANGES:
++ revised code to delete fuzz when checking the centering/consistency of pICs varying from 
+  -- relative accuracy is now determined by the size of trafo-matrix  
+under the hood:
++ use S3 method distrMod::print.relMatrix) to capture the fact that when computing relative 
+  differences in consistency matrices, some entries in the denominator may be 0; in order 
+  to avoid output of Inf / NaN we catch the output and replace such entries by "."
+
+#######################################
 version 1.2
 #######################################
 

Modified: branches/robast-1.3/pkg/ROptEst/man/0ROptEst-package.Rd
===================================================================
--- branches/robast-1.3/pkg/ROptEst/man/0ROptEst-package.Rd	2019-04-05 05:59:55 UTC (rev 1219)
+++ branches/robast-1.3/pkg/ROptEst/man/0ROptEst-package.Rd	2019-04-07 10:38:45 UTC (rev 1220)
@@ -13,16 +13,16 @@
 \tabular{ll}{
 Package: \tab ROptEst \cr
 Version: \tab 1.3.0 \cr
-Date: \tab 2019-03-13 \cr
+Date: \tab 2019-04-07 \cr
 Depends: \tab R(>= 3.4), methods, distr(>= 2.8.0), distrEx(>= 2.8.0),
-    distrMod(>= 2.8.0),RandVar(>= 1.2.0), RobAStBase(>= 1.2.0) \cr
+    distrMod(>= 2.8.1),RandVar(>= 1.2.0), RobAStBase(>= 1.2.0) \cr
 Suggests: \tab RobLox \cr
 Imports: \tab startupmsg, MASS, stats, graphics, utils, grDevices \cr
 ByteCompile: \tab yes \cr
 Encoding: \tab latin1 \cr
 License: \tab LGPL-3 \cr
 URL: \tab http://robast.r-forge.r-project.org/\cr
-VCS/SVNRevision: \tab 1205 \cr
+VCS/SVNRevision: \tab 1213 \cr
 }
 }
 \author{

Modified: branches/robast-1.3/pkg/ROptEst/tests/Examples/ROptEst-Ex.Rout.save
===================================================================
--- branches/robast-1.3/pkg/ROptEst/tests/Examples/ROptEst-Ex.Rout.save	2019-04-05 05:59:55 UTC (rev 1219)
+++ branches/robast-1.3/pkg/ROptEst/tests/Examples/ROptEst-Ex.Rout.save	2019-04-07 10:38:45 UTC (rev 1220)
@@ -1,1166 +1,1157 @@
-
-R version 2.12.1 Patched (2011-01-04 r53913)
-Copyright (C) 2011 The R Foundation for Statistical Computing
-ISBN 3-900051-07-0
-Platform: x86_64-unknown-linux-gnu (64-bit)
-
-R is free software and comes with ABSOLUTELY NO WARRANTY.
-You are welcome to redistribute it under certain conditions.
-Type 'license()' or 'licence()' for distribution details.
-
-  Natural language support but running in an English locale
-
-R is a collaborative project with many contributors.
-Type 'contributors()' for more information and
-'citation()' on how to cite R or R packages in publications.
-
-Type 'demo()' for some demos, 'help()' for on-line help, or
-'help.start()' for an HTML browser interface to help.
-Type 'q()' to quit R.
-
-> pkgname <- "ROptEst"
-> source(file.path(R.home("share"), "R", "examples-header.R"))
-> options(warn = 1)
-> library('ROptEst')
-Loading required package: distr
-Loading required package: startupmsg
-:startupmsg>  Utilities for start-up messages (version 0.7.1)
-:startupmsg> 
-:startupmsg>  For more information see ?"startupmsg",
-:startupmsg>  NEWS("startupmsg")
-
-Loading required package: sfsmisc
-Loading required package: SweaveListingUtils
-:SweaveListingUtils>  Utilities for Sweave together with
-:SweaveListingUtils>  TeX listings package (version 0.5)
-:SweaveListingUtils> 
-:SweaveListingUtils>  Some functions from package 'base'
-:SweaveListingUtils>  are intentionally masked ---see
-:SweaveListingUtils>  SweaveListingMASK().
-:SweaveListingUtils> 
-:SweaveListingUtils>  Note that global options are
-:SweaveListingUtils>  controlled by
-:SweaveListingUtils>  SweaveListingoptions() ---c.f.
-:SweaveListingUtils>  ?"SweaveListingoptions".
-:SweaveListingUtils> 
-:SweaveListingUtils>  For more information see
-:SweaveListingUtils>  ?"SweaveListingUtils",
-:SweaveListingUtils>  NEWS("SweaveListingUtils")
-:SweaveListingUtils>  There is a vignette to this
-:SweaveListingUtils>  package; try
-:SweaveListingUtils>  vignette("ExampleSweaveListingUtils").
-
-
-Attaching package: 'SweaveListingUtils'
-
-The following object(s) are masked from 'package:base':
-
-    library, require
-
-:distr>  Object oriented implementation of distributions (version
-:distr>  2.3)
-:distr> 
-:distr>  Attention: Arithmetics on distribution objects are
-:distr>  understood as operations on corresponding random variables
-:distr>  (r.v.s); see distrARITH().
-:distr> 
-:distr>  Some functions from package 'stats' are intentionally masked
-:distr>  ---see distrMASK().
-:distr> 
-:distr>  Note that global options are controlled by distroptions()
-:distr>  ---c.f. ?"distroptions".
-:distr> 
-:distr>  For more information see ?"distr", NEWS("distr"), as well as
-:distr>    http://distr.r-forge.r-project.org/
-:distr>  Package "distrDoc" provides a vignette to this package as
-:distr>  well as to several extension packages; try
-:distr>  vignette("distr").
-
-
-Attaching package: 'distr'
-
-The following object(s) are masked from 'package:stats':
-
-    df, qqplot, sd
-
-Loading required package: distrEx
-Loading required package: evd
-Loading required package: actuar
-
-Attaching package: 'actuar'
-
-The following object(s) are masked from 'package:grDevices':
-
-    cm
-
-:distrEx>  Extensions of package distr (version 2.3)
-:distrEx> 
-:distrEx>  Note: Packages "e1071", "moments", "fBasics" should be
-:distrEx>  attached /before/ package "distrEx". See distrExMASK().
-:distrEx> 
-:distrEx>  For more information see ?"distrEx", NEWS("distrEx"), as
-:distrEx>  well as
-:distrEx>    http://distr.r-forge.r-project.org/
-:distrEx>  Package "distrDoc" provides a vignette to this package
-:distrEx>  as well as to several related packages; try
-:distrEx>  vignette("distr").
-
-
-Attaching package: 'distrEx'
-
-The following object(s) are masked from 'package:stats':
-
-    IQR, mad, median, var
-
-Loading required package: distrMod
-Loading required package: RandVar
-:RandVar>  Implementation of random variables (version 0.8)
-:RandVar> 
-:RandVar>  For more information see ?"RandVar", NEWS("RandVar"), as
-:RandVar>  well as
-:RandVar>    http://robast.r-forge.r-project.org/
-:RandVar>  This package also includes a vignette; try
-:RandVar>  vignette("RandVar").
-
-Loading required package: MASS
-Loading required package: stats4
-:distrMod>  Object oriented implementation of probability models
-:distrMod>  (version 2.3)
-:distrMod> 
-:distrMod>  Some functions from pkg's 'base' and 'stats' are
-:distrMod>  intentionally masked ---see distrModMASK().
-:distrMod> 
-:distrMod>  Note that global options are controlled by
-:distrMod>  distrModoptions() ---c.f. ?"distrModoptions".
-:distrMod> 
-:distrMod>  For more information see ?"distrMod",
-:distrMod>  NEWS("distrMod"), as well as
-:distrMod>    http://distr.r-forge.r-project.org/
-:distrMod>  There is a vignette to this package; try
-:distrMod>  vignette("distrMod").
-:distrMod>  Package "distrDoc" provides a vignette to the other
-:distrMod>  distrXXX packages,
-:distrMod>  as well as to several related packages; try
-:distrMod>  vignette("distr").
-
-
-Attaching package: 'distrMod'
-
-The following object(s) are masked from 'package:stats4':
-
-    confint
-
-The following object(s) are masked from 'package:stats':
-
-    confint
-
-The following object(s) are masked from 'package:base':
-
-    norm
-
-Loading required package: RobAStBase
-:RobAStBase>  Robust Asymptotic Statistics (version 0.8)
-:RobAStBase> 
-:RobAStBase>  Some functions from pkg's 'stats' and 'graphics'
-:RobAStBase>  are intentionally masked ---see RobAStBaseMASK().
-:RobAStBase> 
-:RobAStBase>  Note that global options are controlled by
-:RobAStBase>  RobAStBaseoptions() ---c.f. ?"RobAStBaseoptions".
-:RobAStBase> 
-:RobAStBase>  For more information see ?"RobAStBase",
-:RobAStBase>  NEWS("RobAStBase"), as well as
-:RobAStBase>    http://robast.r-forge.r-project.org/
-
-
-Attaching package: 'RobAStBase'
-
-The following object(s) are masked from 'package:stats':
-
-    start
-
-The following object(s) are masked from 'package:graphics':
-
-    clip
-
-> 
-> assign(".oldSearch", search(), pos = 'CheckExEnv')
-> cleanEx()
-> nameEx("0ROptEst-package")
-> ### * 0ROptEst-package
-> 
-> flush(stderr()); flush(stdout())
-> 
-> ### Name: ROptEst-package
-> ### Title: Optimally robust estimation
-> ### Aliases: ROptEst-package ROptEst
-> ### Keywords: package
-> 
-> ### ** Examples
-> 
-> library(ROptEst)
-> 
-> ## Example: Rutherford-Geiger (1910); cf. Feller~(1968), Section VI.7 (a)
-> x <- c(rep(0, 57), rep(1, 203), rep(2, 383), rep(3, 525), rep(4, 532), 
-+        rep(5, 408), rep(6, 273), rep(7, 139), rep(8, 45), rep(9, 27), 
-+        rep(10, 10), rep(11, 4), rep(12, 0), rep(13, 1), rep(14, 1))
-> 
-> ## ML-estimate from package distrMod
-> MLest <- MLEstimator(x, PoisFamily())
-> MLest
-Evaluations of Maximum likelihood estimate:
--------------------------------------------
-An object of class “Estimate” 
-generated by call
-  MLEstimator(x = x, ParamFamily = PoisFamily())
-samplesize:   2608
-estimate:
-             
-  3.87154908 
- (0.03852908)
-asymptotic (co)variance (multiplied with samplesize):
-[1] 3.871549
-Criterion:
-negative log-likelihood 
-               5352.105 
-> ## confidence interval based on CLT
-> confint(MLest)
-A[n] asymptotic (CLT-based) confidence interval:
-        2.5 %   97.5 %
-[1,] 3.796033 3.947065
-Type of estimator: Maximum likelihood estimate
-samplesize:   2608
-Call by which estimate was produced:
-MLEstimator(x = x, ParamFamily = PoisFamily())
-> 
-> ## compute optimally (w.r.t to MSE) robust estimator (unknown contamination)
-> robest <- roptest(x, PoisFamily(), eps.upper = 0.1, steps = 3)
-> estimate(robest)
-  lambda 
-3.908135 
-> ## check influence curve
-> checkIC(pIC(robest))
-precision of centering:	 -2.707017e-08 
-precision of Fisher consistency:
-              lambda
-lambda -1.980378e-06
-maximum deviation 
-     1.980378e-06 
-> ## plot influence curve
-> plot(pIC(robest))
-> ## confidence interval based on LAN - neglecting bias
-> confint(robest)
-A[n] asymptotic (LAN-based) confidence interval:
-          2.5 %   97.5 %
-lambda 3.826169 3.990102
-Type of estimator: 3-step estimate
-samplesize:   2608
-Call by which estimate was produced:
-roptest(x = x, L2Fam = PoisFamily(), eps.upper = 0.1, steps = 3)
-> ## confidence interval based on LAN - including bias
-> confint(robest, method = symmetricBias())
-A[n] asymptotic (LAN-based), uniform (bias-aware)
- confidence interval:
-for symmetric Bias
-          2.5 %   97.5 %
-lambda 3.761616 4.054655
-Type of estimator: 3-step estimate
-samplesize:   2608
-Call by which estimate was produced:
-roptest(x = x, L2Fam = PoisFamily(), eps.upper = 0.1, steps = 3)
-> 
-> 
-> 
-> cleanEx()
-> nameEx("asAnscombe-class")
-> ### * asAnscombe-class
-> 
-> flush(stderr()); flush(stdout())
-> 
-> ### Name: asAnscombe-class
-> ### Title: Asymptotic Anscombe risk
-> ### Aliases: asAnscombe-class eff eff,asAnscombe-method
-> ###   show,asAnscombe-method
-> ### Keywords: classes
-> 
-> ### ** Examples
-> 
-> new("asAnscombe")
-An object of class “asAnscombe” 
-risk type:	 optimal bias robust IC for given ARE in the ideal model 
-ARE in the ideal model:	 0.95 
-> 
-> 
-> 
-> cleanEx()
-> nameEx("asAnscombe")
-> ### * asAnscombe
-> 
-> flush(stderr()); flush(stdout())
-> 
-> ### Name: asAnscombe
-> ### Title: Generating function for asAnscombe-class
-> ### Aliases: asAnscombe
-> ### Keywords: robust
-> 
-> ### ** Examples
-> 
-> asAnscombe()
-An object of class “asAnscombe” 
-risk type:	 optimal bias robust IC for given ARE in the ideal model 
-ARE in the ideal model:	 0.95 
-> 
-> ## The function is currently defined as
-> function(eff = .95, biastype = symmetricBias(), normtype = NormType()){ 
-+     new("asAnscombe", eff = eff, biastype = biastype, normtype = normtype) }
-function (eff = 0.95, biastype = symmetricBias(), normtype = NormType()) 
-{
-    new("asAnscombe", eff = eff, biastype = biastype, normtype = normtype)
-}
-> 
-> 
-> 
-> cleanEx()
-> nameEx("asL1-class")
-> ### * asL1-class
-> 
-> flush(stderr()); flush(stdout())
-> 
-> ### Name: asL1-class
-> ### Title: Asymptotic mean absolute error
-> ### Aliases: asL1-class
-> ### Keywords: classes
-> 
-> ### ** Examples
-> 
-> new("asMSE")
-An object of class “asMSE” 
-risk type:	 asymptotic mean square error 
-> 
-> 
-> 
-> cleanEx()
-> nameEx("asL1")
-> ### * asL1
-> 
-> flush(stderr()); flush(stdout())
-> 
-> ### Name: asL1
-> ### Title: Generating function for asMSE-class
-> ### Aliases: asL1
-> ### Keywords: robust
-> 
-> ### ** Examples
-> 
-> asL1()
-An object of class “asL1” 
-risk type:	 asymptotic mean absolute error 
-> 
-> ## The function is currently defined as
-> function(biastype = symmetricBias(), normtype = NormType()){ 
-+          new("asL1", biastype = biastype, normtype = normtype) }
-function (biastype = symmetricBias(), normtype = NormType()) 
-{
-    new("asL1", biastype = biastype, normtype = normtype)
-}
-> 
-> 
-> 
-> cleanEx()
-> nameEx("asL4-class")
-> ### * asL4-class
-> 
-> flush(stderr()); flush(stdout())
-> 
-> ### Name: asL4-class
-> ### Title: Asymptotic mean power 4 error
-> ### Aliases: asL4-class
-> ### Keywords: classes
-> 
-> ### ** Examples
-> 
-> new("asMSE")
-An object of class “asMSE” 
-risk type:	 asymptotic mean square error 
-> 
-> 
-> 
-> cleanEx()
-> nameEx("asL4")
-> ### * asL4
-> 
-> flush(stderr()); flush(stdout())
-> 
-> ### Name: asL4
-> ### Title: Generating function for asL4-class
-> ### Aliases: asL4
-> ### Keywords: robust
-> 
-> ### ** Examples
-> 
-> asL4()
-An object of class “asL4” 
-risk type:	 asymptotic mean power 4 error 
-> 
-> ## The function is currently defined as
-> function(biastype = symmetricBias(), normtype = NormType()){ 
-+          new("asL4", biastype = biastype, normtype = normtype) }
-function (biastype = symmetricBias(), normtype = NormType()) 
-{
-    new("asL4", biastype = biastype, normtype = normtype)
-}
-> 
-> 
-> 
-> cleanEx()
-> nameEx("cniperCont")
-> ### * cniperCont
-> 
-> flush(stderr()); flush(stdout())
-> 
-> ### Name: cniperCont
-> ### Title: Generic Functions for Computation and Plot of Cniper
-> ###   Contamination and Cniper Points.
-> ### Aliases: cniperCont cniperCont-methods
-> ###   cniperCont,IC,IC,L2ParamFamily,ContNeighborhood,asMSE-method
-> ###   cniperPoint cniperPoint-methods
-> ###   cniperPoint,L2ParamFamily,ContNeighborhood,asMSE-method
-> ###   cniperPointPlot cniperPointPlot-methods
-> ###   cniperPointPlot,L2ParamFamily,ContNeighborhood,asMSE-method
-> ### Keywords: robust
-> 
-> ### ** Examples
-> 
-> ## cniper contamination
-> P <- PoisFamily(lambda = 4)
-> RobP1 <- InfRobModel(center = P, neighbor = ContNeighborhood(radius = 0.1))
-> IC1 <- optIC(model=RobP1, risk=asMSE())
-> RobP2 <- InfRobModel(center = P, neighbor = ContNeighborhood(radius = 1))
-> IC2 <- optIC(model=RobP2, risk=asMSE())
-> cniperCont(IC1 = IC1, IC2 = IC2, L2Fam = P, 
-+            neighbor = ContNeighborhood(radius = 0.5), 
-+            risk = asMSE(),
-+            lower = 0, upper = 8, n = 101)
-> 
-> ## cniper point plot
-> cniperPointPlot(P, neighbor = ContNeighborhood(radius = 0.5), 
-+                 risk = asMSE(), lower = 0, upper = 10)
-> 
-> ## cniper point
-> cniperPoint(P, neighbor = ContNeighborhood(radius = 0.5), 
-+             risk = asMSE(), lower = 0, upper = 4)
-cniper point 
-   0.7803439 
-> cniperPoint(P, neighbor = ContNeighborhood(radius = 0.5), 
-+             risk = asMSE(), lower = 4, upper = 8)
-cniper point 
-    7.219656 
-> 
-> 
-> 
-> cleanEx()
-> nameEx("getL1normL2deriv")
-> ### * getL1normL2deriv
-> 
-> flush(stderr()); flush(stdout())
-> 
-> ### Name: getL1normL2deriv
-> ### Title: Calculation of L1 norm of L2derivative
-> ### Aliases: getL1normL2deriv getL1normL2deriv-methods
-> ###   getL1normL2deriv,UnivariateDistribution-method
-> ###   getL1normL2deriv,RealRandVariable-method
-> ### Keywords: robust
-> 
-> ### ** Examples
-> 
-> ##
-> 
-> 
-> 
-> cleanEx()
-> nameEx("getL2normL2deriv")
-> ### * getL2normL2deriv
-> 
-> flush(stderr()); flush(stdout())
-> 
-> ### Name: getL2normL2deriv
-> ### Title: Calculation of L2 norm of L2derivative
-> ### Aliases: getL2normL2deriv
-> ### Keywords: robust
-> 
-> ### ** Examples
-> 
-> ##
-> 
-> 
-> 
-> cleanEx()
-> nameEx("getMaxIneff")
-> ### * getMaxIneff
-> 
-> flush(stderr()); flush(stdout())
-> 
-> ### Name: getMaxIneff
-> ### Title: getMaxIneff - computation of the maximal inefficiency of an IC
-> ### Aliases: getMaxIneff
-> ### Keywords: robust
-> 
-> ### ** Examples
-> 
-> N0 <- NormLocationFamily(mean=2, sd=3)
-> ## L_2 family + infinitesimal neighborhood
-> neighbor <- ContNeighborhood(radius = 0.5)
-> N0.Rob1 <- InfRobModel(center = N0, neighbor = neighbor)
-> ## OBRE solution (ARE 95%)
-> N0.ICA <- optIC(model = N0.Rob1, risk = asAnscombe(.95))
-minimal bound:	 3.759947 
-minimal bound:	 3.759947 
-minimal bound:	 3.759947 
-maximum iterations reached!
- achieved precision:	 0.0009839269 
-minimal bound:	 3.759947 
-maximum iterations reached!
- achieved precision:	 0.045311 
-minimal bound:	 3.759947 
-maximum iterations reached!
- achieved precision:	 0.0389404 
-minimal bound:	 3.759947 
-maximum iterations reached!
- achieved precision:	 0.04095049 
-minimal bound:	 3.759947 
-maximum iterations reached!
- achieved precision:	 0.04096877 
-minimal bound:	 3.759947 
-maximum iterations reached!
- achieved precision:	 0.04096873 
-minimal bound:	 3.759947 
-maximum iterations reached!
- achieved precision:	 0.04096877 
-> ## OMSE solution radius 0.5
-> N0.ICM <- optIC(model=N0.Rob1, risk=asMSE())
-> ## RMX solution 
-> N0.ICR <- radiusMinimaxIC(L2Fam=N0, neighbor=neighbor,risk=asMSE())
-> 
-> getMaxIneff(N0.ICA,neighbor)
-Warning in .local(IC, risk, L2Fam, ...) :
-  The maximum deviation from the exact IC properties is 0.0020208733776802
-This is larger than the specified 'tol' => the result may be wrong
-[1] 1.658389
-> getMaxIneff(N0.ICM,neighbor)
-[1] 1.265537
-> getMaxIneff(N0.ICR,neighbor)
-[1] 1.180746
-> 
-> N0ls <- NormLocationScaleFamily()
-> ICsc <- makeIC(list(sin,cos),N0ls)
-> getMaxIneff(ICsc,neighbor)
-Warning in A[DA.comp] <- matrix(param[1:lA.comp], ncol = k, nrow = p) :
-  number of items to replace is not a multiple of replacement length
-[1] 2.679436
-> 
-> 
-> 
-> 
-> cleanEx()
-> nameEx("getReq")
-> ### * getReq
-> 
-> flush(stderr()); flush(stdout())
-> 
-> ### Name: getReq
-> ### Title: getReq - computation of the radius interval where IC1 is better
-> ###   than IC2
-> ### Aliases: getReq
-> ### Keywords: robust
-> 
-> ### ** Examples
-> 
-> N0 <- NormLocationFamily(mean=2, sd=3)
-> ## L_2 family + infinitesimal neighborhood
-> neighbor <- ContNeighborhood(radius = 0.5)
-> N0.Rob1 <- InfRobModel(center = N0, neighbor = neighbor)
-> ## OBRE solution (ARE 95%)
-> N0.ICA <- optIC(model = N0.Rob1, risk = asAnscombe(.95))
-minimal bound:	 3.759947 
-minimal bound:	 3.759947 
-minimal bound:	 3.759947 
-maximum iterations reached!
- achieved precision:	 0.0009839269 
-minimal bound:	 3.759947 
-maximum iterations reached!
- achieved precision:	 0.045311 
-minimal bound:	 3.759947 
-maximum iterations reached!
- achieved precision:	 0.0389404 
-minimal bound:	 3.759947 
-maximum iterations reached!
- achieved precision:	 0.04095049 
-minimal bound:	 3.759947 
-maximum iterations reached!
- achieved precision:	 0.04096877 
-minimal bound:	 3.759947 
-maximum iterations reached!
- achieved precision:	 0.04096873 
-minimal bound:	 3.759947 
-maximum iterations reached!
- achieved precision:	 0.04096877 
-> ## MSE solution
-> N0.ICM <- optIC(model=N0.Rob1, risk=asMSE())
-> ## RMX solution
-> N0.ICR <- radiusMinimaxIC(L2Fam=N0, neighbor=neighbor,risk=asMSE())
-> 
-> getReq(asMSE(),neighbor,N0.ICA,N0.ICM,n=1)
-Warning in .local(IC, risk, L2Fam, ...) :
-  The maximum deviation from the exact IC properties is 0.0020208733776802
-This is larger than the specified 'tol' => the result may be wrong
-[1] 0.0000000 0.3750825
-> getReq(asMSE(),neighbor,N0.ICA,N0.ICM,n=30)
-Warning in .local(IC, risk, L2Fam, ...) :
-  The maximum deviation from the exact IC properties is 0.0020208733776802
-This is larger than the specified 'tol' => the result may be wrong
-[1] 0.00000000 0.06848038
-> getReq(asL1(),neighbor,N0.ICA,N0.ICM,n=30)
-Warning in .local(IC, risk, L2Fam, ...) :
-  The maximum deviation from the exact IC properties is 0.0020208733776802
-This is larger than the specified 'tol' => the result may be wrong
-[1] 0.00000000 0.06544434
-> getReq(asL4(),neighbor,N0.ICA,N0.ICM,n=30)
-Warning in .local(IC, risk, L2Fam, ...) :
-  The maximum deviation from the exact IC properties is 0.0020208733776802
-This is larger than the specified 'tol' => the result may be wrong
-[1] 0.0000000 0.0754216
-> getReq(asMSE(),neighbor,N0.ICA,N0.ICR,n=30)
-Warning in .local(IC, risk, L2Fam, ...) :
-  The maximum deviation from the exact IC properties is 0.0020208733776802
-This is larger than the specified 'tol' => the result may be wrong
-[1] 0.00000000 0.07544307
-> getReq(asL1(),neighbor,N0.ICA,N0.ICR,n=30)
-Warning in .local(IC, risk, L2Fam, ...) :
-  The maximum deviation from the exact IC properties is 0.0020208733776802
-This is larger than the specified 'tol' => the result may be wrong
-[1] 0.00000000 0.07161849
-> getReq(asL4(),neighbor,N0.ICA,N0.ICR,n=30)
-Warning in .local(IC, risk, L2Fam, ...) :
-  The maximum deviation from the exact IC properties is 0.0020208733776802
-This is larger than the specified 'tol' => the result may be wrong
-[1] 0.00000000 0.08429762
-> getReq(asMSE(),neighbor,N0.ICM,N0.ICR,n=30)
-[1] 0.0000000 0.1016517
-> 
-> ### when to use MAD and when Qn 
-> ##  for Qn, see C. Croux, P. Rousseeuw (1993). Alternatives to the Median 
-> ##      Absolute Deviation, JASA 88(424):1273-1283
-> L2M <- NormScaleFamily()
-> IC.mad <- makeIC(function(x)sign(abs(x)-qnorm(.75)),L2M)
-$Curve
-An object of class “EuclRandVarList” 
-Domain:	Real Space with dimension 1 
-[[1]]
-length of Map:	 1 
-Range:	Real Space with dimension 1 
-
-$CallL2Fam
-L2Fam at fam.call
-
-An object of class “IC” 
-### name:	 square integrable (partial) influence curve 
-### L2-differentiable parametric family:	 normal scale family 
-
-### 'Curve':	An object of class “EuclRandVarList” 
-Domain:	Real Space with dimension 1 
-[[1]]
-length of Map:	 1 
-Range:	Real Space with dimension 1 
-
-### Infos:
-     method message
-> d.qn <- (2^.5*qnorm(5/8))^-1
-> IC.qn <- makeIC(function(x) d.qn*(1/4 - pnorm(x+1/d.qn) + pnorm(x-1/d.qn)), L2M)
-$Curve
-An object of class “EuclRandVarList” 
-Domain:	Real Space with dimension 1 
-[[1]]
-length of Map:	 1 
-Range:	Real Space with dimension 1 
-
-$CallL2Fam
-L2Fam at fam.call
-
-An object of class “IC” 
-### name:	 square integrable (partial) influence curve 
-### L2-differentiable parametric family:	 normal scale family 
-
-### 'Curve':	An object of class “EuclRandVarList” 
-Domain:	Real Space with dimension 1 
-[[1]]
-length of Map:	 1 
-Range:	Real Space with dimension 1 
-
-### Infos:
-     method message
-> getReq(asMSE(), neighbor, IC.mad, IC.qn)
-[1] 0.5074459       Inf
-> # => MAD is better once r > 0.5144 (i.e. for more than 2 outliers for n = 30)
-> 
-> 
-> 
-> cleanEx()
-> nameEx("leastFavorableRadius")
-> ### * leastFavorableRadius
-> 
-> flush(stderr()); flush(stdout())
-> 
-> ### Name: leastFavorableRadius
-> ### Title: Generic Function for the Computation of Least Favorable Radii
-> ### Aliases: leastFavorableRadius leastFavorableRadius-methods
-> ###   leastFavorableRadius,L2ParamFamily,UncondNeighborhood,asGRisk-method
-> ### Keywords: robust
-> 
-> ### ** Examples
-> 
-> N <- NormLocationFamily(mean=0, sd=1) 
-> leastFavorableRadius(L2Fam=N, neighbor=ContNeighborhood(),
-+                      risk=asMSE(), rho=0.5)
-current radius:	 0.3820278 	inefficiency:	 1.039514 
-current radius:	 0.6180722 	inefficiency:	 1.043963 
-current radius:	 0.7639556 	inefficiency:	 1.041503 
-current radius:	 0.6008356 	inefficiency:	 1.044073 
-current radius:	 0.5598913 	inefficiency:	 1.044123 
-current radius:	 0.4919535 	inefficiency:	 1.043417 
-current radius:	 0.5735221 	inefficiency:	 1.044142 
-current radius:	 0.5739285 	inefficiency:	 1.044142 
-current radius:	 0.5736396 	inefficiency:	 1.044142 
-current radius:	 0.5735989 	inefficiency:	 1.044142 
-current radius:	 0.5736803 	inefficiency:	 1.044142 
-current radius:	 0.5736396 	inefficiency:	 1.044142 
-$rho
-[1] 0.5
-
-$leastFavorableRadius
-[1] 0.5736396
-
-$`asMSE-inefficiency`
-[1] 1.044142
-
-> 
-> 
-> 
-> cleanEx()
-> nameEx("lowerCaseRadius")
-> ### * lowerCaseRadius
-> 
-> flush(stderr()); flush(stdout())
-> 
-> ### Name: lowerCaseRadius
-> ### Title: Computation of the lower case radius
-> ### Aliases: lowerCaseRadius lowerCaseRadius-methods
-> ###   lowerCaseRadius,L2ParamFamily,ContNeighborhood,asMSE,ANY-method
-> ###   lowerCaseRadius,L2ParamFamily,TotalVarNeighborhood,asMSE,ANY-method
-> ###   lowerCaseRadius,L2ParamFamily,ContNeighborhood,asMSE,onesidedBias-method
-> ###   lowerCaseRadius,UnivariateDistribution,ContNeighborhood,asMSE,onesidedBias-method
-> ###   lowerCaseRadius,L2ParamFamily,ContNeighborhood,asMSE,asymmetricBias-method
-> ### Keywords: robust
-> 
-> ### ** Examples
-> 
-> lowerCaseRadius(BinomFamily(size = 10), ContNeighborhood(), asMSE())
-lower case radius 
-         0.690335 
-> lowerCaseRadius(BinomFamily(size = 10), TotalVarNeighborhood(), asMSE())
-lower case radius 
-        0.3451675 
-> 
-> 
-> 
-> cleanEx()
-> nameEx("optIC")
-> ### * optIC
-> 
-> flush(stderr()); flush(stdout())
-> 
-> ### Name: optIC
-> ### Title: Generic function for the computation of optimally robust ICs
-> ### Aliases: optIC optIC-methods optIC,InfRobModel,asRisk-method
-> ###   optIC,InfRobModel,asUnOvShoot-method
-> ###   optIC,FixRobModel,fiUnOvShoot-method
-> ### Keywords: robust
-> 
-> ### ** Examples
-> 
-> B <- BinomFamily(size = 25, prob = 0.25) 
-> 
-> ## classical optimal IC
-> IC0 <- optIC(model = B, risk = asCov())
-> plot(IC0) # plot IC
-> checkIC(IC0, B)
-precision of centering:	 -4.254490e-18 
-precision of Fisher consistency:
-             prob
-prob 2.220446e-16
-maximum deviation 
-     2.220446e-16 
-> 
-> 
-> 
-> cleanEx()
-> nameEx("optRisk")
-> ### * optRisk
-> 
-> flush(stderr()); flush(stdout())
-> 
-> ### Name: optRisk
-> ### Title: Generic function for the computation of the minimal risk
-> ### Aliases: optRisk optRisk-methods optRisk,L2ParamFamily,asCov-method
-> ###   optRisk,InfRobModel,asRisk-method
-> ###   optRisk,FixRobModel,fiUnOvShoot-method
-> ### Keywords: robust
-> 
-> ### ** Examples
-> 
-> optRisk(model = NormLocationScaleFamily(), risk = asCov())
-$asCov
-     mean  sd
-mean    1 0.0
-sd      0 0.5
-
-> 
-> 
-> 
-> cleanEx()
-> nameEx("radiusMinimaxIC")
-> ### * radiusMinimaxIC
-> 
-> flush(stderr()); flush(stdout())
-> 
-> ### Name: radiusMinimaxIC
-> ### Title: Generic function for the computation of the radius minimax IC
-> ### Aliases: radiusMinimaxIC radiusMinimaxIC-methods
-> ###   radiusMinimaxIC,L2ParamFamily,UncondNeighborhood,asGRisk-method
-> ### Keywords: robust
-> 
-> ### ** Examples
-> 
-> N <- NormLocationFamily(mean=0, sd=1) 
-> radIC <- radiusMinimaxIC(L2Fam=N, neighbor=ContNeighborhood(), 
-+                          risk=asMSE(), loRad=0.1, upRad=0.5)
-> checkIC(radIC)
-precision of centering:	 -8.135927e-16 
-precision of Fisher consistency:
-              mean
-mean -3.502745e-06
-maximum deviation 
-     3.502745e-06 
-> 
-> 
-> 
-> cleanEx()
-> nameEx("roptest")
-> ### * roptest
-> 
-> flush(stderr()); flush(stdout())
-> 
-> ### Name: roptest
-> ### Title: Optimally robust estimation
-> ### Aliases: roptest
-> ### Keywords: robust
-> 
-> ### ** Examples
-> 
-> #############################
-> ## 1. Binomial data
-> #############################
-> ## generate a sample of contaminated data
-> ind <- rbinom(100, size=1, prob=0.05) 
-> x <- rbinom(100, size=25, prob=(1-ind)*0.25 + ind*0.9)
-> 
-> ## ML-estimate
-> MLest <- MLEstimator(x, BinomFamily(size = 25))
-> estimate(MLest)
-[1] 0.2684
-> confint(MLest)
-A[n] asymptotic (CLT-based) confidence interval:
-         2.5 %    97.5 %
-[1,] 0.2510297 0.2857703
-Type of estimator: Maximum likelihood estimate
-samplesize:   100
-Call by which estimate was produced:
-MLEstimator(x = x, ParamFamily = BinomFamily(size = 25))
-Fixed part of the parameter at which estimate was produced:
-size 
-  25 
-> 
-> ## compute optimally robust estimator (known contamination)
-> robest1 <- roptest(x, BinomFamily(size = 25), eps = 0.05, steps = 3)
-> estimate(robest1)
-     prob 
-0.2564327 
-> confint(robest1, method = symmetricBias())
-A[n] asymptotic (LAN-based), uniform (bias-aware)
- confidence interval:
-for symmetric Bias
-        2.5 %    97.5 %
-prob 0.237641 0.2752245
-Type of estimator: 3-step estimate
-samplesize:   100
-Call by which estimate was produced:
-roptest(x = x, L2Fam = BinomFamily(size = 25), eps = 0.05, steps = 3)
-Fixed part of the parameter at which estimate was produced:
-size 
-  25 
-> ## neglecting bias
-> confint(robest1)
-A[n] asymptotic (LAN-based) confidence interval:
-         2.5 %    97.5 %
-prob 0.2382143 0.2746511
-Type of estimator: 3-step estimate
-samplesize:   100
-Call by which estimate was produced:
-roptest(x = x, L2Fam = BinomFamily(size = 25), eps = 0.05, steps = 3)
-Fixed part of the parameter at which estimate was produced:
-size 
-  25 
-> plot(pIC(robest1))
-> qq1 <- qqplot(x, robest1, cex.pch=1.5, exp.cex2.pch = -.25,
-+               exp.fadcol.pch = .55, jit.fac=.9)
-> str(qq1)
-List of 2
- $ x: num [1:100] 2 2.86 2.95 3.07 3.13 ...
- $ y: num [1:100] 0.856 1.838 1.863 2.854 2.986 ...
-> 
-> ## compute optimally robust estimator (unknown contamination)
-> robest2 <- roptest(x, BinomFamily(size = 25), eps.lower = 0, eps.upper = 0.2, steps = 3)
-> estimate(robest2)
-     prob 
-0.2564060 
-> confint(robest2, method = symmetricBias())
-A[n] asymptotic (LAN-based), uniform (bias-aware)
- confidence interval:
-for symmetric Bias
-         2.5 %    97.5 %
-prob 0.2375772 0.2752347
-Type of estimator: 3-step estimate
-samplesize:   100
-Call by which estimate was produced:
-roptest(x = x, L2Fam = BinomFamily(size = 25), eps.lower = 0, 
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/robast -r 1220


More information about the Robast-commits mailing list