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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Oct 23 15:17:04 CEST 2008


Author: stamats
Date: 2008-10-23 15:17:03 +0200 (Thu, 23 Oct 2008)
New Revision: 178

Modified:
   pkg/ROptEst/inst/scripts/GammaModel.R
Log:
some minor modifications. Gamma model seems to work properly ...

Modified: pkg/ROptEst/inst/scripts/GammaModel.R
===================================================================
--- pkg/ROptEst/inst/scripts/GammaModel.R	2008-10-20 12:52:07 UTC (rev 177)
+++ pkg/ROptEst/inst/scripts/GammaModel.R	2008-10-23 13:17:03 UTC (rev 178)
@@ -65,14 +65,27 @@
 x <- (1-ind)*rgamma(100, scale = 1, shape = 2) + ind*rgamma(100, scale = 3, shape = 5)
 
 ## 2. Kolmogorov(-Smirnov) minimum distance estimator
-(est0 <- MDEstimator(x=x, GammaFamily()))
+(est01 <- MDEstimator(x=x, GammaFamily()))
 
+## 3. Cramer von Mises minimum distance estimator
+(est02 <- MDEstimator(x = x, GammaFamily(), distance = CvMDist))
+
 ## non-robust ML estimator
 MLEstimator(x=x, GammaFamily())
 
-## 3. one-step estimation: radius known
-RobG3 <- InfRobModel(center=GammaFamily(scale = estimate(est0)["scale"], 
-                     shape = estimate(est0)["shape"]), 
+## 4. one-step estimation: radius known
+RobG3 <- InfRobModel(center=GammaFamily(scale = estimate(est02)["scale"], 
+                     shape = estimate(est02)["shape"]), 
                 neighbor=ContNeighborhood(radius=0.5))
 IC9 <- optIC(model=RobG3, risk=asMSE())
-(est1 <- oneStepEstimator(x, IC=IC9, start=estimate(est0)))
+(est1 <- oneStepEstimator(x, IC=IC9, start=est02))
+
+## 5. k-step estimation: radius known
+(est2 <- kStepEstimator(x, IC=IC9, start=est02, steps = 3))
+
+## It's simpler to use function roptest!
+(est3 <- roptest(x, eps = 0.5/sqrt(length(x)), L2Fam = GammaFamily()))
+
+## comparison
+estimate(est1)
+estimate(est3)



More information about the Robast-commits mailing list