Algorithm Search⌘K

Algorithmadvanced

Least median of squares

Also called LMS regression.

Rousseeuw's regression that minimizes the median of the squared residuals. It has breakdown point near 1/2 but converges slowly, at rate n^(-1/3).

Time
O(n^3 log n) worst · best
Space
O(n^2) extra
Where
n = the number of data points (simple regression)
Properties
deterministicexact in exact arithmeticnot in placeofflineregression equivariant
Origin
Peter J. Rousseeuw, J. Michael Steele, William L. Steiger, Diane L. Souvaine, Herbert Edelsbrunner, 1984

Least median of squares (LMS) fits a regression by making the median of the squared residuals as small as possible, where least squares makes their sum small. Rousseeuw (1984) introduced it as the first estimator with a breakdown point near 1/2 in any dimension: almost half the data can be replaced before the fit can be carried away. For a line, the fit is the centre of the narrowest strip that holds just over half of the points. The price is statistical: the estimate converges at the slow rate n−1/3n^{-1/3}, so LMS is used to find outliers and to start better estimators, not as a final fit.

In plain words

Lay a straight band of some width over the scatter plot and slide and tilt it until it covers just over half the points. Make the band as narrow as possible. The centre line of the narrowest band is the LMS line. Points far outside the band do not matter at all, so a large group of bad points cannot pull the line, as long as the good points are the majority.

For a fixed tilt, finding the best band is easy: look at the points along the band direction, sort them, and take the shortest run that covers enough of them. The best tilt is always one where two points touch the same edge of the band, so it is enough to try the tilt through each pair of points.

The problem

The input is n≥2n \ge 2 points (xi,yi)(x_i, y_i). In the notation y=Xb+ey = X b + e with nn rows, this is the simple model with X=[1,x]X = [1, x]. For a line y=a+sxy = a + s x, the residuals are ri=yi−a−sxir_i = y_i - a - s x_i, and the objective is

Q(s,a)=the h-th smallest of r12,…,rn2,h=⌊n/2⌋+1.Q(s, a) = \text{the } h\text{-th smallest of } r_1^2, \ldots, r_n^2, \qquad h = \lfloor n/2 \rfloor + 1.

The output is a minimizer (s,a)(s, a) and the value Q∗Q^*. This hh is the "median" of the name, in the version that gives the best breakdown point for a line. For pp coefficients, Rousseeuw and Leroy use h=⌊n/2⌋+⌊(p+1)/2⌋h = \lfloor n/2 \rfloor + \lfloor (p+1)/2 \rfloor.

The algorithm

The exact algorithm for a line tries every pairwise slope and finds the best intercept for each slope by a scan.

  1. LMS-LINE(x, y)
  2. 1h ← ⌊n/2⌋ + 1
  3. 2T ← the slopes (y_j − y_i)/(x_j − x_i) of all pairs with x_i ≠ x_j ▷ T ← {0} if there is none
  4. 3for each s in T do
  5. 4(a, ρ) ← BEST-INTERCEPT(s)
  6. 5keep (s, a, ρ) if ρ is the smallest so far
  7. 6return the kept s, a, and the objective ρ²
  8. BEST-INTERCEPT(s) ▷ the best a for a fixed slope s
  9. 7z ← the values y_i − s·x_i, sorted
  10. 8for i ← 1 to n − h + 1: the width of window i is z[i + h − 1] − z[i]
  11. 9i* ← a narrowest window; return ((z[i*] + z[i* + h − 1])/2, its width / 2)

Random subsets for many predictors. With pp coefficients, the same idea gives the PROGRESS algorithm of Rousseeuw and Leroy (1987): draw many random sets of pp points, fit the exact line or plane through each, adjust its intercept by BEST-INTERCEPT, and keep the best. The result is an approximation, and the number of draws needed to see one clean set with probability 1−α1 - \alpha when a fraction ε\varepsilon is bad is log⁡α/log⁡(1−(1−ε)p)\log \alpha / \log(1 - (1 - \varepsilon)^p), the same count as for RANSAC (see the RANSAC iteration bound).

Example

Take seven points; points 5, 6 and 7 are bad.

ii 1 2 3 4 5 6 7
xix_i 1 2 3 4 5 6 7
yiy_i 2 4 5 8 30 33 1

Here h=4h = 4. For the slope s=2s = 2 of points 1 and 2, the values zi=yi−2xiz_i = y_i - 2x_i are 0,0,−1,0,20,21,−130, 0, -1, 0, 20, 21, -13. Sorted, they are −13,−1,0,0,0,20,21-13, -1, 0, 0, 0, 20, 21, and the windows of four values have widths 13,1,20,2113, 1, 20, 21. The narrowest is [−1,0][-1, 0], so a=−1/2a = -1/2 and the half-width is 1/21/2. Some other slopes give:

slope ss best aa half-width ρ\rho
1 5/2 3/2
3/2 5/4 3/4
2 −1/2 1/2
5/2 −3/2 1
3 −5/2 3/2

The best over all 21 pairwise slopes is s=2s = 2, so the LMS line is y=−12+2xy = -\tfrac12 + 2x, with Q∗=1/4Q^* = 1/4: points 1 to 4 have residuals ±12\pm\tfrac12. Least squares gives y=0.43+2.857 xy = 0.43 + 2.857\,x, tilted by the three bad points. A brute force over all (74)=35\binom74 = 35 sets of four points and their best Chebyshev lines gives the same Q∗Q^*; the test file checks this.

Correctness

For a fixed slope, the hh-th smallest ∣ri∣|r_i| is at most ρ\rho exactly when an interval of length 2ρ2\rho holds hh of the values ziz_i, and the shortest such interval is a window of hh consecutive sorted values. So BEST-INTERCEPT is exact. For the slope, the best band for a set SS of hh points has width fS(s)=max⁡Szi(s)−min⁡Szi(s)f_S(s) = \max_S z_i(s) - \min_S z_i(s), which is convex and piecewise linear in ss, with breakpoints only at slopes of pairs in SS. It tends to infinity at both ends, unless all points of SS share one xx, so it attains its minimum at a pairwise slope. Taking the minimum over all slopes in TT therefore gives the global minimum. The full proofs are below.

Proof: The best intercept is the centre of the narrowest window, and the best slope is a pairwise slope, so LMS-LINE is exactfull

Setting. The data are (x1,y1),…,(xn,yn)(x_1, y_1), \ldots, (x_n, y_n) with n≥2n \ge 2, and h=⌊n/2⌋+1h = \lfloor n/2 \rfloor + 1. For a line y=a+sxy = a + s x, the residuals are ri=yi−a−sxir_i = y_i - a - s x_i, and the objective Q(s,a)Q(s, a) is the hh-th smallest of r12,…,rn2r_1^2, \ldots, r_n^2. LMS-LINE must return (s,a)(s, a) that minimize QQ, and the value Q∗=min⁡QQ^* = \min Q. Write zi(s)=yi−sxiz_i(s) = y_i - s x_i, so ri=zi(s)−ar_i = z_i(s) - a.

Part 1. A fixed slope

Lemma 1. Fix ss, and let z(1)≤⋯≤z(n)z_{(1)} \le \cdots \le z_{(n)} be the sorted values zi(s)z_i(s). Let w(s)=min⁡1≤i≤n−h+1(z(i+h−1)−z(i))w(s) = \min_{1 \le i \le n-h+1} (z_{(i+h-1)} - z_{(i)}), attained at i∗i^*. Then min⁡aQ(s,a)=(w(s)/2)2\min_a Q(s, a) = (w(s)/2)^2, attained at a=(z(i∗)+z(i∗+h−1))/2a = (z_{(i^*)} + z_{(i^*+h-1)})/2.

Proof. For ρ≥0\rho \ge 0, Q(s,a)≤ρ2Q(s, a) \le \rho^2 holds exactly when at least hh values ziz_i lie in the interval [a−ρ,a+ρ][a - \rho, a + \rho]. An interval that holds hh of the sorted values holds hh consecutive ones, z(i),…,z(i+h−1)z_{(i)}, \ldots, z_{(i+h-1)}, so its length 2ρ2\rho is at least z(i+h−1)−z(i)≥w(s)z_{(i+h-1)} - z_{(i)} \ge w(s). So Q(s,a)≥(w(s)/2)2Q(s, a) \ge (w(s)/2)^2 for all aa. The interval of length w(s)w(s) centred at the given aa holds the hh values z(i∗),…,z(i∗+h−1)z_{(i^*)}, \ldots, z_{(i^*+h-1)}, so equality holds there. □\square

Lines L7 to L9 compute exactly this, in O(nlog⁡n)O(n \log n) time for the sort and O(n)O(n) for the scan.

Part 2. The slope

For a set SS of hh indices, let fS(s)=max⁡i∈Szi(s)−min⁡i∈Szi(s)f_S(s) = \max_{i \in S} z_i(s) - \min_{i \in S} z_i(s), the width of SS at slope ss.

Lemma 2. w(s)=min⁡∣S∣=hfS(s)w(s) = \min_{|S| = h} f_S(s).

Proof. A window of hh consecutive sorted values is a set SS with width equal to the window length, so w(s)≥min⁡SfS(s)w(s) \ge \min_S f_S(s). Any set SS of hh values spans at least hh consecutive sorted values, so its width is at least the length of some window, and fS(s)≥w(s)f_S(s) \ge w(s). □\square

Lemma 3. If the points of SS do not all have the same xx, then fSf_S attains its minimum at a slope sij=(yj−yi)/(xj−xi)s_{ij} = (y_j - y_i)/(x_j - x_i) of two points i,j∈Si, j \in S. If they all have the same xx, fSf_S is constant.

Proof. Each zi(s)z_i(s) is linear in ss. The maximum of finitely many linear functions is convex and piecewise linear, and it changes from one function to another only where two of them are equal, that is at some sijs_{ij}. The minimum is concave and piecewise linear with breakpoints of the same kind. So fSf_S is convex and piecewise linear, and all its breakpoints are pairwise slopes of points of SS. If xi≠xjx_i \ne x_j for some i,j∈Si, j \in S, then fS(s)≥∣zi(s)−zj(s)∣=∣xj−xi∣⋅∣s−sij∣→∞f_S(s) \ge |z_i(s) - z_j(s)| = |x_j - x_i| \cdot |s - s_{ij}| \to \infty as s→±∞s \to \pm\infty, so fSf_S is not a single linear piece and has a breakpoint. A convex piecewise linear function that tends to ∞\infty at both ends has its minimum at a breakpoint. If all xix_i in SS are equal, every zi(s)−zj(s)=yi−yjz_i(s) - z_j(s) = y_i - y_j is constant. □\square

Theorem 4. Q∗=min⁡s∈T(w(s)/2)2Q^* = \min_{s \in T} (w(s)/2)^2, where TT is the set of pairwise slopes of line L2 (or T={0}T = \{0\} when all xx are equal). So LMS-LINE returns an optimal line and the value Q∗Q^*.

Proof. By Lemmas 1 and 2, Q∗=min⁡smin⁡S(fS(s)/2)2=min⁡Smin⁡s(fS(s)/2)2Q^* = \min_s \min_S (f_S(s)/2)^2 = \min_S \min_s (f_S(s)/2)^2. Take SS that attains the outer minimum. If its points have two different xx values, Lemma 3 gives a minimizing slope in TT. If not, fSf_S is constant, and any slope, in particular one in TT, gives the same value. In both cases some s∈Ts \in T has (w(s)/2)2≤(fS(s)/2)2=Q∗(w(s)/2)^2 \le (f_S(s)/2)^2 = Q^*, and (w(s)/2)2≥Q∗(w(s)/2)^2 \ge Q^* for every ss. Lines L3 to L5 take the best s∈Ts \in T, and line L4 takes its best intercept by Lemma 1. □\square

Part 3. Cost

∣T∣≤(n2)|T| \le \binom n2, and each slope costs O(nlog⁡n)O(n \log n), so LMS-LINE takes O(n3log⁡n)O(n^3 \log n) time. Storing TT takes O(n2)O(n^2) space; looping over the pairs without storing them takes O(n)O(n) extra space.

What is cited, not proved

The breakdown point ⌊n/2⌋/n\lfloor n/2 \rfloor / n for simple regression in general position with this hh (Rousseeuw 1984; Rousseeuw and Leroy 1987, Chapter 3) and the convergence rate n−1/3n^{-1/3} (stated by Rousseeuw 1984 and proved in the framework of Kim and Pollard 1990) are cited on the page. They are not proved here.

Complexity

  • LMS-LINE as written. (n2)\binom n2 slopes, each with a sort: O(n3log⁡n)O(n^3 \log n) time. It needs O(n)O(n) extra space if the pairs are looped over without storing TT.
  • Faster exact algorithms for the line. Steele and Steiger (1986) studied the objective and gave an exact algorithm. Souvaine and Steele (1987) use the dual line arrangement: O(n2)O(n^2) time and space, or O(n2log⁡n)O(n^2 \log n) time and O(n)O(n) space. Edelsbrunner and Souvaine (1990) reach O(n2)O(n^2) time and O(n)O(n) space with a guided topological sweep.
  • Higher dimension. The exact problem with pp coefficients takes about np+1n^{p+1} time by the same kind of enumeration, which is why random subsets are used in practice. Each random subset costs O(nlog⁡n)O(n \log n) for the intercept adjustment.

Properties

  • Breakdown point ⌊n/2⌋/n\lfloor n/2 \rfloor / n for a line in general position (Rousseeuw 1984; Rousseeuw and Leroy 1987, Chapter 3), in the replacement version εn∗(T,X)\varepsilon^*_n(T, X). Bad points may have any xx and yy; leverage points cannot break it either.
  • Exact fit property. If at least ⌈n/2⌉+1\lceil n/2 \rceil + 1 points lie exactly on one line, the LMS line is that line, whatever the others are: that line has objective 0, and no other line can hold hh points, because two lines share at most one point. The test file checks this with 6 of 10 points on a line.
  • Slow convergence. For clean data with a smooth error density, the LMS estimate converges at the rate n−1/3n^{-1/3}, not n−1/2n^{-1/2} (Rousseeuw 1984). Kim and Pollard (1990) prove limit theorems for estimators of this kind, with LMS as an example. This rate is cited here, not proved. In practice, LMS has very low efficiency under normal errors.
  • Regression, scale and affine equivariant. Adding a line to yy, scaling yy, or changing the coordinates of xx by an affine map changes the fit in the matching way.
  • Not unique, not continuous. Several lines can tie, and a small change of one point can make the fit jump between two far-apart lines. The objective has many local minima.

Variants and improvements

  • Least trimmed squares minimizes the sum of the hh smallest squared residuals. It has the same breakdown point, converges at the rate n−1/2n^{-1/2}, and has a fast heuristic, FAST-LTS. Rousseeuw and Van Driessen recommend it over LMS.
  • Reweighted least squares. After LMS, give weight 0 to points whose standardized residual is large (for example above 2.5 in units of a robust scale), and fit least squares to the rest. This recovers efficiency and keeps the breakdown point.
  • MM-estimators. An MM-estimator starts from a high-breakdown fit such as LMS or LTS and improves it by an M-step with a fixed robust scale, reaching high efficiency.
  • Least quantile of squares. Any hh between n/2n/2 and nn gives a valid estimator, with breakdown point about (n−h)/n(n - h)/n.
  • Approximation algorithms. In computational geometry, LMS is the problem of the narrowest slab that holds hh points, and there are approximation algorithms with a guaranteed factor.

When to use it

Use LMS as an exploratory tool and as a starting point: to find which points do not fit the main linear pattern, and to start an iterative estimator. For a line in two variables with fewer than a few thousand points, the exact algorithm is practical. For a final fit, use a reweighted fit, LTS, or an MM-estimator. For a quick robust line with less than 29 percent of bad points, Theil-Sen is simpler and more efficient.

Pitfalls

  • Using LMS as the final fit. Its n−1/3n^{-1/3} rate means large sampling error, even with clean data.
  • Too few random subsets. With PROGRESS, the number of draws must grow quickly with pp and with the fraction of bad points; with too few draws the result is just a poor fit, with no warning.
  • Forgetting the intercept adjustment. The line through pp points is rarely the best line with that slope. BEST-INTERCEPT is cheap and lowers the objective.
  • The meaning of median. With h=⌈n/2⌉h = \lceil n/2 \rceil, as some software uses, the breakdown point is lower by about 1/n1/n and the exact fit property needs more points. Say which hh you use.
  • Floating point. The narrowest window compares differences of nearly equal values. Ties between bands are common in rounded data; report them.

Implementations

Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.

least_median_of_squares.pyI0RawGitHub
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/least-median-of-squares/. The authors are listed in prov/0GC0T5.jsonl.

import random
from fractions import Fraction


def coverage(n):
    """h = floor(n/2) + 1, the number of residuals the fit must cover."""
    return n // 2 + 1


def best_intercept(s, x, y, h):
    """For a fixed slope s: the intercept that minimises the h-th smallest
    |y - s x - a|, and the half-width of the narrowest window of h values
    of z = y - s x. O(n log n)."""
    z = sorted(yi - s * xi for xi, yi in zip(x, y))  # @line L7
    best = None
    for i in range(len(z) - h + 1):  # @line L8
        w = z[i + h - 1] - z[i]
        if best is None or w < best[0]:
            best = (w, i)
    w, i = best
    return (z[i] + z[i + h - 1]) / 2, w / 2  # @line L9


def lms_line(x, y):
    """Exact least median of squares line for simple regression.

    The best slope is among the pairwise slopes (or any slope if all x are
    equal), so try each one with its best intercept. O(n^3 log n) time.
    Returns (slope, intercept, objective) with objective = the h-th smallest
    squared residual.
    """
    x = [Fraction(v) for v in x]
    y = [Fraction(v) for v in y]
    n = len(x)
    if n < 2:
        raise ValueError("need at least two points")
    h = coverage(n)  # @line L1
    slopes = {(y[j] - y[i]) / (x[j] - x[i])  # @line L2
              for i in range(n) for j in range(i + 1, n) if x[i] != x[j]}
    if not slopes:
        slopes = {Fraction(0)}
    best = None
    for s in sorted(slopes):  # @line L3
        a, r = best_intercept(s, x, y, h)  # @line L4
        if best is None or r < best[2]:  # @line L5
            best = (s, a, r)
    s, a, r = best
    return s, a, r * r  # @line L6


def lms_random(x, y, trials, rng=None):
    """PROGRESS-style approximation: slopes through random pairs of points,
    each with its best intercept. O(trials * n log n) time."""
    rng = rng or random.Random(0)
    x = [Fraction(v) for v in x]
    y = [Fraction(v) for v in y]
    n = len(x)
    h = coverage(n)
    best = None
    for _ in range(trials):
        i, j = rng.sample(range(n), 2)
        if x[i] == x[j]:
            continue
        s = (y[j] - y[i]) / (x[j] - x[i])
        a, r = best_intercept(s, x, y, h)
        if best is None or r < best[2]:
            best = (s, a, r)
    if best is None:
        raise ValueError("no pair with different x was drawn")
    s, a, r = best
    return s, a, r * r


def hth_squared_residual(s, a, x, y):
    """The objective of the line y = a + s x."""
    r = sorted((Fraction(yi) - a - s * Fraction(xi)) ** 2 for xi, yi in zip(x, y))
    return r[coverage(len(x)) - 1]
test_least_median_of_squares.py 102 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/least-median-of-squares/. The authors are listed in prov/0GC0T5.jsonl.

import random
from fractions import Fraction
from itertools import combinations

from least_median_of_squares import (
    best_intercept, coverage, hth_squared_residual, lms_line, lms_random,
)


def chebyshev_error(pts):
    """Minimax error of the best line through pts (distinct x), by the
    de la Vallee Poussin rule: the largest levelled error over all triples."""
    if len(pts) < 3:
        return Fraction(0)
    best = Fraction(0)
    for (xa, ya), (xb, yb), (xc, yc) in combinations(sorted(pts), 3):
        on_line = ya + (yc - ya) * (xb - xa) / (xc - xa)
        best = max(best, abs(yb - on_line) / 2)
    return best


def brute_force_objective(x, y):
    """min over h-subsets of the squared Chebyshev error of the subset."""
    pts = [(Fraction(a), Fraction(b)) for a, b in zip(x, y)]
    h = coverage(len(pts))
    return min(chebyshev_error(sub) for sub in combinations(pts, h)) ** 2


def test_page_example() -> None:
    x = [1, 2, 3, 4, 5, 6, 7]
    y = [2, 4, 5, 8, 30, 33, 1]
    s, a, obj = lms_line(x, y)
    assert (s, a, obj) == (2, Fraction(-1, 2), Fraction(1, 4))
    assert hth_squared_residual(s, a, x, y) == obj
    assert obj == brute_force_objective(x, y)


def test_against_subset_brute_force() -> None:
    rng = random.Random(31)
    for _ in range(120):
        n = rng.randint(4, 9)
        x = rng.sample(range(-8, 9), n)
        y = [rng.randint(-8, 8) for _ in range(n)]
        s, a, obj = lms_line(x, y)
        assert obj == brute_force_objective(x, y)
        assert hth_squared_residual(s, a, x, y) == obj


def test_fixed_slope_intercept_is_optimal() -> None:
    rng = random.Random(32)
    for _ in range(200):
        n = rng.randint(2, 9)
        x = [Fraction(rng.randint(-5, 5)) for _ in range(n)]
        y = [Fraction(rng.randint(-5, 5)) for _ in range(n)]
        s = Fraction(rng.randint(-6, 6), rng.randint(1, 3))
        h = coverage(n)
        a, r = best_intercept(s, x, y, h)
        assert hth_squared_residual(s, a, x, y) == r * r
        # No other intercept from a fine grid does better.
        for t in range(-60, 61):
            assert hth_squared_residual(s, Fraction(t, 4), x, y) >= r * r


def test_ties_in_x() -> None:
    rng = random.Random(33)
    for _ in range(100):
        n = rng.randint(3, 8)
        x = [rng.randint(0, 3) for _ in range(n)]
        y = [rng.randint(-5, 5) for _ in range(n)]
        s, a, obj = lms_line(x, y)
        # Compare with every line through two points and every slope on a grid.
        for t in range(-40, 41):
            sl = Fraction(t, 4)
            ai, r = best_intercept(sl, [Fraction(v) for v in x], [Fraction(v) for v in y], coverage(n))
            assert obj <= r * r


def test_exact_fit_and_outliers() -> None:
    # 6 of 10 points on y = 3 - 2x, the rest anywhere: LMS finds the line.
    x = list(range(10))
    y = [3 - 2 * v for v in x]
    for i, v in zip((1, 4, 6, 9), (100, -50, 77, 0)):
        y[i] = v
    assert lms_line(x, y) == (-2, 3, 0)


def test_random_pairs_never_beat_exact() -> None:
    rng = random.Random(34)
    for _ in range(40):
        n = rng.randint(5, 14)
        x = [rng.randint(0, 20) for _ in range(n)]
        y = [rng.randint(0, 20) for _ in range(n)]
        if len(set(x)) == 1:
            continue
        exact = lms_line(x, y)[2]
        approx = lms_random(x, y, 30, random.Random(n))[2]
        assert approx >= exact
        # With many draws every pair is seen, and the answer is exact.
        assert lms_random(x, y, 3000, random.Random(n))[2] == exact

History

Rousseeuw introduced least median of squares in 1984, following Hampel's suggestion to replace the sum in least squares by a median. It was the first regression estimator equivariant under affine changes of xx with a breakdown point near 1/2 in every dimension. The book of Rousseeuw and Leroy (1987) made it a standard tool, with the PROGRESS program. Exact algorithms for the line came from computational geometry: Steele and Steiger (1986), Souvaine and Steele (1987), and Edelsbrunner and Souvaine (1990). Kim and Pollard (1990) put its slow rate in the general theory of cube root asymptotics. From the 1990s, least trimmed squares, with FAST-LTS (Rousseeuw and Van Driessen 2006), replaced LMS as the default high breakdown regression.

References

  1. Peter J. Rousseeuw, Least median of squares regression, Journal of the American Statistical Association 79(388), 1984, pp. 871 to 880 (the definition, the breakdown point, the convergence rate n^(-1/3), and the random subset algorithm)
  2. Peter J. Rousseeuw and Annick M. Leroy, Robust Regression and Outlier Detection, Wiley, 1987, Chapter 3 (the breakdown point of LMS for the coverage h) and Chapter 5 (the PROGRESS algorithm with random subsets and the intercept adjustment)
  3. JeongHoon Kim and David Pollard, Cube root asymptotics, The Annals of Statistics 18(1), 1990, pp. 191 to 219 (the n^(-1/3) rate and the limit distribution of estimators of this type, with least median of squares as an example)
  4. J. Michael Steele and William L. Steiger, Algorithms and complexity for least median of squares regression, Discrete Applied Mathematics 14(1), 1986, pp. 93 to 100, The whole paper (the structure of the LMS objective for a line and an exact algorithm)
  5. Diane L. Souvaine and J. Michael Steele, Time- and space-efficient algorithms for least median of squares regression, Journal of the American Statistical Association 82(399), 1987, pp. 794 to 801 (the LMS line in O(n^2) time and space, and in O(n^2 log n) time and O(n) space, by the dual line arrangement)
  6. Herbert Edelsbrunner and Diane L. Souvaine, Computing least median of squares regression lines and guided topological sweep, Journal of the American Statistical Association 85(409), 1990, pp. 115 to 119, The whole paper (the LMS line in O(n^2) time and O(n) space)

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH1 sketch
  • a full proof of time.best
  • a full proof of time.worst
  • a full proof of space.extra
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
Code (python)I0 not checked yet
  • the tests did not run in this build
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • a scene preset for the example