pylmrob

Getting started

  • Quickstart
    • Install
    • Fit
    • Compare nested models
    • Predict on new data
    • Inference
    • sklearn integration
    • Pick a different psi family
    • R compatibility presets
    • Speed levers
    • Where to next
  • What is robust regression?
    • The M-estimator
    • S-estimator and M-scale
    • MM-estimator
    • Why setting="KS2014" is the recommended default
    • Where MM fails
    • Which psi family to pick
    • Further reading

Theory in pictures

  • Why robust at all?
    • Helper
    • Scenario 1: vertical outliers
    • Scenario 2: horizontal (high-leverage) outliers
    • The HBK case study
    • Next
  • What does robustness cost?
    • A small Monte Carlo loop
    • Scenario A: Gaussian noise (the OLS-optimal case)
    • Scenario B: Student-t(3) noise (heavy-tailed)
    • Summary table
    • Next
  • Breakdown point in pictures
    • Setup
    • Result
    • What ε=0.5 means in practice
    • Next
  • Why MM needs an S init
    • A contaminated dataset
    • IRWLS starting from OLS lands in the wrong basin
    • IRWLS starting from the S estimate lands in the right basin
    • The two basins, side by side
    • Inside the S step: brute-force resampling
    • So the S step is what makes MM work
    • Next
  • The loss functions: rho, psi, weight
    • The three views, side by side
    • Why MM uses two tunings
    • Where huber sits
    • Next

How-to examples

  • Walkthrough: the stackloss dataset
    • Setup
    • OLS baseline
    • Robust fit
    • Identify outliers
    • Confidence and prediction intervals
    • Bootstrap inference
    • Nested-model test
    • Statsmodels-style access
    • Sklearn pipeline
    • What to read next
  • M-S init for factor designs
    • The problem
    • A small worked example
    • Default lmrob (auto-picks M-S)
    • Forcing pure-S init
    • Inspecting which observations got downweighted
    • When this matters
  • LmRob in sklearn pipelines
    • 1. Drop-in inside a Pipeline
    • 2. cross_val_score for honest performance estimates
    • 3. GridSearchCV over Control settings
    • When sklearn integration doesn’t make sense
    • See also

Reference

  • API reference
    • Top-level functions
      • lmrob()
      • anova()
    • Estimator class
      • LmRob
    • Result objects
      • LmRobResults
      • SummaryLmRob
      • AnovaTable
    • Control parameters
      • Control
    • Psi family kernels
      • tuning_for_breakdown()
      • tuning_for_efficiency()
  • Porting from R’s robustbase::lmrob
    • Fit
    • Result accessors
    • Inference
    • Control fields
    • Default behaviour
    • Things that don’t match exactly
  • The engine_c=True fast path
    • When to use it
    • Behaviour at larger n
    • What you give up
    • Benchmark
    • What’s still pure Python
  • Control(rng="R") performance
    • Setup
    • Wall-clock: PCG64 vs R-mode
    • Microbench: draw helpers
    • When to use rng="R"
    • Remaining work
  • Numerical notes
    • Entries
      • 1. Initial-S basin sensitivity to RNG (Phase 4)
      • 2. Performance vs R
      • 3. M-S estimator (Phase 5)
      • 4. vcov_w (Phase 7)
      • 5. Cython resampling kernel (bisquare hot path)
      • 6. Thread-based parallel resampling
      • 7. anova() chained mode
      • 8. vcov_avar1 matches R element-wise
  • FAQ / troubleshooting
    • “Algorithm did not converge”
    • “X’ W X is singular; consider cov=‘.vcov.w’”
    • “Wald CI looks suspiciously narrow”
    • Confidence vs prediction vs tolerance interval
    • How do I get bit-identical fits to R?
    • How do I pick nResample?
    • How do I make it faster?
    • LmRob vs lmrob?
    • predict() is returning weird values
    • Why does setting="KS2014" use psi="lqq" by default?
    • See what the fitter is doing
    • Where do I report bugs?
pylmrob
  • Index

Index

A | B | C | D | G | L | M | P | R | S | T

A

  • anova() (in module pylmrob)
    • (pylmrob.results.LmRobResults method)
  • AnovaTable (class in pylmrob.anova)

B

  • bootstrap() (pylmrob.results.LmRobResults method)

C

  • conf_int() (pylmrob.results.LmRobResults method)
  • confint() (pylmrob.results.LmRobResults method)
  • Control (class in pylmrob)

D

  • diagnostics() (pylmrob.results.LmRobResults method)

G

  • get_params() (pylmrob.Control method)

L

  • LmRob (class in pylmrob)
  • lmrob() (in module pylmrob)
  • LmRobResults (class in pylmrob.results)

M

  • module
    • pylmrob.psi

P

  • predict() (pylmrob.LmRob method)
    • (pylmrob.results.LmRobResults method)
  • predict_std() (pylmrob.results.LmRobResults method)
  • preset() (pylmrob.Control class method)
  • pylmrob.psi
    • module

R

  • render() (pylmrob.summary.SummaryLmRob method)

S

  • score() (pylmrob.LmRob method)
  • set_params() (pylmrob.Control method)
  • summary() (pylmrob.results.LmRobResults method)
  • SummaryLmRob (class in pylmrob.summary)

T

  • tuning_for_breakdown() (in module pylmrob.psi)
  • tuning_for_efficiency() (in module pylmrob.psi)

© Copyright 2026, anevolbap.

Built with Sphinx using a theme provided by Read the Docs.