solow-robust
Robust linear regression by M-estimation, matching the reference's robust linear model (RLM).
The estimator minimizes Σ ρ((yᵢ − xᵢ·β) / σ) for a robust criterion ρ
using iteratively reweighted least squares (IRLS), re-estimating the scale
σ from the residuals at each step.
use ;
use ;
// A noisy line near y = 2 + 0.5·x with a gross outlier at the last point.
let x: = .map.collect;
let y = from;
let exog =
from_shape_fn;
let res = new
.unwrap
.fit
.unwrap;
assert!;
// The redescending norm fully rejects the outlier ...
assert_eq!;
// ... so the slope stays close to the clean trend rather than ~10.
assert!;
Components
- [
norms] — robust criterion functions ([norms::HuberT], [norms::TukeyBiweight], [norms::AndrewWave], [norms::LeastSquares]). - [
scale] — robust scale estimators ([scale::mad], [scale::Huber], [scale::HuberScale]). - [
Rlm] / [RlmResults] — the model and its fitted result.