Which of the two least-squares methods is more accurate, as a fixed amount of noise moves from b into A
At its defaults it draws which of the two least-squares methods is more accurate, as a fixed amount of noise moves from b into a. One curve: the ordinary least-squares error over the total least-squares error, at each share of the noise placed in the matrix, as the median over 40 seeds. It runs from 0.28 when all the noise is in b — where ordinary least squares is the more accurate — to 2.47 when all of it is in A. The line at one is where the two methods are equally right.
noise-share is one function in lib/figures/tls.js —
errors in the matrix too — where the residual orders two methods backwards. Everything below came out of it during this build, at
arguments taken from the essays rather than invented for this page. A figure here is the
figure a reader meets in an essay, and if the generator changes, this page changes with it.
At its defaults
Drawn even though every essay passes arguments — which on this site is every essay, at 100% of placements since the standard pass. A default nothing exercises is a trap for the next essay to call this with none, and this is the page where a default that has drifted from the figures around it becomes visible.
One curve: the ordinary least-squares error over the total least-squares error, at each share of the noise placed in the matrix, as the median over 40 seeds. It runs from 0.28 when all the noise is in b — where ordinary least squares is the more accurate — to 2.47 when all of it is in A. The line at one is where the two methods are equally right.
show: "units-sweep", case: "equal"
The arguments are the ones A unit is a statement about the noise passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.
A 60-row fit with two measured regressors, the first column multiplied by c and its answer converted back, the error read in the recorded units; median over 40 fits. Least squares 0.3171 at every c; total least squares weighted by each column's noise 0.1139 at every c; plain total least squares 10⁻⁴: 0.1607, 10⁻³: 0.1607, 0.01: 0.1607, 0.1: 0.1590, 0.3: 0.1457, 1: 0.1139, 3: 0.1451, 10: 0.1686, 100: 0.1716, 10³: 0.1716, 10⁴: 0.1716. Its two ends are the reverse regression of column 1 on the others, 0.1607, and the fit that treats column 1 as exact, 0.1716.
show: "units-shares", case: "equal", c: 1
The arguments are the ones A unit is a statement about the noise passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.
Each column's share of the squared correction, in the recorded units, mean over 40 fits, against its share of the noise variance. At c = 1: column 1 of A 59.8 per cent of the correction, 33.3 per cent of the noise; column 2 of A 13.2 per cent of the correction, 33.3 per cent of the noise; b 27.0 per cent of the correction, 33.3 per cent of the noise. Median error 0.1139.
show: "units-sweep", case: "bonly"
The arguments are the ones A unit is a statement about the noise passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.
A 60-row fit with two measured regressors, the first column multiplied by c and its answer converted back, the error read in the recorded units; median over 40 fits. Least squares 0.0429 at every c; total least squares weighted by each column's noise 0.0424 at every c; plain total least squares 10⁻⁴: 0.1475, 10⁻³: 0.1475, 0.01: 0.1475, 0.1: 0.1470, 0.3: 0.1422, 1: 0.1108, 3: 0.0833, 10: 0.0768, 100: 0.0758, 10³: 0.0757, 10⁴: 0.0757. Its two ends are the reverse regression of column 1 on the others, 0.1475, and the fit that treats column 1 as exact, 0.0757.
show: "units-sweep", case: "unequal"
The arguments are the ones A unit is a statement about the noise passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.
A 60-row fit with two measured regressors, the first column multiplied by c and its answer converted back, the error read in the recorded units; median over 40 fits. Least squares 0.2640 at every c; total least squares weighted by each column's noise 0.0912 at every c; plain total least squares 10⁻⁴: 0.0914, 10⁻³: 0.0914, 0.01: 0.0914, 0.1: 0.0915, 0.3: 0.0926, 1: 0.0921, 3: 0.1494, 10: 0.1759, 100: 0.1779, 10³: 0.1779, 10⁴: 0.1779. Its two ends are the reverse regression of column 1 on the others, 0.0914, and the fit that treats column 1 as exact, 0.1779.
show: "units-cases"
The arguments are the ones A unit is a statement about the noise passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.
Noise the same in every column: least squares 0.3171, total, recorded units 0.1139, total, c → 0 0.1607, total, c → ∞ 0.1716, total, weighted 0.1139. Noise largest in the first column: least squares 0.2640, total, recorded units 0.0921, total, c → 0 0.0914, total, c → ∞ 0.1779, total, weighted 0.0912. Noise almost all in b: least squares 0.0429, total, recorded units 0.1108, total, c → 0 0.1475, total, c → ∞ 0.0757, total, weighted 0.0424.
What it checked while drawing
Every figure above checked its own claims on the way to being drawn, and a claim that failed
would have stopped the picture rather than shipped a wrong one. Those checks used to leave
no trace at all: a passing one returned true and the only evidence the figure had
checked anything was that nothing crashed. The list below is what they actually said, collected
by running this generator with an observer installed — not a description of
what it is believed to check.
23 distinct claims across 6 sets of arguments, grouped below by shape — because most of them are one sentence with a different number in it, and how many separate times that sentence was put to the test is the informative part.
every problem at share 0 has a total least-squares solution — checked 5 times
and the advantage moves the same way at every share, at 0.3 — checked 4 times
a noise level the fit survives
a noise placement the sweep measures
a noise placement this file defines
a positive scale per column of [A b]
a positive unit factor to start from
a start the dial offers
a unit factor the dial draws
and total least squares when all of it is
at this noise level the two methods are indistinguishable at every share
enough seeds for a median to mean something
least squares is the more accurate when none of the noise is in A
over a range wider than the seeds can account for
with a crossing inside the sweep
with neither ahead by more than a few per cent anywhere
Against the rule
It draws a decomposition and prints its residual. It calls
overSeeds,
and every figure above carries the badge — which residualcheck verifies by looking
for it in the emitted SVG rather than by finding the call that builds one. A badge that is
constructed and then left out of the body is the failure that check exists for.
Across the library: the rule bites on 217
of 397 generators —
199 print a residual and
18 are exempt with a published reason;
180 factorise nothing.
Read from lib/residual-rule.js, which is the same body the gate enforces from,
and the gate's last check fails the build if this page and it disagree about any generator.
Where it is called
Changing this generator changes every figure on this list. That is what makes the list worth publishing rather than keeping in a check script.
A unit is a statement about the noise
Total least squares minimises one Frobenius norm over every column of [A b], so the unit a column is written in is a claim about how noisy it is. On a 60-row fit with two measured regressors, rewriting one column in units from 10⁻⁴ to 10⁴ times the recorded ones leaves ordinary least squares exactly where it was and moves total least squares by half again, continuously, between two estimators with their own names: the reverse regression of that column on the others, and the fit that treats it as exact. Its correction is split among the columns as the squares of the coefficients, which the units set and the noise never enters. Dividing each column by its noise level makes every unit give one answer, the best of five estimators on all three placements of the noise tried, and two replicate readings a column are enough to get most of the way there when the recorded units were badly wrong.
Least squares, and the road not to takeThe weights the fit chooses for itself
Total least squares needs each column's noise level, and the tempting shortcut is to read it off the fit: weight, fit, take each column's correction as its noise, reweight, repeat. The prediction was that this converges, to weights that depend on where it starts. It does not converge at all. Each step multiplies every weight by its own column's share of the smallest singular vector, the one self-consistent weighting is unstable — a departure from it doubles every step — and every run leaves for the edge in two to seven steps, landing on the reverse regression or on ordinary least squares by which side it started. The self-consistent weights are nearly the same whatever the noise is: they describe the fit's geometry, and only replicate readings describe the noise.
Least squares, and the road not to takeWhen the matrix is wrong too
Every least-squares problem here has assumed A is exact and b is not, and moved b onto the column space of A. Where both were measured, the smallest correction that makes the system consistent moves the matrix as well — and on the problems where that answer is more accurate, it has the larger residual, by construction rather than by luck.