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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Oct 24 11:33:45 CEST 2008


Author: stamats
Date: 2008-10-24 11:33:45 +0200 (Fri, 24 Oct 2008)
New Revision: 183

Modified:
   pkg/ROptEst/inst/scripts/NormalScaleModel.R
Log:
added calls to roptest ... seems to work correctly ...

Modified: pkg/ROptEst/inst/scripts/NormalScaleModel.R
===================================================================
--- pkg/ROptEst/inst/scripts/NormalScaleModel.R	2008-10-24 09:23:11 UTC (rev 182)
+++ pkg/ROptEst/inst/scripts/NormalScaleModel.R	2008-10-24 09:33:45 UTC (rev 183)
@@ -70,3 +70,24 @@
                     risk=asMSE(), rho=0.5))
 (N0.r.rho2 <- leastFavorableRadius(L2Fam=N0, neighbor=TotalVarNeighborhood(),
                     risk=asMSE(), rho=1/3))
+
+
+## For estimation use function roptest
+ind <- rbinom(1e2, size=1, prob=0.05) 
+x <- rnorm(1e2, mean=1, sd = (1-ind)+ind*9)
+
+## 1-step: contamination known
+est1 <- roptest(x, eps = 0.05, L2Fam = NormScaleFamily())
+est1v <- roptest(x, eps = 0.025, L2Fam = NormScaleFamily(), 
+                 neighbor = TotalVarNeighborhood())
+
+## k-step: contamination known
+est2 <- roptest(x, eps = 0.05, L2Fam = NormScaleFamily(), steps = 3)
+est2v <- roptest(x, eps = 0.025, L2Fam = NormScaleFamily(), 
+                 neighbor = TotalVarNeighborhood(), steps = 3)
+
+## comparison
+estimate(est1)
+estimate(est2)
+estimate(est1v)
+estimate(est2v)



More information about the Robast-commits mailing list