[Robast-commits] r388 - in branches/robast-0.7/pkg/ROptEst: . tests tests/Examples

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Oct 16 12:09:12 CEST 2009


Author: stamats
Date: 2009-10-16 12:09:11 +0200 (Fri, 16 Oct 2009)
New Revision: 388

Added:
   branches/robast-0.7/pkg/ROptEst/tests/
   branches/robast-0.7/pkg/ROptEst/tests/Examples/
   branches/robast-0.7/pkg/ROptEst/tests/Examples/ROptEst-Ex.Rout.save
Log:
forgot to add tests folder ... argh

Added: branches/robast-0.7/pkg/ROptEst/tests/Examples/ROptEst-Ex.Rout.save
===================================================================
--- branches/robast-0.7/pkg/ROptEst/tests/Examples/ROptEst-Ex.Rout.save	                        (rev 0)
+++ branches/robast-0.7/pkg/ROptEst/tests/Examples/ROptEst-Ex.Rout.save	2009-10-16 10:09:11 UTC (rev 388)
@@ -0,0 +1,1958 @@
+
+R version 2.10.0 beta (2009-10-15 r50107)
+Copyright (C) 2009 The R Foundation for Statistical Computing
+ISBN 3-900051-07-0
+
+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.
+
+> ### * <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"))
+> options(warn = 1)
+> library('ROptEst')
+Loading required package: distr
+Loading required package: startupmsg
+:startupmsg>  Utilities for start-up messages (version 0.7)
+: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.4)
+: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 orientated implementation of distributions (version
+:distr>  2.2)
+: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.2)
+: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.7)
+: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 orientated implementation of probability models
+:distrMod>  (version 2.2)
+: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>  Package "distrDoc" provides a vignette to this package
+: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 
+
+Loading required package: RobAStBase
+:RobAStBase>  Robust Asymptotic Statistics (version 0.7)
+: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')
+> assign(".oldNS", loadedNamespaces(), 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.908322 
+> ## check influence curve
+> checkIC(pIC(robest))
+precision of centering:	 2.6415e-16 
+precision of Fisher consistency:
+              lambda
+lambda -1.968972e-06
+maximum deviation 
+     1.968972e-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
+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.759634 4.05701
+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("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("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 2.326918e-06
+maximum deviation 
+     2.326918e-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.2564328 
+> 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
+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.2382146 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))
+> 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
+
+> 
+> ## 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 
+> 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
+Type of estimator: 3-step estimate
+samplesize:   100
+Call by which estimate was produced:
+roptest(x = x, L2Fam = BinomFamily(size = 25), eps.lower = 0, 
+    eps.upper = 0.2, steps = 3)
+Fixed part of the parameter at which estimate was produced:
+size 
+  25 
+> plot(pIC(robest2))
+> 
+> ## total variation neighborhoods (known deviation)
+> robest3 <- roptest(x, BinomFamily(size = 25), eps = 0.025, 
++                    neighbor = TotalVarNeighborhood(), steps = 3)
+> estimate(robest3)
+     prob 
+0.2563266 
+> 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
+Type of estimator: 3-step estimate
+samplesize:   100
+Call by which estimate was produced:
+roptest(x = x, L2Fam = BinomFamily(size = 25), eps = 0.025, neighbor = TotalVarNeighborhood(), 
+    steps = 3)
+Fixed part of the parameter at which estimate was produced:
+size 
+  25 
+> plot(pIC(robest3))
+> 
+> ## total variation neighborhoods (unknown deviation)
+> robest4 <- roptest(x, BinomFamily(size = 25), eps.lower = 0, eps.upper = 0.1, 
++                    neighbor = TotalVarNeighborhood(), steps = 3)
+> estimate(robest4)
+     prob 
+0.2561783 
+> 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
+Type of estimator: 3-step estimate
+samplesize:   100
+Call by which estimate was produced:
+roptest(x = x, L2Fam = BinomFamily(size = 25), eps.lower = 0, 
+    eps.upper = 0.1, neighbor = TotalVarNeighborhood(), steps = 3)
+Fixed part of the parameter at which estimate was produced:
+size 
+  25 
+> plot(pIC(robest4))
+> 
+> 
+> #############################
+> ## 2. Poisson data
+> #############################
+> ## 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
+> MLest <- MLEstimator(x, PoisFamily())
+> estimate(MLest)
+[1] 3.871549
+> 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 robust estimator (unknown contamination)
+> robest <- roptest(x, PoisFamily(), eps.upper = 0.1, steps = 3)
+> estimate(robest)
+  lambda 
+3.908322 
+> 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
+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
+ [256]  1.1690301398  1.1709252868  1.1712366459  1.1778089963  1.1785475723
+ [261]  1.8204732764  1.8217159203  1.8220619154  1.8234458451  1.8235353754
+ [266]  1.8240824695  1.8242335045  1.8247194981  1.8259803959  1.8264647887
+ [271]  1.8275642634  1.8287305357  1.8298992364  1.8302214558  1.8314167534
+ [276]  1.8323979540  1.8324809808  1.8329114484  1.8330305607  1.8334325633
+ [281]  1.8340760199  1.8341064984  1.8341296256  1.8353565628  1.8354389211
+ [286]  1.8364301152  1.8365745974  1.8382776193  1.8382829313  1.8385743163
+ [291]  1.8389852783  1.8408555444  1.8415640868  1.8423093323  1.8426030066
+ [296]  1.8436887071  1.8439375001  1.8439673770  1.8462756389  1.8463688731
+ [301]  1.8474894006  1.8476356853  1.8485982895  1.8505715813  1.8509426902
+ [306]  1.8511023351  1.8537139469  1.8626083690  1.8629351539  1.8633016121
+ [311]  1.8637297387  1.8644344077  1.8652625197  1.8662832835  1.8677330875
+ [316]  1.8681444229  1.8683011182  1.8684248718  1.8695829022  1.8717634210
+ [321]  1.8727622634  1.8733361133  1.8733950716  1.8749603235  1.8767367499
+ [326]  1.8769591188  1.8775225362  1.8781746053  1.8786758882  1.8793608127
+ [331]  1.8795494441  1.8800163800  1.8803774929  1.8828782044  1.8839582308
+ [336]  1.8840461893  1.8840618859  1.8875681647  1.8876482538  1.8877227997
+ [341]  1.8877387876  1.8888534042  1.8892271707  1.8906684209  1.8930484684
+ [346]  1.8938831355  1.8942124181  1.8948940448  1.8951082311  1.8984160829
+ [351]  1.8992087852  1.9005563803  1.9010480251  1.9012742605  1.9029661751
+ [356]  1.9045696850  1.9054153473  1.9059453211  1.9062694022  1.9064443728
+ [361]  1.9073838774  1.9092419052  1.9130968269  1.9138533916  1.9144755892
+ [366]  1.9145133773  1.9152634260  1.9155932192  1.9157279268  1.9176939555
+ [371]  1.9178774602  1.9181667092  1.9182009139  1.9183718870  1.9196035363
+ [376]  1.9215690668  1.9220517955  1.9240112496  1.9252393022  1.9267345273
+ [381]  1.9271700044  1.9273381506  1.9288752794  1.9300507191  1.9312144634
+ [386]  1.9323331110  1.9370939655  1.9381368730  1.9390405114  1.9395937806
+ [391]  1.9400979854  1.9408684247  1.9410955780  1.9419045590  1.9433876507
+ [396]  1.9435531289  1.9452610885  1.9453753044  1.9455466912  1.9456205729
+ [401]  1.9466000197  1.9472908871  1.9485009776  1.9485849387  1.9491067149
+ [406]  1.9497562556  1.9504273820  1.9521103555  1.9528701046  1.9573875734
+ [411]  1.9579820217  1.9581457537  1.9589958679  1.9593644916  1.9631741931
+ [416]  1.9635124504  1.9643036342  1.9645198832  1.9667773469  1.9680159552
+ [421]  1.9697096891  1.9711903952  1.9717205890  1.9721342569  1.9724810306
+ [426]  1.9726952694  1.9733953163  1.9742049205  1.9742511371  1.9753241527
+ [431]  1.9757983269  1.9761686343  1.9765642240  1.9765978973  1.9777366630
+ [436]  1.9778744244  1.9791235228  1.9791770324  1.9791782087  1.9814338874
+ [441]  1.9836555579  1.9842110242  1.9842828375  1.9865828989  1.9889764535
+ [446]  1.9892463024  1.9900956516  1.9901209215  1.9904611154  1.9906616348
+ [451]  1.9918867559  1.9919821668  1.9931476305  1.9959921136  1.9963072301
+ [456]  1.9963865439  1.9964102330  1.9973777006  1.9988066792  2.0005891198
[TRUNCATED]

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


More information about the Robast-commits mailing list