[Robast-commits] r406 - branches/robast-0.8/pkg/RobLox/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed May 26 00:31:08 CEST 2010


Author: ruckdeschel
Date: 2010-05-26 00:31:07 +0200 (Wed, 26 May 2010)
New Revision: 406

Modified:
   branches/robast-0.8/pkg/RobLox/R/roblox.R
Log:
fixed a buglet: if only sd or mean is to be estimated, starting value mean.sd was not set in roblox(); similarly, in case only mean is of interest, robEst had no component est...

Modified: branches/robast-0.8/pkg/RobLox/R/roblox.R
===================================================================
--- branches/robast-0.8/pkg/RobLox/R/roblox.R	2010-05-17 18:01:15 UTC (rev 405)
+++ branches/robast-0.8/pkg/RobLox/R/roblox.R	2010-05-25 22:31:07 UTC (rev 406)
@@ -619,17 +619,17 @@
                     Infos(IC1) <- Info.matrix
                     return(new("kStepEstimate", name = "Optimally robust estimate",
                                completecases = completecases,
-                               estimate.call = es.call, estimate = robEst$est,
+                               estimate.call = es.call, estimate = robEst,
                                samplesize = length(x), asvar = as.matrix(A-r^2*b^2),
                                asbias = r*b, steps = k, pIC = IC1, Infos = Info.matrix,
-                           start = mean.sd[,1,drop=F], startval = mean.sd[,1,drop=F], ustartval = mean.sd))
+                           start = median, startval = matrix(mean,1,1), ustartval = matrix(mean,1,1)))
                 }else
                     return(new("kStepEstimate", name = "Optimally robust estimate",
                                completecases = completecases,
-                               estimate.call = es.call, estimate = robEst$est,
+                               estimate.call = es.call, estimate = robEst,
                                samplesize = length(x), asvar = as.matrix(A-r^2*b^2),
                                asbias = r*b, steps = k, pIC = NULL, Infos = Info.matrix,
-                           start = mean.sd[,1,drop=F], startval = mean.sd[,1,drop=F], ustartval = mean.sd))
+                           start = median, startval = matrix(mean,1,1), ustartval = matrix(mean,1,1)))
             }else{
                 sqrtn <- sqrt(length(x))
                 rlo <- sqrtn*eps.lower
@@ -708,17 +708,17 @@
                     Infos(IC1) <- Info.matrix
                     return(new("kStepEstimate", name = "Optimally robust estimate",
                                completecases = completecases,
-                               estimate.call = es.call, estimate = robEst$est,
+                               estimate.call = es.call, estimate = robEst,
                                samplesize = length(x), asvar = as.matrix(A-r^2*b^2),
                                asbias = r*b, steps = k, pIC = IC1, Infos = Info.matrix,
-                           start = mean.sd[,1,drop=F], startval = mean.sd[,1,drop=F], ustartval = mean.sd))
+                           start = median, startval = matrix(mean,1,1), ustartval = matrix(mean,1,1)))
                 }else
                     return(new("kStepEstimate", name = "Optimally robust estimate",
                                completecases = completecases,
-                               estimate.call = es.call, estimate = robEst$est,
+                               estimate.call = es.call, estimate = robEst,
                                samplesize = length(x), asvar = as.matrix(A-r^2*b^2),
                                asbias = r*b, steps = k, pIC = NULL, Infos = Info.matrix,
-                           start = mean.sd[,1,drop=F], startval = mean.sd[,1,drop=F], ustartval = mean.sd))
+                           start = median, startval = matrix(mean,1,1), ustartval = matrix(mean,1,1)))
             }
         }
         if(missing(sd)){
@@ -818,14 +818,14 @@
                                estimate.call = es.call, estimate = robEst$est,
                                samplesize = length(x), asvar = as.matrix(robEst$A-r^2*robEst$b^2),
                                asbias = r*robEst$b, steps = k, pIC = IC1, Infos = Info.matrix,
-                           start = mean.sd[,2,drop=F], startval = mean.sd[,2,drop=F], ustartval = mean.sd))
+                           start = mad, startval = matrix(sd,1,1), ustartval = matrix(sd,1,1)))
                 }else
                     return(new("kStepEstimate", name = "Optimally robust estimate",
                                completecases = completecases,
                                estimate.call = es.call, estimate = robEst$est,
                                samplesize = length(x), asvar = as.matrix(robEst$A-r^2*robEst$b^2),
                                asbias = r*robEst$b, steps = k, pIC = NULL, Infos = Info.matrix,
-                           start = mean.sd[,2,drop=F], startval = mean.sd[,2,drop=F], ustartval = mean.sd))
+                           start = mad, startval = matrix(sd,1,1), ustartval = matrix(sd,1,1)))
             }else{
                 sqrtn <- sqrt(length(x))
                 rlo <- sqrtn*eps.lower
@@ -929,14 +929,14 @@
                                estimate.call = es.call, estimate = robEst$est,
                                samplesize = length(x), asvar = as.matrix(robEst$A-r^2*robEst$b^2),
                                asbias = r*robEst$b, steps = k, pIC = IC1, Infos = Info.matrix,
-                           start = mean.sd[,2,drop=F], startval = mean.sd[,2,drop=F], ustartval = mean.sd))
+                           start = mad, startval = matrix(sd,1,1), ustartval = matrix(sd,1,1)))
                 }else
                     return(new("kStepEstimate", name = "Optimally robust estimate",
                                completecases = completecases,
                                estimate.call = es.call, estimate = robEst$est,
                                samplesize = length(x), asvar = as.matrix(robEst$A-r^2*robEst$b^2),
                                asbias = r*robEst$b, steps = k, pIC = NULL, Infos = Info.matrix,
-                           start = mean.sd[,2,drop=F], startval = mean.sd[,2,drop=F], ustartval = mean.sd))
+                           start = mad, startval = matrix(sd,1,1), ustartval = matrix(sd,1,1)))
             }
         }
     }



More information about the Robast-commits mailing list