[Robast-commits] r182 - pkg/ROptEst/inst/scripts
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Oct 24 11:23:11 CEST 2008
Author: stamats
Date: 2008-10-24 11:23:11 +0200 (Fri, 24 Oct 2008)
New Revision: 182
Modified:
pkg/ROptEst/inst/scripts/LognormalAndNormalModel.R
Log:
some minor modifications ... seems to work now
Modified: pkg/ROptEst/inst/scripts/LognormalAndNormalModel.R
===================================================================
--- pkg/ROptEst/inst/scripts/LognormalAndNormalModel.R 2008-10-24 07:01:38 UTC (rev 181)
+++ pkg/ROptEst/inst/scripts/LognormalAndNormalModel.R 2008-10-24 09:23:11 UTC (rev 182)
@@ -3,10 +3,10 @@
###############################################################################
require(ROptEst)
-## generates Lognormal Scale Family with rate = 1
+## generates Lognormal Scale Family with meanlog = 0, sdlog = 1
LN1 <- LnormScaleFamily()
LN1 # show LN1
-plot(LN1) # plot of Exp(rate = 1) and L_2 derivative
+plot(LN1) # plot of Lnorm() and L_2 derivative
checkL2deriv(LN1)
## generates Normal Location Family with mean = 0
@@ -153,3 +153,22 @@
risk=asMSE(), rho=1/3))
(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-ind)+ind*9)
+y <- exp(x)
+
+## 1-step: contamination known
+est1 <- roptest(x, eps = 0.05, L2Fam = NormLocationFamily())
+est2 <- roptest(y, eps = 0.05, L2Fam = LnormScaleFamily())
+
+## k-step: contamination known
+est3 <- roptest(x, eps = 0.05, L2Fam = NormLocationFamily(), steps = 3)
+est4 <- roptest(y, eps = 0.05, L2Fam = LnormScaleFamily(), steps = 3)
+
+## comparison
+estimate(est1)
+log(estimate(est2))
+estimate(est3)
+log(estimate(est4))
More information about the Robast-commits
mailing list