[Robast-commits] r124 - 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 18:57:59 CEST 2008


Author: stamats
Date: 2008-07-24 18:57:59 +0200 (Thu, 24 Jul 2008)
New Revision: 124

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

Modified: branches/robast-0.6/pkg/ROptEst/inst/scripts/UnderOverShootRisk.R
===================================================================
--- branches/robast-0.6/pkg/ROptEst/inst/scripts/UnderOverShootRisk.R	2008-07-24 14:59:51 UTC (rev 123)
+++ branches/robast-0.6/pkg/ROptEst/inst/scripts/UnderOverShootRisk.R	2008-07-24 16:57:59 UTC (rev 124)
@@ -12,10 +12,10 @@
 N0.Rob1 <- InfRobModel(center = N0, neighbor = ContNeighborhood(radius = 0))
 N0.Rob2 <- InfRobModel(center = N0, neighbor = TotalVarNeighborhood(radius = 0))
 
-system.time(IC0c <- optIC(model=N0.Rob1, risk=asUnOvShoot(width = tau)), gcFirst = TRUE)
+system.time(IC0c <- optIC(model=N0.Rob1, risk=asUnOvShoot(width = tau)))
 checkIC(IC0c)
 Risks(IC0c)
-system.time(IC0v <- optIC(model=N0.Rob2, risk=asUnOvShoot(width = tau)), gcFirst = TRUE)
+system.time(IC0v <- optIC(model=N0.Rob2, risk=asUnOvShoot(width = tau)))
 checkIC(IC0v)
 Risks(IC0v)
 
@@ -23,22 +23,22 @@
 N0.Rob1 <- InfRobModel(center = N0, neighbor = ContNeighborhood(radius = 2*tau*1/sqrt(2*pi)))
 N0.Rob2 <- InfRobModel(center = N0, neighbor = TotalVarNeighborhood(radius = tau*1/sqrt(2*pi)))
 
-system.time(IC0c <- optIC(model=N0.Rob1, risk=asUnOvShoot(width = tau)), gcFirst = TRUE)
+system.time(IC0c <- optIC(model=N0.Rob1, risk=asUnOvShoot(width = tau)))
 checkIC(IC0c)
 Risks(IC0c)
-system.time(IC0v <- optIC(model=N0.Rob2, risk=asUnOvShoot(width = tau)), gcFirst = TRUE)
+system.time(IC0v <- optIC(model=N0.Rob2, risk=asUnOvShoot(width = tau)))
 checkIC(IC0v)
 Risks(IC0v)
 
 
-# L_2 family + infinitesimal resp. fixed neighborhood
+## L_2 family + infinitesimal resp. fixed neighborhood
 rad <- 0.5
 N0.Rob1 <- InfRobModel(center = N0, neighbor = ContNeighborhood(radius = rad))
 N0.Rob2 <- InfRobModel(center = N0, neighbor = TotalVarNeighborhood(radius = rad/2))
 N0.Rob3 <- FixRobModel(center = N0, neighbor = ContNeighborhood(radius = rad/sqrt(n)))
 N0.Rob4 <- FixRobModel(center = N0, neighbor = TotalVarNeighborhood(radius = rad/2/sqrt(n)))
 
-# asUnOvShoot solution
+## asUnOvShoot solution
 N0.IC1 <- optIC(model = N0.Rob1, risk = asUnOvShoot(width = tau))
 checkIC(N0.IC1)
 Risks(N0.IC1)
@@ -49,7 +49,7 @@
 Risks(N0.IC2)
 plot(N0.IC2)
 
-# fiUnOvShoot solution
+## fiUnOvShoot solution
 N0.IC3 <- optIC(model=N0.Rob3, risk=fiUnOvShoot(width = tau/sqrt(n)), sampleSize = n)
 checkIC(N0.IC3)
 Risks(N0.IC3)
@@ -60,8 +60,8 @@
 Risks(N0.IC4)
 plot(N0.IC4)
 
-# O(n^(-0.5))-corrected solution 
-# in case of contamination neighborhoods
+## O(n^(-0.5))-corrected solution 
+## in case of contamination neighborhoods
 N0.IC5 <- N0.IC1
 clipUp1 <- clipUp(N0.IC1)/as.vector(stand(N0.IC1))
 clipUp5 <- max(0, clipUp1 - rad*(rad + clipUp1*tau)/(sqrt(n)*2*tau*pnorm(-clipUp1)))
@@ -75,8 +75,8 @@
 getRiskIC(N0.IC5, asUnOvShoot(width = tau), ContNeighborhood(radius=rad))
 getRiskIC(N0.IC5, fiUnOvShoot(width = tau/sqrt(n)), ContNeighborhood(radius=rad/sqrt(n)), sampleSize = n)
 
-# O(n^(-1))-corrected solution 
-# in case of total variation neighborhoods
+## O(n^(-1))-corrected solution 
+## in case of total variation neighborhoods
 N0.IC6 <- N0.IC2
 clipUp2 <- clipUp(N0.IC2)/as.vector(stand(N0.IC2))
 clipUp6 <- max(0, clipUp2 - tau*(2*clipUp2^2*rad/2 + tau*dnorm(clipUp2))/(6*n*pnorm(-clipUp2)))
@@ -99,25 +99,25 @@
 
 ## 2. M estimation
 N0.Rob5 <- InfRobModel(center = NormLocationFamily(mean = 0), 
-                neighbor = ContNeighborhood(radius = 0.5))
+                       neighbor = ContNeighborhood(radius = 0.5))
 N0.IC7 <- optIC(model=N0.Rob5, risk=asUnOvShoot(width = 1.960))
 (Mest1 <- locMEstimator(X, IC=N0.IC7))
 
 N0.Rob6 <- FixRobModel(center = NormLocationFamily(mean = 0), 
-                neighbor = ContNeighborhood(radius = 0.05))
-N0.IC8 <- optIC(model = N0.Rob6, risk=fiUnOvShoot(width = 0.196), sampleSize = 1e2)
+                       neighbor = ContNeighborhood(radius = 0.05))
+N0.IC8 <- optIC(model = N0.Rob6, risk=fiUnOvShoot(width = 1.960/sqrt(n)), sampleSize = 1e2)
 (Mest2 <- locMEstimator(X, IC=N0.IC8))
 
 
 ## 3. Kolmogorov(-Smirnov) minimum distance estimator
-(est0 <- ksEstimator(x=X, Norm(), param = "mean"))
+(est0 <- MDEstimator(x=X, NormLocationFamily(), interval = c(-5, 5)))
 
 ## 4. one-step estimation
-N0.Rob7 <- InfRobModel(center = NormLocationFamily(mean = est0$mean), 
-                neighbor = ContNeighborhood(radius=0.5))
+N0.Rob7 <- InfRobModel(center = NormLocationFamily(mean = est0$estimate), 
+                       neighbor = ContNeighborhood(radius=0.5))
 N0.IC9 <- optIC(model=N0.Rob7, risk=asUnOvShoot(width = 1.960))
-(est1 <- oneStepEstimator(X, IC = N0.IC9, start = est0$mean))
-N0.Rob8 <- FixRobModel(center = NormLocationFamily(mean = est0$mean), 
-                neighbor = ContNeighborhood(radius=0.05))
-N0.IC10 <- optIC(model=N0.Rob8, risk=fiUnOvShoot(width = 0.196), sampleSize = 1e2)
-(est2 <- oneStepEstimator(X, IC = N0.IC10, start = est0$mean))
+(est1 <- oneStepEstimator(X, IC = N0.IC9, start = est0$estimate))
+N0.Rob8 <- FixRobModel(center = NormLocationFamily(mean = est0$estimate), 
+                       neighbor = ContNeighborhood(radius=0.05))
+N0.IC10 <- optIC(model=N0.Rob8, risk=fiUnOvShoot(width = 1.960/sqrt(n)), sampleSize = 1e2)
+(est2 <- oneStepEstimator(X, IC = N0.IC10, start = est0$estimate))



More information about the Robast-commits mailing list