Prof Brian Ripley wrote: > On Thu, 22 Dec 2005, Murray Jorgensen wrote: > >> We have a choice when calculating the Huber location estimate: >> > set.seed(221205) >> > y <- 7 + 3*rt(30,1) > > > That's Cauchy, BTW, a very extreme case.
Sure, the sort of situation where one might want a robust estimator. [...] > Note that the huber() scale estimate is the initial MAD, whereas rlm > iterates. Because during iteration the 'center' for MAD is known to be > zero, the results differ. For symmetric distributions there is little > difference, but your sample is not close to symmetric. [Blush] yes I knew that and somehow I forgot. But leave rlm() alone for a while and do IRLS with fixed scale: th <- median(y) s <- mad(y) # paste this in a few times: w <- ifelse((y-th< 1.345*s & y-th>-1.345*s), 1, 1.345*s/abs(y-th)) th <- weighted.mean(y,w) th We converge to > th [1] 5.9203 close to the answer given by rlm() different from > huber(y)$mu [1] 5.9117 So the variable scale does not account for the difference. Murray Jorgensen -- Dr Murray Jorgensen http://www.stats.waikato.ac.nz/Staff/maj.html Department of Statistics, University of Waikato, Hamilton, New Zealand Email: [EMAIL PROTECTED] Fax 7 838 4155 Phone +64 7 838 4773 wk Home +64 7 825 0441 Mobile 021 1395 862 ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
