[RsR] in this dataset, rlm does a three times faster job than lmrob
Locher René (lor)
|or @end|ng |rom zhw|n@ch
Fri Jul 20 18:56:23 CEST 2007
Hello Matias
The latest version of R an lmrob do now a great job. Nevertheless I found a
dataset, for which rlm does a three times faster job than lmrob. Why?
Kind regards
René
library(robustbase)
test <- data.frame(
x=c(3.3575516935771, 3.13304428953422, 3.98938401869026,
2.08328674242856, 3.3835741882172, 3.93005173748371,
1.43749824638105, 3.09454066051286, 2.92764929063727,
2.67002221286635, 3.75601350227835, 3.07038223874994,
3.53923591572003),
y=c(3.52146363479579, 3.02062987442348, 4.24960889611117,
2.51125849743704, 3.82467807283048, 3.93651877222289,
0.75302058160736, 3.59279564738277, 3.64679398333867,
3.21478267936578, 3.7105197894303, 3.36705413642534,
3.39556804093519))
set.seed(1000)
r <- lmrob(y ~x, dat=test, control = lmrob.control(max.it=400))
r$iter
## [1] 201
summary(r)
plot(test)
abline(r,col="red",lwd=2)
abline(r$init.S$coef,col="blue",lwd=2)
sessionInfo()
## R version 2.5.1 (2007-06-27)
## 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-8"
##
library(MASS)
rM <- rlm(y ~x, dat=test, method="MM", maxit=76)
summary(rM)
abline(rM,col="grey", lwd=2, lty=2)
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
Rosenstrasse 3
Postfach
CH-8400 Winterthur http://www.idp.zhwin.ch
More information about the R-SIG-Robust
mailing list