[R] robustbase problem [bug?] in adjbox function.

Martin Maechler maechler at stat.math.ethz.ch
Wed Dec 8 16:28:40 CET 2010


Thank you, Peter.
(see inline)

On Wed, Dec 8, 2010 at 14:58, Peter Ehlers <ehlers at ucalgary.ca> wrote:
> On 2010-12-07 12:01, kv wrote:
>>
>> hello list,
>>
>> i'm a bit puzzled by the error message i get when i copy past this in R:
[.............]
>> in my computer adjbox says:
>>
>> "maximal number of iterations (100 =? 100) reached prematurely
>> Error in mc.default(x, na.rm = TRUE) :
>>   mc(): not 'converged' in 100 iterations"
>>
>
> You're not exactly providing a 'minimal' example. (We don't need
> to know your colour preferences and plot titles, etc, since
> those have no relation to the problem.)
>
> The problem is with mc() which adjbox() calls (as is stated
> on the help page for adjbox).
>
> I suspect that there may indeed be a bug in the C code called
> by mc(), possibly related to ties. I saw no comments about
> ties on the help page for mc().
>
> A workaround for you might be to add a very small disturbance
> to your data, e.g. rnorm(length(datac), sd = 1e-10).
>
> Note to the maintainer:
> Here's a slightly simpler reproducible example:
>
> set.seed(15)
> x <- sort(sample(67, 101, TRUE))
> mc(x)
> # maximal number of iterations (100 =? 100) reached prematurely
> # Error in mc.default(x) : mc(): not 'converged' in 100 iterations
>
> Eliminating any one of the elements of x with index in
> c(17:18, 33:45, 48:50) results in convergence.
>

> Peter Ehlers
>
>> R2.12 and the latest version of robustbase -in ubuntu 10.10).

Indeed, there had been problems in the C code of mc.
"Interestingly", only a couple of days ago, we (robustbase developers)
had started an effort to resolve the issue, and indeed, Manuel Koller
(and I to a small extent)
has looked at the code, and found why it fails in some cases
((For the interested: We had the "infamous" situation that
   if(x >= y) {
        <but inside the "true" branch,  x < y (and x = y-eps, for a
very small eps)
   }

as experts know, this *can* happen (and hence does happen in
practice!), e.g., as

The development version of robustbase, available from R forge, e.g., by
       install.packages("robustbase", repos="http://R-Forge.R-project.org")
now has this problem corrected,
and actually we'd be very happy if you could stress test this version.

A release is planned soon, and actually only delayed by a careful
modification of the Qn() finite sample correction ... as the new
version corrects a long-standing typo in the decimal digits of the
consistency factor  in the original codes and publications of the very
first publications and papers.

Thank you for your feedbacks!
Martin Maechler, ETH Zurich (and maintainer of 'robustbase')



More information about the R-help mailing list