[Robast-commits] r444 - in pkg/ROptEst: . man tests/Examples
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Jan 5 20:09:20 CET 2011
Author: stamats
Date: 2011-01-05 20:09:20 +0100 (Wed, 05 Jan 2011)
New Revision: 444
Modified:
pkg/ROptEst/DESCRIPTION
pkg/ROptEst/man/roptest.Rd
pkg/ROptEst/tests/Examples/ROptEst-Ex.Rout.save
Log:
updated ROptEst-Ex.Rout.save files to R 2.12.1 patched, added 'Suggests: MASS, RobLox' to DESCRIPTION file, minor modification of roptest examples
Modified: pkg/ROptEst/DESCRIPTION
===================================================================
--- pkg/ROptEst/DESCRIPTION 2011-01-05 18:34:04 UTC (rev 443)
+++ pkg/ROptEst/DESCRIPTION 2011-01-05 19:09:20 UTC (rev 444)
@@ -6,6 +6,7 @@
classes and methods.
Depends: R(>= 2.7.0), methods, distr(>= 2.0), distrEx(>= 2.0), distrMod(>= 2.0), RandVar(>=
0.6.4), RobAStBase
+Suggests: MASS, RobLox
Author: Matthias Kohl, Peter Ruckdeschel
Maintainer: Matthias Kohl <Matthias.Kohl at stamats.de>
LazyLoad: yes
Modified: pkg/ROptEst/man/roptest.Rd
===================================================================
--- pkg/ROptEst/man/roptest.Rd 2011-01-05 18:34:04 UTC (rev 443)
+++ pkg/ROptEst/man/roptest.Rd 2011-01-05 19:09:20 UTC (rev 444)
@@ -169,8 +169,9 @@
## neglecting bias
confint(robest1)
plot(pIC(robest1))
-qqplot(x, robest1, cex.pch=1.5, exp.cex2.pch = -.25,
- exp.fadcol.pch = .55, jit.fac=.9)
+qq1 <- qqplot(x, robest1, cex.pch=1.5, exp.cex2.pch = -.25,
+ exp.fadcol.pch = .55, jit.fac=.9)
+str(qq1)
## compute optimally robust estimator (unknown contamination)
robest2 <- roptest(x, BinomFamily(size = 25), eps.lower = 0, eps.upper = 0.2, steps = 3)
@@ -211,8 +212,9 @@
estimate(robest)
confint(robest, symmetricBias())
plot(pIC(robest))
-qqplot(x, robest, cex.pch=1.5, exp.cex2.pch = -.25,
- exp.fadcol.pch = .55, jit.fac=.9)
+qq2 <- qqplot(x, robest, cex.pch=1.5, exp.cex2.pch = -.25,
+ exp.fadcol.pch = .55, jit.fac=.9)
+str(qq2)
## total variation neighborhoods (unknown deviation)
robest1 <- roptest(x, PoisFamily(), eps.upper = 0.05,
@@ -245,11 +247,12 @@
## plot of relative and absolute information; cf. Kohl (2005)
infoPlot(pIC(robest))
-qqplot(chem, robest, cex.pch=1.5, exp.cex2.pch = -.25,
- exp.fadcol.pch = .55, withLab = TRUE, which.Order=1:4,
- exp.cex2.lbl = .12,exp.fadcol.lbl = .45,
- nosym.pCI = TRUE, adj.lbl=c(1.7,.2),
- exact.pCI = FALSE, log ="xy")
+qq3 <- qqplot(chem, robest, cex.pch=1.5, exp.cex2.pch = -.25,
+ exp.fadcol.pch = .55, withLab = TRUE, which.Order=1:4,
+ exp.cex2.lbl = .12,exp.fadcol.lbl = .45,
+ nosym.pCI = TRUE, adj.lbl=c(1.7,.2),
+ exact.pCI = FALSE, log ="xy")
+str(qq3)
## finite-sample correction
if(require(RobLox)){
Modified: pkg/ROptEst/tests/Examples/ROptEst-Ex.Rout.save
===================================================================
--- pkg/ROptEst/tests/Examples/ROptEst-Ex.Rout.save 2011-01-05 18:34:04 UTC (rev 443)
+++ pkg/ROptEst/tests/Examples/ROptEst-Ex.Rout.save 2011-01-05 19:09:20 UTC (rev 444)
@@ -1,7 +1,8 @@
-R version 2.10.0 beta (2009-10-15 r50107)
-Copyright (C) 2009 The R Foundation for Statistical Computing
+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.
@@ -17,78 +18,13 @@
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
-> ### * <HEADER>
-> ###
-> attach(NULL, name = "CheckExEnv")
-> assign("nameEx",
-+ local({
-+ s <- "__{must remake R-ex/*.R}__"
-+ function(new) {
-+ if(!missing(new)) s <<- new else s
-+ }
-+ }),
-+ pos = "CheckExEnv")
-> ## Add some hooks to label plot pages for base and grid graphics
-> assign("base_plot_hook",
-+ function() {
-+ pp <- par(c("mfg","mfcol","oma","mar"))
-+ if(all(pp$mfg[1:2] == c(1, pp$mfcol[2]))) {
-+ outer <- (oma4 <- pp$oma[4]) > 0; mar4 <- pp$mar[4]
-+ mtext(sprintf("help(\"%s\")", nameEx()), side = 4,
-+ line = if(outer)max(1, oma4 - 1) else min(1, mar4 - 1),
-+ outer = outer, adj = 1, cex = .8, col = "orchid", las=3)
-+ }
-+ },
-+ pos = "CheckExEnv")
-> assign("grid_plot_hook",
-+ function() {
-+ grid::pushViewport(grid::viewport(width=grid::unit(1, "npc") -
-+ grid::unit(1, "lines"), x=0, just="left"))
-+ grid::grid.text(sprintf("help(\"%s\")", nameEx()),
-+ x=grid::unit(1, "npc") + grid::unit(0.5, "lines"),
-+ y=grid::unit(0.8, "npc"), rot=90,
-+ gp=grid::gpar(col="orchid"))
-+ },
-+ pos = "CheckExEnv")
-> setHook("plot.new", get("base_plot_hook", pos = "CheckExEnv"))
-> setHook("persp", get("base_plot_hook", pos = "CheckExEnv"))
-> setHook("grid.newpage", get("grid_plot_hook", pos = "CheckExEnv"))
-> assign("cleanEx",
-+ function(env = .GlobalEnv) {
-+ rm(list = ls(envir = env, all.names = TRUE), envir = env)
-+ RNGkind("default", "default")
-+ set.seed(1)
-+ options(warn = 1)
-+ .CheckExEnv <- as.environment("CheckExEnv")
-+ delayedAssign("T", stop("T used instead of TRUE"),
-+ assign.env = .CheckExEnv)
-+ delayedAssign("F", stop("F used instead of FALSE"),
-+ assign.env = .CheckExEnv)
-+ sch <- search()
-+ newitems <- sch[! sch %in% .oldSearch]
-+ for(item in rev(newitems))
-+ eval(substitute(detach(item), list(item=item)))
-+ missitems <- .oldSearch[! .oldSearch %in% sch]
-+ if(length(missitems))
-+ warning("items ", paste(missitems, collapse=", "),
-+ " have been removed from the search path")
-+ },
-+ pos = "CheckExEnv")
-> assign("ptime", proc.time(), pos = "CheckExEnv")
-> ## at least one package changes these via ps.options(), so do this
-> ## before loading the package.
-> ## Use postscript as incomplete files may be viewable, unlike PDF.
-> ## Choose a size that is close to on-screen devices, fix paper
-> grDevices::ps.options(width = 7, height = 7, paper = "a4", reset = TRUE)
-> grDevices::postscript("ROptEst-Ex.ps")
->
-> assign("par.postscript", graphics::par(no.readonly = TRUE), pos = "CheckExEnv")
-> options(contrasts = c(unordered = "contr.treatment", ordered = "contr.poly"))
+> 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)
+:startupmsg> Utilities for start-up messages (version 0.7.1)
:startupmsg>
:startupmsg> For more information see ?"startupmsg",
:startupmsg> NEWS("startupmsg")
@@ -96,7 +32,7 @@
Loading required package: sfsmisc
Loading required package: SweaveListingUtils
:SweaveListingUtils> Utilities for Sweave together with
-:SweaveListingUtils> TeX listings package (version 0.4)
+:SweaveListingUtils> TeX listings package (version 0.5)
:SweaveListingUtils>
:SweaveListingUtils> Some functions from package 'base'
:SweaveListingUtils> are intentionally masked ---see
@@ -117,14 +53,12 @@
Attaching package: 'SweaveListingUtils'
+The following object(s) are masked from 'package:base':
- The following object(s) are masked from package:base :
+ library, require
- library,
- require
-
-:distr> Object orientated implementation of distributions (version
-:distr> 2.2)
+: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
@@ -145,25 +79,21 @@
Attaching package: 'distr'
+The following object(s) are masked from 'package:stats':
- The following object(s) are masked from package:stats :
+ df, qqplot, sd
- 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':
- The following object(s) are masked from package:grDevices :
+ cm
- cm
-
-:distrEx> Extensions of package distr (version 2.2)
+:distrEx> Extensions of package distr (version 2.3)
:distrEx>
:distrEx> Note: Packages "e1071", "moments", "fBasics" should be
:distrEx> attached /before/ package "distrEx". See distrExMASK().
@@ -178,17 +108,13 @@
Attaching package: 'distrEx'
+The following object(s) are masked from 'package:stats':
- The following object(s) are masked from package:stats :
+ IQR, mad, median, var
- IQR,
- mad,
- median,
- var
-
Loading required package: distrMod
Loading required package: RandVar
-:RandVar> Implementation of random variables (version 0.7)
+:RandVar> Implementation of random variables (version 0.8)
:RandVar>
:RandVar> For more information see ?"RandVar", NEWS("RandVar"), as
:RandVar> well as
@@ -198,8 +124,8 @@
Loading required package: MASS
Loading required package: stats4
-:distrMod> Object orientated implementation of probability models
-:distrMod> (version 2.2)
+: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().
@@ -210,25 +136,30 @@
:distrMod> For more information see ?"distrMod",
:distrMod> NEWS("distrMod"), as well as
:distrMod> http://distr.r-forge.r-project.org/
-:distrMod> Package "distrDoc" provides a vignette to this package
+: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':
- The following object(s) are masked from package:stats4 :
+ confint
- confint
+The following object(s) are masked from 'package:stats':
+ confint
- The following object(s) are masked from package:stats :
+The following object(s) are masked from 'package:base':
- confint
+ norm
Loading required package: RobAStBase
-:RobAStBase> Robust Asymptotic Statistics (version 0.7)
+:RobAStBase> Robust Asymptotic Statistics (version 0.8)
:RobAStBase>
:RobAStBase> Some functions from pkg's 'stats' and 'graphics'
:RobAStBase> are intentionally masked ---see RobAStBaseMASK().
@@ -243,20 +174,18 @@
Attaching package: 'RobAStBase'
+The following object(s) are masked from 'package:stats':
- The following object(s) are masked from package:stats :
+ start
- start
+The following object(s) are masked from 'package:graphics':
+ clip
- The following object(s) are masked from package:graphics :
-
- clip
-
>
> assign(".oldSearch", search(), pos = 'CheckExEnv')
-> assign(".oldNS", loadedNamespaces(), pos = 'CheckExEnv')
-> cleanEx(); nameEx("0ROptEst-package")
+> cleanEx()
+> nameEx("0ROptEst-package")
> ### * 0ROptEst-package
>
> flush(stderr()); flush(stdout())
@@ -307,22 +236,22 @@
> robest <- roptest(x, PoisFamily(), eps.upper = 0.1, steps = 3)
> estimate(robest)
lambda
-3.908322
+3.908135
> ## check influence curve
> checkIC(pIC(robest))
-precision of centering: 2.6415e-16
+precision of centering: -2.707017e-08
precision of Fisher consistency:
lambda
-lambda -1.968972e-06
+lambda -1.980378e-06
maximum deviation
- 1.968972e-06
+ 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.826171 3.990474
+lambda 3.826169 3.990102
Type of estimator: 3-step estimate
samplesize: 2608
Call by which estimate was produced:
@@ -332,8 +261,8 @@
A[n] asymptotic (LAN-based), uniform (bias-aware)
confidence interval:
for symmetric Bias
- 2.5 % 97.5 %
-lambda 3.759634 4.05701
+ 2.5 % 97.5 %
+lambda 3.761616 4.054655
Type of estimator: 3-step estimate
samplesize: 2608
Call by which estimate was produced:
@@ -341,7 +270,149 @@
>
>
>
-> cleanEx(); nameEx("cniperCont")
+> 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())
@@ -386,7 +457,8 @@
>
>
>
-> cleanEx(); nameEx("getL1normL2deriv")
+> cleanEx()
+> nameEx("getL1normL2deriv")
> ### * getL1normL2deriv
>
> flush(stderr()); flush(stdout())
@@ -404,7 +476,8 @@
>
>
>
-> cleanEx(); nameEx("getL2normL2deriv")
+> cleanEx()
+> nameEx("getL2normL2deriv")
> ### * getL2normL2deriv
>
> flush(stderr()); flush(stdout())
@@ -420,7 +493,218 @@
>
>
>
-> cleanEx(); nameEx("leastFavorableRadius")
+> 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())
@@ -460,7 +744,8 @@
>
>
>
-> cleanEx(); nameEx("lowerCaseRadius")
+> cleanEx()
+> nameEx("lowerCaseRadius")
> ### * lowerCaseRadius
>
> flush(stderr()); flush(stdout())
@@ -486,7 +771,8 @@
>
>
>
-> cleanEx(); nameEx("optIC")
+> cleanEx()
+> nameEx("optIC")
> ### * optIC
>
> flush(stderr()); flush(stdout())
@@ -515,7 +801,8 @@
>
>
>
-> cleanEx(); nameEx("optRisk")
+> cleanEx()
+> nameEx("optRisk")
> ### * optRisk
>
> flush(stderr()); flush(stdout())
@@ -538,7 +825,8 @@
>
>
>
-> cleanEx(); nameEx("radiusMinimaxIC")
+> cleanEx()
+> nameEx("radiusMinimaxIC")
> ### * radiusMinimaxIC
>
> flush(stderr()); flush(stdout())
@@ -557,14 +845,15 @@
> checkIC(radIC)
precision of centering: -8.135927e-16
precision of Fisher consistency:
- mean
-mean 2.326918e-06
+ mean
+mean -3.502745e-06
maximum deviation
- 2.326918e-06
+ 3.502745e-06
>
>
>
-> cleanEx(); nameEx("roptest")
+> cleanEx()
+> nameEx("roptest")
> ### * roptest
>
> flush(stderr()); flush(stdout())
@@ -603,13 +892,13 @@
> robest1 <- roptest(x, BinomFamily(size = 25), eps = 0.05, steps = 3)
> estimate(robest1)
prob
-0.2564328
+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.2376412 0.2752244
+ 2.5 % 97.5 %
+prob 0.237641 0.2752245
Type of estimator: 3-step estimate
samplesize: 100
Call by which estimate was produced:
@@ -621,7 +910,7 @@
> confint(robest1)
A[n] asymptotic (LAN-based) confidence interval:
2.5 % 97.5 %
-prob 0.2382146 0.2746511
+prob 0.2382143 0.2746511
Type of estimator: 3-step estimate
samplesize: 100
Call by which estimate was produced:
@@ -630,56 +919,24 @@
size
25
> plot(pIC(robest1))
-> qqplot(x, robest1, cex.pch=1.5, exp.cex2.pch = -.25,
-+ exp.fadcol.pch = .55, jit.fac=.9)
-$x
- [1] 2.000000 2.859170 2.945003 3.072887 3.127441 3.867602 3.879563
- [8] 3.969417 3.974350 3.991833 3.999465 4.003945 4.006687 4.022602
- [15] 4.037292 4.114708 4.136915 4.173363 4.879410 4.885243 4.898712
- [22] 4.901497 4.909182 4.912744 4.930320 4.954232 5.002498 5.006047
- [29] 5.028207 5.091694 5.094311 5.094760 5.830003 5.859251 5.866496
- [36] 5.869906 5.871337 5.875739 5.914491 5.942393 5.957418 5.960428
- [43] 5.989444 5.994596 6.003645 6.008635 6.019764 6.053849 6.068266
- [50] 6.103515 6.152629 6.155848 6.159465 6.161268 6.836726 6.837265
- [57] 6.843205 6.867310 6.867319 6.885221 6.912581 6.916303 6.927515
- [64] 6.930985 6.935737 6.970428 6.974665 6.982979 6.985635 7.043348
- [71] 7.047311 7.078457 7.163208 7.856051 7.881048 7.889195 7.895933
- [78] 7.934172 7.935981 7.937725 7.954303 8.065319 8.147733 8.842397
- [85] 8.867768 8.880952 8.899670 8.912292 8.920068 8.954815 9.009832
- [92] 9.097465 9.156489 10.000000 11.068189 11.166108 11.916822 12.163344
- [99] 20.000000 24.000000
-
-$y
- [1] 0.8557009 1.8381583 1.8628049 2.8541488 2.9861587 2.9973346
- [7] 3.0625364 3.1545314 3.8446408 3.8708120 3.8834863 3.8895916
- [13] 3.9161963 3.9550780 3.9641619 4.0791690 4.1128367 4.1228866
- [19] 4.1767957 4.8499210 4.9164361 4.9324963 4.9473983 4.9660483
- [25] 4.9982006 5.0448971 5.0592626 5.0943746 5.1015856 5.1124298
- [31] 5.1278296 5.1632774 5.1689152 5.1750722 5.1785879 5.8477746
- [37] 5.8764171 5.8818480 5.8835227 5.9169458 5.9256980 5.9509309
- [43] 5.9529082 5.9583494 5.9637664 5.9793333 5.9889303 6.0151670
- [49] 6.0295939 6.0634191 6.1123673 6.1692584 6.1762199 6.8429689
- [55] 6.8496061 6.8592763 6.9196659 6.9218382 6.9399801 6.9705958
- [61] 6.9898951 6.9950137 7.0313327 7.0811459 7.1024366 7.1212236
- [67] 7.1214700 7.1252376 7.1391252 7.1731665 7.8456154 7.8837900
- [73] 7.8998530 7.9029679 7.9400675 7.9712777 7.9772952 7.9870265
- [79] 8.0223836 8.0715768 8.0730003 8.1313307 8.1542540 8.9035780
- [85] 8.9066922 8.9746968 8.9975947 9.0231350 9.0562184 9.1068610
- [91] 9.1194018 9.1722795 9.8608628 9.8717057 9.8730362 10.1667923
- [97] 10.8757464 11.0025328 11.1530828 11.9453887
-
+> 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.2563208
+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.2373697 0.2752720
+prob 0.2375772 0.2752347
Type of estimator: 3-step estimate
samplesize: 100
Call by which estimate was produced:
@@ -695,13 +952,13 @@
+ neighbor = TotalVarNeighborhood(), steps = 3)
> estimate(robest3)
prob
-0.2563266
+0.2563265
> confint(robest3, method = symmetricBias())
A[n] asymptotic (LAN-based), uniform (bias-aware)
confidence interval:
for symmetric Bias
2.5 % 97.5 %
-prob 0.2317268 0.2809265
+prob 0.2375738 0.2750792
Type of estimator: 3-step estimate
samplesize: 100
Call by which estimate was produced:
@@ -717,13 +974,13 @@
+ neighbor = TotalVarNeighborhood(), steps = 3)
> estimate(robest4)
prob
-0.2561783
+0.2563281
> confint(robest4, method = symmetricBias())
A[n] asymptotic (LAN-based), uniform (bias-aware)
confidence interval:
for symmetric Bias
2.5 % 97.5 %
-prob 0.2303988 0.2819579
+prob 0.2375777 0.2750785
Type of estimator: 3-step estimate
samplesize: 100
Call by which estimate was produced:
@@ -760,1081 +1017,37 @@
> robest <- roptest(x, PoisFamily(), eps.upper = 0.1, steps = 3)
> estimate(robest)
lambda
-3.908322
+3.908135
> confint(robest, symmetricBias())
A[n] asymptotic (LAN-based), uniform (bias-aware)
confidence interval:
for symmetric Bias
- 2.5 % 97.5 %
-lambda 3.759634 4.05701
+ 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)
> plot(pIC(robest))
-> qqplot(x, robest, cex.pch=1.5, exp.cex2.pch = -.25,
-+ exp.fadcol.pch = .55, jit.fac=.9)
-$x
- [1] -0.1793041795 -0.1759861769 -0.1650497656 -0.1612263552 -0.1604914454
- [6] -0.1566180292 -0.1547882355 -0.1539141720 -0.1492880379 -0.1421819501
- [11] -0.1354595166 -0.1284600289 -0.1216407305 -0.1187123112 -0.0860652946
- [16] -0.0848703421 -0.0741629524 -0.0691011184 -0.0559845383 -0.0513339317
- [21] -0.0480370981 -0.0467019431 -0.0436466014 -0.0339251104 -0.0276845006
- [26] -0.0235016493 -0.0210747085 -0.0206963610 -0.0088567486 -0.0087029861
- [31] -0.0064189536 -0.0019243706 0.0003061754 0.0053037550 0.0136313722
- [36] 0.0281382900 0.0373652645 0.0395096166 0.0568181049 0.0586839484
- [41] 0.0702044087 0.0741092423 0.0862710285 0.0891486229 0.1054472486
- [46] 0.1086075740 0.1162055900 0.1218182640 0.1365959866 0.1513864226
- [51] 0.1557258942 0.1568564884 0.1585111364 0.1593019161 0.1671541337
- [56] 0.1753566350 0.1777497214 0.8206612690 0.8229262439 0.8239729856
- [61] 0.8281868407 0.8305757796 0.8310723656 0.8326999961 0.8355585732
- [66] 0.8378752902 0.8398591431 0.8406541642 0.8409931813 0.8433641932
- [71] 0.8476829337 0.8538565200 0.8539804964 0.8542547681 0.8552110735
- [76] 0.8583933951 0.8615232369 0.8621911180 0.8623794204 0.8661980350
- [81] 0.8678180127 0.8682800816 0.8691355310 0.8730931763 0.8750037309
- [86] 0.8759444402 0.8770225444 0.8787107722 0.8791575668 0.8825149192
- [91] 0.8874734936 0.8883207704 0.8897622658 0.8909728169 0.8917991858
- [96] 0.8927138863 0.8965523245 0.9008669832 0.9064418583 0.9069685200
- [101] 0.9074643792 0.9107235271 0.9121536095 0.9199569112 0.9210700769
- [106] 0.9254615402 0.9286095774 0.9331126588 0.9337162284 0.9369514506
- [111] 0.9383477380 0.9407154735 0.9411203288 0.9412761912 0.9424837941
- [116] 0.9430515644 0.9446183559 0.9453607844 0.9454781263 0.9462252053
- [121] 0.9483909064 0.9502819066 0.9533115229 0.9535180736 0.9538464654
- [126] 0.9565396211 0.9567541329 0.9577016644 0.9597082560 0.9612517187
- [131] 0.9618216605 0.9629732560 0.9632237059 0.9636769201 0.9647909426
- [136] 0.9660845800 0.9669799935 0.9695144805 0.9706020370 0.9762511055
- [141] 0.9769515046 0.9821747574 0.9826629447 0.9854471484 0.9859222646
- [146] 0.9881614416 0.9900043129 0.9914276866 0.9927408860 0.9948419585
- [151] 0.9982230780 0.9992324987 1.0008102935 1.0061235375 1.0091099813
- [156] 1.0100975965 1.0117364390 1.0119018181 1.0139659478 1.0142063300
- [161] 1.0151125407 1.0192512533 1.0195037420 1.0223157134 1.0243674631
- [166] 1.0259812935 1.0316540557 1.0317039015 1.0318309085 1.0347214441
- [171] 1.0383187581 1.0435874658 1.0438383806 1.0444368554 1.0455957451
- [176] 1.0485552876 1.0496471404 1.0518786023 1.0525842197 1.0528045084
- [181] 1.0534783411 1.0546987396 1.0552057995 1.0557038353 1.0569007193
- [186] 1.0588033811 1.0603891459 1.0604982174 1.0633073538 1.0666387019
- [191] 1.0677790855 1.0682046519 1.0684924203 1.0690939620 1.0706309198
- [196] 1.0751464184 1.0752310714 1.0765144441 1.0772984619 1.0776999821
- [201] 1.0779722124 1.0819961217 1.0832937684 1.0837784864 1.0854299685
- [206] 1.0899357994 1.0905415005 1.0923921667 1.0931308505 1.0937127814
- [211] 1.0974353074 1.1000953104 1.1052563522 1.1075732378 1.1095806777
- [216] 1.1131306302 1.1156184345 1.1179783971 1.1182723695 1.1185123830
- [221] 1.1185567496 1.1188884534 1.1233323652 1.1235232534 1.1246484710
- [226] 1.1258045535 1.1258387574 1.1266003503 1.1287005533 1.1303322548
- [231] 1.1309070039 1.1322059634 1.1334899991 1.1346938779 1.1359281024
- [236] 1.1456367932 1.1462734941 1.1466249098 1.1489624711 1.1541439174
- [241] 1.1543598013 1.1558111337 1.1565136419 1.1577436900 1.1578289484
- [246] 1.1580892142 1.1591469674 1.1608544149 1.1616177439 1.1623423633
- [251] 1.1638528258 1.1640432767 1.1646099600 1.1647491475 1.1664399911
[TRUNCATED]
To get the complete diff run:
svnlook diff /svnroot/robast -r 444
More information about the Robast-commits
mailing list