[RsR] lmrob: lmrob.S()-Warning is not in the result returned

Henric Nilsson (Public) n||@@on@henr|c @end|ng |rom gm@||@com
Fri Jun 8 12:47:27 CEST 2007


Den Fr, 2007-06-08, 11:21 skrev Locher René (lor):
> Ciao Martin
>
> I had started R freshly to run my example. Here the full output (without
> start-up message):
>
>> options(STERM='iESS', editor='gnuclient.exe')
>> library(robustbase)
>> test <- data.frame(lconc = log(c(29.5, 40.1, 21.1, 25.3, 27.3, 25.2,
> +                                  26.9, 19.1, 16.4)),
> +                    dist  = c(520, 1480, 1780, 740, 540, 1050, 1100,
> +                              1640, 1860))
>>
>> res <- lmrob(lconc~dist, dat=test)
> Warning messages:
> 1: rwls(): not converged in 1000 lambda iterations
> 2: rwls(): not converged in 1000 lambda iterations
> 3: rwls(): not converged in 1000 lambda iterations
> 4: rwls(): not converged in 1000 lambda iterations
>>

I can confirm this as well using

> sessionInfo()
R version 2.5.0 Patched (2007-05-24 r41696)
i386-pc-mingw32

locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252

attached base packages:
[1] "stats"     "graphics"  "grDevices" "utils"     "datasets"  "methods"
[7] "base"

other attached packages:
robustbase
   "0.2-7"


However, I don't see the problem under


> sessionInfo()
R version 2.4.1 Patched (2007-03-15 r40854)
i386-pc-mingw32

locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252

attached base packages:
[1] "stats"     "graphics"  "grDevices" "utils"     "datasets"  "methods" 
 "base"

other attached packages:
robustbase
   "0.2-7"


And when comparing e.g. `res$fitted.values' between these two R versions,
they seem identical.


>
>
> And her my sessionInfo right afterwards:
>> sessionInfo()
> R version 2.5.0 (2007-04-23)
> i386-pc-mingw32
>
> locale:
> LC_COLLATE=German_Switzerland.1252;LC_CTYPE=German_Switzerland.1252;LC_MONETARY=German_Switzerland.1252;LC_NUMERIC=C;LC_TIME=German_Switzerland.1252
>
> attached base packages:
> [1] "stats"     "graphics"  "grDevices" "utils"     "datasets"  "methods"
> [7] "base"
>
> other attached packages:
> robustbase
>    "0.2-7"
>
> And here is the output in debugging mode. I hope this helps.
>
> debug(lmrob)
> debug(lmrob.fit.MM)
> debug(lmrob.MM)
>
> ## first level
> lmrob(lconc~dist, dat=test)
> Browse[1]>c
>
> ## second level
> z <- lmrob.fit.MM(x, y, control = control)
> Browse[1]>c
>
> ## third level
> final.MM <- lmrob.MM(x = x, y = y, beta.initial = iCoef, scale =
> init.S$scale,
>     control = control)
>
> Browse[1]>n  ## repeated until call to .C()
>
> ## arguments just before the call to fourth level
> Browse[1]> x
>   (Intercept) dist
> 1           1  520
> 2           1 1480
> 3           1 1780
> 4           1  740
> 5           1  540
> 6           1 1050
> 7           1 1100
> 8           1 1640
> 9           1 1860
> attr(,"assign")
> [1] 0 1
> Browse[1]> y
>        1        2        3        4        5        6        7        8
> 3.384390 3.691376 3.049273 3.230804 3.306887 3.226844 3.292126 2.949688
>        9
> 2.797281
> Browse[1]> print(n)
> [1] 9
> Browse[1]> p
> [1] 2
> Browse[1]> control$max.it
> [1] 50
> Browse[1]> c.psi
> [1] 4.685061
> Browse[1]> c
>
> ## fourth level
> b <- .C("R_lmrob_MM", x = as.double(x), y = as.double(y), n =
> as.integer(n),
>     p = as.integer(p), beta.initial = as.double(beta.initial),
>     scale = as.double(scale), coef = double(p), iter =
> as.integer(control$max.it),
>     c.psi = c.psi, converged = logical(1), PACKAGE =
> "robustbase")[c("coef",
>     "scale", "converged", "iter")]
> Warning messages:
> 1: rwls(): not converged in 1000 lambda iterations
> 2: rwls(): not converged in 1000 lambda iterations
> 3: rwls(): not converged in 1000 lambda iterations
> 4: rwls(): not converged in 1000 lambda iterations
>
> Everything works fine with my R, except that I cannot use successfully the
> package debug since I have updated R to version 2.5.0. Since then,

Yes, IIRC this was due to a bug in 2.5.0. Install a patched version and
everything should be fine.

> mtrace(fun) exits with the error message "Error in all.levs[[j]] :
> subscript out of bounds" with functions I have tested in former versions
> of R without any problems! But that's another story. By the way: Before I
> update R, I remove all the packages installed and install the latest
> versions after updating R

If you have your packages in the exact same location as before,
`update.packages(checkBuilt = TRUE)' will make sure that you get packages
compiled for the updated R (given that these still builds under the newer
R version).


HTH,
Henric



>
> I hope this helps. I am afraid that my problem is platform dependent.
>
> Kind regards
>
> René
>
> René Locher                                   E-Mail: rene.locher using zhwin.ch
> Institut für Datenanalyse und Prozessdesign   Tel:    052/ 267 7810
> Zürcher Hochschule Winterthur                 Fax:    052/ 268 7810
> Technopark / Jägerstrasse 2
> Postfach
> CH-8400 Winterthur                            http://www.idp.zhwin.ch
>
>
>
>
> |-----Original Message-----
> |From: Martin Maechler [mailto:maechler using stat.math.ethz.ch]
> |Sent: Friday, June 08, 2007 9:01 AM
> |To: Matias Salibian-Barrera
> |Cc: r-sig-robust using r-project.org; Locher René (lor); Martin Maechler
> |Subject: Re: [RsR] lmrob: lmrob.S()-Warning is not in the
> |result returned
> |
> |
> |  MS> However, *I can't* reproduce Rene's second warning: "rwls(): not
> |  MS> converged in 1000 lambda iterations" warning. I will
> |look into it a bit
> |  MS> further.
> |
> |indeed, and I can't either - carefully checking a 2nd time.
> |
> |Rene, maybe you can try to use  debug(.) and
> |see the exact lmrob.S(.) call which leads to the lambda
> |iteration warnings.
> |
> |  MS> Matias
> |  MS>
> |  MS> > version
> |  MS>                _
> |  MS> platform       i686-pc-linux-gnu
> |  MS> arch           i686
> |  MS> os             linux-gnu
> |  MS> system         i686, linux-gnu
> |  MS> status
> |  MS> major          2
> |  MS> minor          3.1
> |  MS> year           2006
> |  MS> month          06
> |  MS> day            01
> |  MS> svn rev        38247
> |  MS> language       R
> |  MS> version.string Version 2.3.1 (2006-06-01)
> |  MS> > library(robustbase)
> |  MS> > test <- data.frame(lconc=c(3.081910,3.165475,2.501436,3.650658,
> |  MS> + 3.044522,3.660994),
> |  MS> + dist=c(100,180,280,30,220,6))
> |  MS> > res <- lmrob(lconc~dist, dat=test)
> |  MS> Warning messages:
> |  MS> 1: lmrob.S(): refinements did not converge (to
> |tol=1e-07) in 200 iterations
> |  MS> 2: lmrob.S(): refinements did not converge (to
> |tol=1e-07) in 200 iterations
> |  MS> > my.ctrl <- lmrob.control(refine.tol=1e-5)
> |  MS> > res2 <- lmrob(lconc~dist, dat=test, control=my.ctrl)
> |  MS> > res
> |  MS>
> |  MS> Call:
> |  MS> lmrob(formula = lconc ~ dist, data = test)
> |  MS>
> |  MS> Coefficients:
> |  MS> (Intercept)         dist
> |  MS>    3.690387    -0.003707
> |  MS>
> |  MS> > res2
> |  MS>
> |  MS> Call:
> |  MS> lmrob(formula = lconc ~ dist, data = test, control = my.ctrl)
> |  MS>
> |  MS> Coefficients:
> |  MS> (Intercept)         dist
> |  MS>    3.690387    -0.003707
> |  MS>
> |  MS> > res$scale
> |  MS> [1] 0.2506454
> |  MS> > res2$scale
> |  MS> [1] 0.2506544
> |
> | Martin Maechler wrote:
> | >>>>>> "ReneL" == Locher René (lor) <lor using zhwin.ch>
> | >>>>>>     on Tue, 5 Jun 2007 18:24:47 +0200 writes:
> | >
> | >     ReneL> Dear Matias When I run the following code I get 2
> | >     ReneL> warnings:
> | >
> | >     ReneL> lmrob.S(): refinements did not converge
> |(tol=1e-07) in 200 iterations
> | >
> | >      library(robustbase)
> | >      test <- data.frame(lconc=c(3.081910,3.165475,2.501436,3.650658,
> | > 				3.044522,3.660994),
> | >                         dist=c(100,180,280,30,220,6))
> | >      res <- lmrob(lconc~dist, dat=test)
> | >
> | >     ReneL> res$converged gives TRUE as the IRWLS iterations
> |after the lmrob.S() have converged.
> | >
> | >     ReneL> It would be nice to have also the convergence
> |status of lmrob.S() in the result object of lmrob().
> | >
> | > I agree.
> | >
> | > HOWEVER, I cannot see / reproduce the convergence warnings
> | > problems you mention, neither the above, nor the one you sent
> | > yesterday.
> | >
> | > Are you *REALLY* sure, you are not using an older version of
> | > "robustbase" or mixing versions of robustbase,
> | > or are using 'lmrob' (there was a package of that name) and
> | > 'robustbase' simultaneously?
> | >
> | > Note: For such reports, do use sessionInfo().
> | >
> | > Regards,
> | > Martin
> | >
> | >     ReneL> Kind regards
> | >
> | >     ReneL> René
> | >
> | >
> | >     ReneL> René Locher
> |E-Mail: rene.locher using zhwin.ch
> | >     ReneL> Institut für Datenanalyse und Prozessdesign
> |Tel:    052/ 267 7810
> | >     ReneL> Zürcher Hochschule Winterthur
> |Fax:    052/ 268 7810
> | >     ReneL> Technopark / Jägerstrasse 2
> | >     ReneL> Postfach
> | >     ReneL> CH-8400 Winterthur
> |http://www.idp.zhwin.ch
> | >
> | >     ReneL> P.S.
> | >
> | >     ReneL> Here is the version of my system on which I have
> |tested the example:
> | >
> | >     ReneL> version              _
> | >     ReneL> ## platform       i386-pc-mingw32
> | >     ReneL> ## arch           i386
> | >     ReneL> ## os             mingw32
> | >     ReneL> ## system         i386, mingw32
> | >     ReneL> ## status
> | >     ReneL> ## major          2
> | >     ReneL> ## minor          5.0
> | >     ReneL> ## year           2007
> | >     ReneL> ## month          04
> | >     ReneL> ## day            23
> | >     ReneL> ## svn rev        41293
> | >     ReneL> ## language       R
> | >     ReneL> ## version.string R version 2.5.0 (2007-04-23)
> | >
> | >     ReneL> library(help=robustbase)
> | >     ReneL> ## Version:       0.2-7
> |
> |
> |
> | --
> | _____________________________________________________
> | Matias Salibian-Barrera - Department of Statistics
> | The University of British Columbia
> | Phone: (604) 822-3410 - Fax: (604) 822-6960
> | "The plural of anecdote is not data" (George Stigler?)
> |
> |
> |
> | >>>>> ">>" == Matias Salibian-Barrera <matias using stat.ubc.ca>
> | >>>>>     on Thu, 07 Jun 2007 09:35:46 -0700 writes:
> |
> |     >>> Thanks Rene for pointing these problems out.
> |
> |     >>> I can reproduce the first warning (produced by
> |     >>> lmrob.S()) -- I'm copying my output below. Of course,
> |     >>> the warning disappears if you weaken the convergence
> |     >>> criteria a little:
> |
> |     >>> my.ctrl <- lmrob.control(refine.tol=1e-5) res2 <-
> |     >>> lmrob(lconc~dist, dat=test, control=my.ctrl)
> |
> |     >>> However, *I can't* reproduce Rene's second warning:
> |     >>> "rwls(): not converged in 1000 lambda iterations"
> |     >>> warning. I will look into it a bit further.
> |
> |     >>> Matias
> |
> |
> |
> |     >> version
> |     >>>                _ platform i686-pc-linux-gnu arch i686 os
> |     >>> linux-gnu system i686, linux-gnu status major 2 minor
> |     >>> 3.1 year 2006 month 06 day 01 svn rev 38247 language R
> |     >>> version.string Version 2.3.1 (2006-06-01)
> |     >> library(robustbase) test <-
> |     >> data.frame(lconc=c(3.081910,3.165475,2.501436,3.650658,
> |     >>> + 3.044522,3.660994), + dist=c(100,180,280,30,220,6))
> |     >> res <- lmrob(lconc~dist, dat=test)
> |     >>> Warning messages: 1: lmrob.S(): refinements did not
> |     >>> converge (to tol=1e-07) in 200 iterations 2: lmrob.S():
> |     >>> refinements did not converge (to tol=1e-07) in 200
> |     >>> iterations
> |     >> my.ctrl <- lmrob.control(refine.tol=1e-5) res2 <-
> |     >> lmrob(lconc~dist, dat=test, control=my.ctrl) res
> |
> |     >>> Call: lmrob(formula = lconc ~ dist, data = test)
> |
> |     >>> Coefficients: (Intercept) dist 3.690387 -0.003707
> |
> |     >> res2
> |
> |     >>> Call: lmrob(formula = lconc ~ dist, data = test, control
> |     >>> = my.ctrl)
> |
> |     >>> Coefficients: (Intercept) dist 3.690387 -0.003707
> |
> |     >> res$scale
> |     >>> [1] 0.2506454
> |     >> res2$scale
> |     >>> [1] 0.2506544
> |
> |
> |
> |     >>> Martin Maechler wrote:
> |     >>>>>>> "ReneL" == Locher René (lor) <lor using zhwin.ch> on Tue,
> |     >>>>>>> 5 Jun 2007 18:24:47 +0200 writes:
> |     >>
> |     ReneL> Dear Matias When I run the following code I get 2
> |     ReneL> warnings:
> |     >>
> |     ReneL> lmrob.S(): refinements did not converge (tol=1e-07)
> |     ReneL> in 200 iterations
> |     >>
> |     >> library(robustbase) test <-
> |     >> data.frame(lconc=c(3.081910,3.165475,2.501436,3.650658,
> |     >> 3.044522,3.660994), dist=c(100,180,280,30,220,6)) res <-
> |     >> lmrob(lconc~dist, dat=test)
> |     >>
> |     ReneL> res$converged gives TRUE as the IRWLS iterations
> |     ReneL> after the lmrob.S() have converged.
> |     >>
> |     ReneL> It would be nice to have also the convergence status
> |     ReneL> of lmrob.S() in the result object of lmrob().
> |     >>
> |     >> I agree.
> |     >>
> |     >> HOWEVER, I cannot see / reproduce the convergence
> |     >> warnings problems you mention, neither the above, nor the
> |     >> one you sent yesterday.
> |     >>
> |     >> Are you *REALLY* sure, you are not using an older version
> |     >> of "robustbase" or mixing versions of robustbase, or are
> |     >> using 'lmrob' (there was a package of that name) and
> |     >> 'robustbase' simultaneously?
> |     >>
> |     >> Note: For such reports, do use sessionInfo().
> |
> |
>
> _______________________________________________
> R-SIG-Robust using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-robust
>
>




More information about the R-SIG-Robust mailing list