[Robast-commits] r207 - pkg/ROptEst/inst/scripts

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Nov 3 09:23:11 CET 2008


Author: stamats
Date: 2008-11-03 09:23:11 +0100 (Mon, 03 Nov 2008)
New Revision: 207

Modified:
   pkg/ROptEst/inst/scripts/PoissonModel.R
Log:
added confidence interval, seems to work correctly ...

Modified: pkg/ROptEst/inst/scripts/PoissonModel.R
===================================================================
--- pkg/ROptEst/inst/scripts/PoissonModel.R	2008-11-03 07:57:57 UTC (rev 206)
+++ pkg/ROptEst/inst/scripts/PoissonModel.R	2008-11-03 08:23:11 UTC (rev 207)
@@ -159,6 +159,7 @@
 (est214 <- kStepEstimator(x, IC=IC10, start=est12, steps = 3L))
 checkIC(pIC(est214))
 
+## Its simpler to use roptest!
 (est215 <- roptest(x, PoisFamily(), eps.upper = 1/sqrt(length(x)), steps = 3L))
 checkIC(pIC(est215))
 
@@ -169,7 +170,14 @@
 estimate(est214)
 estimate(est215)
 
+## confidence intervals
+confint(est211, symmetricBias())
+confint(est212, symmetricBias())
+confint(est213, symmetricBias())
+confint(est214, symmetricBias())
+confint(est215, symmetricBias())
 
+
 ## 2.2 amount of contamination unknown
 IC11 <- radiusMinimaxIC(L2Fam=PoisFamily(lambda=estimate(est11)),
                 neighbor=ContNeighborhood(), risk=asMSE(), loRad=0, upRad=Inf)
@@ -188,6 +196,7 @@
 (est224 <- kStepEstimator(x, IC=IC12, start=est12, steps = 3L))
 checkIC(pIC(est224))
 
+## Its simpler to use roptest!
 (est225 <- roptest(x, PoisFamily(), eps.upper = 0.5, steps = 3L))
 checkIC(pIC(est225))
 
@@ -198,6 +207,12 @@
 estimate(est224)
 estimate(est225)
 
+## confidence intervals
+confint(est221, symmetricBias())
+confint(est222, symmetricBias())
+confint(est223, symmetricBias())
+confint(est224, symmetricBias())
+confint(est225, symmetricBias())
 
 ## 3. k-step estimation: total variation neighborhood
 ## 3.1 small amount of contamination < 2%
@@ -219,6 +234,7 @@
 (est314 <- kStepEstimator(x, IC=IC14, start=est12, steps = 3L))
 checkIC(pIC(est314))
 
+## Its simpler to use roptest!
 (est315 <- roptest(x, PoisFamily(), eps.upper = 1/sqrt(length(x)), steps = 3L, 
                    neighbor = TotalVarNeighborhood()))
 checkIC(pIC(est315))
@@ -230,7 +246,14 @@
 estimate(est314)
 estimate(est315)
 
+## confidence intervals
+confint(est311, symmetricBias())
+confint(est312, symmetricBias())
+confint(est313, symmetricBias())
+confint(est314, symmetricBias())
+confint(est315, symmetricBias())
 
+
 ## 3.2 amount of contamination unknown
 IC15 <- radiusMinimaxIC(L2Fam=PoisFamily(lambda=estimate(est11)),
                 neighbor=TotalVarNeighborhood(), risk=asMSE(), loRad=0, upRad=Inf)
@@ -249,6 +272,7 @@
 (est324 <- kStepEstimator(x, IC=IC16, start=est12, steps = 3L))
 checkIC(pIC(est324))
 
+## Its simpler to use roptest!
 (est325 <- roptest(x, PoisFamily(), eps.upper = 0.5, steps = 3L, 
                    neighbor = TotalVarNeighborhood()))
 checkIC(pIC(est325))
@@ -260,4 +284,11 @@
 estimate(est324)
 estimate(est325)
 
+## confidence intervals
+confint(est321, symmetricBias())
+confint(est322, symmetricBias())
+confint(est323, symmetricBias())
+confint(est324, symmetricBias())
+confint(est325, symmetricBias())
+
 distroptions("TruncQuantile", 1e-5) # default



More information about the Robast-commits mailing list