Fast and Exact Least Absolute Deviations Line Fitting via Piecewise Affine Lower-Bounding
Stefan Volz, Martin Storath, Andreas Weinmann
TL;DR
The paper tackles robust LAD line fitting by introducing PALB, an exact solver that constructs piecewise-affine lower bounds from subgradients of the marginal LAD objective $J(m)=\min_t\sum_i|y_i-mx_i-t|$ and refines the slope interval until the subdifferential contains zero. PALB achieves finite termination with provable complexity bounds linked to the $k$-level/$k$-set problems, and exhibits log-linear practical performance, substantially faster than public LP-based and IRLS solvers on synthetic and real data. The implementation in Rust with a Python API, along with a comprehensive benchmark against L1pack, CPLEX, Clarabel, HiGHS, and Statsmodels, demonstrates PALB’s speed, exactness, and low memory footprint, making it suitable for embedded and real-time applications. The work also provides rigorous proofs for subdivision and expansion steps and discusses performance profiles and iteration counts, reinforcing PALB as a scalable, exact solution for LAD regression.
Abstract
Least-absolute-deviations (LAD) line fitting is robust to outliers but computationally more involved than least squares regression. Although the literature includes linear and near-linear time algorithms for the LAD line fitting problem, these methods are difficult to implement and, to our knowledge, lack maintained public implementations. As a result, practitioners often resort to linear programming (LP) based methods such as the simplex-based Barrodale-Roberts method and interior-point methods, or on iteratively reweighted least squares (IRLS) approximation which does not guarantee exact solutions. To close this gap, we propose the Piecewise Affine Lower-Bounding (PALB) method, an exact algorithm for LAD line fitting. PALB uses supporting lines derived from subgradients to build piecewise-affine lower bounds, and employs a subdivision scheme involving minima of these lower bounds. We prove correctness and provide bounds on the number of iterations. On synthetic datasets with varied signal types and noise including heavy-tailed outliers as well as a real dataset from the NOAA's Integrated Surface Database, PALB exhibits empirical log-linear scaling. It is consistently faster than publicly available implementations of LP based and IRLS based solvers. We provide a reference implementation written in Rust with a Python API.
