[Robast-commits] r120 - branches/robast-0.6/pkg/ROptEst/inst/scripts

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jul 24 12:47:51 CEST 2008


Author: stamats
Date: 2008-07-24 12:47:50 +0200 (Thu, 24 Jul 2008)
New Revision: 120

Modified:
   branches/robast-0.6/pkg/ROptEst/inst/scripts/PoissonModel.R
Log:
adapted to new implementation

Modified: branches/robast-0.6/pkg/ROptEst/inst/scripts/PoissonModel.R
===================================================================
--- branches/robast-0.6/pkg/ROptEst/inst/scripts/PoissonModel.R	2008-07-24 10:32:26 UTC (rev 119)
+++ branches/robast-0.6/pkg/ROptEst/inst/scripts/PoissonModel.R	2008-07-24 10:47:50 UTC (rev 120)
@@ -12,14 +12,14 @@
 plot(P) # plot of Pois(lambda = 4.5) and L_2 derivative
 checkL2deriv(P)
 
-# classical optimal IC
+## classical optimal IC
 IC0 <- optIC(model = P, risk = asCov())
 IC0       # show IC
 checkIC(IC0)
 Risks(IC0)
 plot(IC0) # plot IC
 
-# L_2 family + infinitesimal neighborhood
+## L_2 family + infinitesimal neighborhood
 RobP1 <- InfRobModel(center = P, neighbor = ContNeighborhood(radius = 0.5))
 RobP1     # show RobP1
 (RobP2 <- InfRobModel(center = P, neighbor = TotalVarNeighborhood(radius = 0.5)))
@@ -28,7 +28,7 @@
 lowerCaseRadius(L2Fam = P, ContNeighborhood(radius = 0.5), risk = asMSE())
 lowerCaseRadius(L2Fam = P, TotalVarNeighborhood(radius = 0.5), risk = asMSE())
 
-# MSE solution
+## MSE solution
 (IC1 <- optIC(model=RobP1, risk=asMSE()))
 checkIC(IC1)
 Risks(IC1)
@@ -50,14 +50,14 @@
 plot(IC2)
 
 
-# lower case solutions
+## lower case solutions
 (IC3 <- optIC(model=RobP1, risk=asBias()))
 checkIC(IC3)
 Risks(IC3)
 plot(IC3)
 
 (IC3.p <- optIC(model=RobP1, risk=asBias(biastype=positiveBias())))
-checkIC(IC3.p)
+checkIC(IC3.p) # numerical problem???
 Risks(IC3.p)
 plot(IC3.p)
 
@@ -72,7 +72,7 @@
 Risks(IC4)
 plot(IC4)
 
-# Hampel solution
+## Hampel solution
 (IC5 <- optIC(model=RobP1, risk=asHampel(bound=clip(IC1))))
 checkIC(IC5)
 Risks(IC5)
@@ -84,7 +84,7 @@
 plot(IC6)
 
 
-# radius minimax IC
+## radius minimax IC
 (IC7 <- radiusMinimaxIC(L2Fam=P, neighbor=ContNeighborhood(), 
                 risk=asMSE(), loRad=0, upRad=0.5))
 checkIC(IC7)
@@ -109,8 +109,8 @@
 Risks(IC8)
 plot(IC8)
 
-# least favorable radius
-# (may take quite some time!)
+## least favorable radius
+## (may take quite some time!)
 (r.rho1 <- leastFavorableRadius(L2Fam=P, neighbor=ContNeighborhood(),
                     risk=asMSE(), rho=0.5))
 (r.rho2 <- leastFavorableRadius(L2Fam=P, neighbor=TotalVarNeighborhood(),
@@ -122,21 +122,21 @@
 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))
-       
+
 ## 0. mean (classical optimal)
 (est0 <- mean(x))
 
 ## 1. Kolmogorov(-Smirnov) minimum distance estimator
-(est1 <- ksEstimator(x=x, Pois()))
+(est1 <- MDEstimator(x=x, PoisFamily(), interval = c(0, 10)))
 
 ## 2. one-step estimation: radius interval
 ## 2.1 small amount of contamination < 2%
-IC9 <- radiusMinimaxIC(L2Fam=PoisFamily(lambda=est1$lambda),
+IC9 <- radiusMinimaxIC(L2Fam=PoisFamily(lambda=est1$estimate),
                 neighbor=ContNeighborhood(), risk=asMSE(), loRad=0, upRad=1)
-(est21 <- oneStepEstimator(x, IC=IC9, start=est1$lambda))
+(est21 <- oneStepEstimator(x, IC=IC9, start=est1$estimate))
 ## 2.2 amount of contamination unknown
-IC10 <- radiusMinimaxIC(L2Fam=PoisFamily(lambda=est1$lambda),
+IC10 <- radiusMinimaxIC(L2Fam=PoisFamily(lambda=est1$estimate),
                 neighbor=ContNeighborhood(), risk=asMSE(), loRad=0, upRad=Inf)
-(est22 <- oneStepEstimator(x, IC=IC10, start=est1$lambda))
+(est22 <- oneStepEstimator(x, IC=IC10, start=est1$estimate))
 
 distroptions("TruncQuantile", 1e-5) # default



More information about the Robast-commits mailing list