Porting from R’s robustbase::lmrob
A side-by-side cheat sheet for users coming from R’s robustbase package.
Fit
R |
Python |
|---|---|
|
|
|
|
|
|
|
|
Result accessors
R |
Python |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Inference
R |
Python |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Control fields
The most-used R control fields and their Python equivalents:
R control field |
Python |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(no equivalent) |
|
(no equivalent) |
|
Default behaviour
Control() with no arguments matches R’s lmrob.control() (default
setting=NULL): psi="bisquare", method="MM", cov=".vcov.avar1",
tuning_psi=4.685061, tuning_chi=1.547645.
Control(setting="KS2014") matches R’s lmrob.control(setting="KS2014"):
psi="lqq", method="SMDM", cov=".vcov.w", tuning_psi=(1.4734061, 0.9822707, 1.5), tuning_chi=(0.4015457, 0.2676971, 1.5).
Control(setting="KS2011") is the same as KS2014 but with
the older D-scale tuning.
Things that don’t match exactly
The default fast-S resampling RNG uses NumPy’s PCG64; R uses Mersenne
Twister. With the same seed, the two diverge at the first random draw,
so basin-of-attraction sensitivity can give small coefficient
differences on tiny-n datasets. For tighter agreement, opt in to
Control(rng="R") (v0.5.16+): the resample loop runs against R’s
exact unif_rand stream and stackloss fits agree with lmrob to
rtol~1.7e-5. See the numerical notes for the
full list.