[Robast-commits] r114 - branches/robast-0.6/pkg/ROptEst/inst/scripts
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Jul 23 09:17:23 CEST 2008
Author: stamats
Date: 2008-07-23 09:17:23 +0200 (Wed, 23 Jul 2008)
New Revision: 114
Modified:
branches/robast-0.6/pkg/ROptEst/inst/scripts/ExponentialScaleModel.R
Log:
adapted to new implementation
Modified: branches/robast-0.6/pkg/ROptEst/inst/scripts/ExponentialScaleModel.R
===================================================================
--- branches/robast-0.6/pkg/ROptEst/inst/scripts/ExponentialScaleModel.R 2008-07-22 13:29:08 UTC (rev 113)
+++ branches/robast-0.6/pkg/ROptEst/inst/scripts/ExponentialScaleModel.R 2008-07-23 07:17:23 UTC (rev 114)
@@ -3,25 +3,25 @@
###############################################################################
require(ROptEst)
-## generates Exponential Scale Family with rate = 1
-E1 <- ExpScaleFamily(rate = 1)
+## generates Exponential Scale Family with rate = 2
+E1 <- ExpScaleFamily(rate = 2)
E1 # show E1
plot(E1) # plot of Exp(rate = 1) and L_2 derivative
checkL2deriv(E1)
-# classical optimal IC
+## classical optimal IC
E1.IC0 <- optIC(model = E1, risk = asCov())
E1.IC0 # show IC
checkIC(E1.IC0)
Risks(E1.IC0)
plot(E1.IC0) # plot IC
-# L_2 family + infinitesimal neighborhood
+## L_2 family + infinitesimal neighborhood
E1.Rob1 <- InfRobModel(center = E1, neighbor = ContNeighborhood(radius = 0.5))
E1.Rob1 # show E1.Rob1
E1.Rob2 <- InfRobModel(center = E1, neighbor = TotalVarNeighborhood(radius = 0.5))
-# MSE solution
+## MSE solution
(E1.IC1 <- optIC(model=E1.Rob1, risk=asMSE()))
checkIC(E1.IC1)
Risks(E1.IC1)
@@ -31,7 +31,7 @@
Risks(E1.IC2)
plot(E1.IC2)
-# lower case solutions
+## lower case solutions
(E1.IC3 <- optIC(model=E1.Rob1, risk=asBias()))
checkIC(E1.IC3)
Risks(E1.IC3)
@@ -41,7 +41,7 @@
Risks(E1.IC4)
plot(E1.IC4)
-# Hampel solution
+## Hampel solution
(E1.IC5 <- optIC(model=E1.Rob1, risk=asHampel(bound=clip(E1.IC1))))
checkIC(E1.IC5)
Risks(E1.IC5)
@@ -51,7 +51,7 @@
Risks(E1.IC6)
plot(E1.IC6)
-# radius minimax IC
+## radius minimax IC
(E1.IC7 <- radiusMinimaxIC(L2Fam=E1, neighbor=ContNeighborhood(),
risk=asMSE(), loRad=0, upRad=0.5))
checkIC(E1.IC7)
@@ -61,8 +61,8 @@
checkIC(E1.IC8)
Risks(E1.IC8)
-# least favorable radius
-# (may take quite some time!)
+## least favorable radius
+## (may take quite some time!)
(E1.r.rho1 <- leastFavorableRadius(L2Fam=E1, neighbor=ContNeighborhood(),
risk=asMSE(), rho=0.5))
(E1.r.rho2 <- leastFavorableRadius(L2Fam=E1, neighbor=TotalVarNeighborhood(),
@@ -74,15 +74,15 @@
E1.x <- rexp(1e2, rate=(1-ind)*2+ind*10)
## 2. Kolmogorov(-Smirnov) minimum distance estimator
-(E1.est0 <- ksEstimator(x=E1.x, Exp()))
+(E1.est0 <- MDEstimator(x=E1.x, ExpScaleFamily(), interval = c(0, 10)))
## 3. one-step estimation: radius known
-E1.Rob3 <- InfRobModel(center=ExpScaleFamily(rate=E1.est0$rate),
+E1.Rob3 <- InfRobModel(center=ExpScaleFamily(rate=1/E1.est0$estimate),
neighbor=ContNeighborhood(radius=0.5))
E1.IC9 <- optIC(model=E1.Rob3, risk=asMSE())
-(E1.est1 <- oneStepEstimator(E1.x, IC=E1.IC9, start=E1.est0$rate))
+(E1.est1 <- oneStepEstimator(E1.x, IC=E1.IC9, start=E1.est0$estimate))
## 4. one-step estimation: radius interval
-E1.IC10 <- radiusMinimaxIC(L2Fam=ExpScaleFamily(rate=E1.est0$rate),
+E1.IC10 <- radiusMinimaxIC(L2Fam=ExpScaleFamily(rate=1/E1.est0$estimate),
neighbor=ContNeighborhood(), risk=asMSE(), loRad=0, upRad=Inf)
-(E1.est2 <- oneStepEstimator(E1.x, IC=E1.IC10, start=E1.est0$rate))
+(E1.est2 <- oneStepEstimator(E1.x, IC=E1.IC10, start=E1.est0$estimate))
More information about the Robast-commits
mailing list