Least squares, and the road not to take

The 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.

Worth reading first: When the matrix is wrong too · A unit is a statement about the noise.

A unit is a statement about the noise found that total least squares has no answer of its own. It minimises one Frobenius norm over every column of [A b][A\ b], so the unit each column is written in decides how the correction is shared out, and rescaling one column carries the fit continuously between two named estimators: the reverse regression of that column on the rest, and the mixed fit that treats it as exact. Dividing every column by its own noise level is the unit that means something, and it was the best estimator on all three placements of the noise the essay tried. But it needs the noise levels, and the essay got them from replicate readings — a second experiment.

It then named the shortcut every practitioner reaches for, and predicted its failure. “A tempting shortcut is to iterate: fit, estimate each column’s noise from the correction the fit applied to it, reweight, and fit again. For Gaussian noise the ratio of the noise levels is known not to be identifiable from the data alone. The prediction with a sign is that on these fits the iteration converges, and to weights that depend on the units it starts from: started from c=0.01c = 0.01 and from c=100c = 100 on the same data, the converged weight on the first column differs by more than a factor of ten, and neither start reaches the error of the replicate weights with three readings.”

The iteration fails, as predicted, but not in the predicted way. It does not converge anywhere. The way it fails says exactly what “not identifiable” means.

What one step of the shortcut does

The fits are the earlier essay’s: sixty rows, two measured regressors with true coefficients 1.5 and −0.7, and noise drawn in each of the three columns of [A b][A\ b] at three placements — the same in every column; largest in the first, at four times the second’s and twice bb’s; and almost all in bb, twelve times the regressors’. Weights sjs_j, one per column, mean “column jj is divided by sjs_j before the fit”. Only their ratios matter, so they are normalised to one on the second regressor, and a start at unit factor cc means weights (1/c,1,1)(1/c, 1, 1): column one written in units cc times smaller.

One step: fit total least squares with the current weights, convert its correction back to the original units, take each column’s root-mean-square correction, and make those the next weights.

That step has a closed form, and it explains everything that follows. Total least squares in weighted coordinates replaces [A b]S−1[A\ b]S^{-1} by its nearest rank-deficient matrix, and the correction it subtracts is rank one: σ u vT\sigma\,u\,v^{\mathsf T}, with σ\sigma the smallest singular value and uu, vv its singular vectors. Back in the original units, column jj’s correction is σ u vjsj\sigma\,u\,v_j s_j, and its root-mean-square size is σ ∣vj∣ sj/m\sigma\,|v_j|\,s_j/\sqrt{m}. So a step does nothing but multiply each weight by ∣vj∣|v_j|, the size of its own column’s component in the smallest right singular vector — and then renormalise.

No run settles

Total least squares reweighted by its own corrections, one fit with the noise largest in the first column, started from column 1 written in units 1 times smaller: the weights at every step, beside the self-consistent weights and the true noise ratiosStart (1.0, 1, 1). Path: (1, 1), (2.2, 1.7), (12, 5), (331, 42), (2.7·10⁵, 2914), (1.8·10¹¹, 1.4·10⁷), (7.5·10²², 3.1·10¹⁴), leaving the drawing after 7 steps. Self-consistent weights (0.483, 1, 0.611); true noise ratios (4, 1, 2).-6-4-20246-6-4-20246log₁₀ weight on column 1, relative to column 2log₁₀ weight on bthis start's pathself-consistentthe true noisethe five startsdrawn to ten to the ±6; the paths go furtherthe self-consistent point repels
Fig. 1 One fit with the noise largest in the first column: the weights at every step of the reweighting from the start on the dial, in the plane of the weight on column one and the weight on b, each relative to column two and drawn on a logarithmic scale to a millionfold. The self-consistent weights and the true noise ratios are marked; open circles are the five starts.

Run it from the five starts on forty fits at each placement and not one of the six hundred runs converges. Every one leaves a millionfold range of weights within two to seven steps and keeps going — to 106010^{60}, where the measurement stops. Turn the dial: from c=0.01c = 0.01, 0.10.1 and 11 the path runs out toward large weights on column one and on bb; from 1010 and 100100, toward small weights on both regressors.

The ends are named estimators. A weight on column one that goes to infinity means column one is assumed to carry all the noise, which is the reverse regression; weights on both regressors that go to zero mean they are assumed exact, which is ordinary least squares of bb on AA. On all six hundred runs the final fit is one of the two to a part in a thousand: the reverse regression from every start with c≤1c \le 1, ordinary least squares from every start with c≥10c \ge 10.

Where forty runs of total least squares reweighted by its own corrections end, from five starts on three placements of the noise, with their median error and the median step at which the weights leave a millionfold rangenoise equal: c 0.01: 40 reverse, 0 least squares, error 0.161; c 0.1: 40 reverse, 0 least squares, error 0.161; c 1: 40 reverse, 0 least squares, error 0.161; c 10: 0 reverse, 40 least squares, error 0.317; c 100: 0 reverse, 40 least squares, error 0.317. noise largest in column 1: c 0.01: 40 reverse, 0 least squares, error 0.091; c 0.1: 40 reverse, 0 least squares, error 0.091; c 1: 40 reverse, 0 least squares, error 0.091; c 10: 0 reverse, 40 least squares, error 0.264; c 100: 0 reverse, 40 least squares, error 0.264. noise almost all in b: c 0.01: 40 reverse, 0 least squares, error 0.148; c 0.1: 40 reverse, 0 least squares, error 0.148; c 1: 40 reverse, 0 least squares, error 0.148; c 10: 0 reverse, 40 least squares, error 0.043; c 100: 0 reverse, 40 least squares, error 0.043.noise equalstart c = 0.010.161 · 3 stepsstart c = 0.10.161 · 4 stepsstart c = 10.161 · 6 stepsstart c = 100.317 · 4 stepsstart c = 1000.317 · 2 stepsnoise largest in column 1start c = 0.010.091 · 3 stepsstart c = 0.10.091 · 4 stepsstart c = 10.091 · 7 stepsstart c = 100.264 · 3 stepsstart c = 1000.264 · 2 stepsnoise almost all in bstart c = 0.010.148 · 3 stepsstart c = 0.10.148 · 4 stepsstart c = 10.148 · 6 stepsstart c = 100.043 · 4 stepsstart c = 1000.043 · 2 stepsends at the reverse regressionends at least squaresmedian error · stepsno run converges anywhere in betweenthe start picks the limit
Fig. 2 Where forty runs end from each of five starts on each of three placements of the noise, with their median error and the median step at which the weights leave a millionfold range. Every run from c ≤ 1 ends at the reverse regression; every run from c ≥ 10 at least squares.

So the prediction’s second clause holds in the most extreme form available — the weight on the first column from the two starts differs not by a factor of ten but by a factor of 1012010^{120} — and its first clause is false. There are no converged weights to compare. There are two attractors at the edge of the weight space, and the start decides which one a run reaches.

The weights that would be consistent, and why nothing stays there

A weighting at which the shortcut would stop does exist. It is the one where every column’s component in the smallest singular vector has the same size, so that multiplying each weight by ∣vj∣|v_j| changes nothing but the normalisation. The forward map runs away from it, so it is found by running the map backwards — dividing each weight by ∣vj∣|v_j| — which converges in ten to twenty-one steps on every fit.

A relative departure of one part in a million from the self-consistent weights, stepped forward by the reweighting, on one fit of each placementnoise equal: 10⁻⁶, 2.2·10⁻⁶, 4.7·10⁻⁶, 10⁻⁵, 2.2·10⁻⁵, 4.7·10⁻⁵, 10⁻⁴, 2.2·10⁻⁴, 4.7·10⁻⁴, 0.001, 0.0022, 0.0047, 0.01, 0.022, 0.049; median growth 2.16 a step; noise largest in column 1: 10⁻⁶, 2.1·10⁻⁶, 4.5·10⁻⁶, 9.5·10⁻⁶, 2·10⁻⁵, 4.3·10⁻⁵, 9.1·10⁻⁵, 1.9·10⁻⁴, 4.1·10⁻⁴, 8.6·10⁻⁴, 0.0018, 0.0039, 0.0083, 0.018, 0.038; median growth 2.12 a step; noise almost all in b: 10⁻⁶, 2·10⁻⁶, 4.1·10⁻⁶, 8.4·10⁻⁶, 1.7·10⁻⁵, 3.5·10⁻⁵, 7·10⁻⁵, 1.4·10⁻⁴, 2.9·10⁻⁴, 5.9·10⁻⁴, 0.0012, 0.0024, 0.005, 0.01, 0.021; median growth 2.03 a step.0246810121410⁻⁶10⁻⁵10⁻⁴10⁻³10⁻²10⁻¹110¹steprelative departure of the weight on column 1noise equalnoise largest in column 1noise almost all in bdashed: doubling a stepthe dashed line doubles a stepa fixed point the iteration leaves
Fig. 3 A relative departure of one part in a million from the self-consistent weights, stepped forward by the reweighting, on one fit of each placement. The departure about doubles every step; the dashed line doubles exactly.

It is unstable, and the rate is the same everywhere. Start one part in a million away and the forward map doubles the departure at each step — a median growth of 2.14, 2.09 and 2.04 a step on the three placements — until, after about twenty steps, the run is gone. The reason is the feedback in the step’s closed form. A column given a slightly larger weight is assumed to be slightly noisier, so the fit puts slightly more of its correction there, its root-mean-square correction grows, and the next weight is larger still. Nothing pushes back, because nothing in the data says how noisy any column actually is.

An iteration that walks out of the set found alternating least squares lowering its objective at every sweep and still failing to converge, because the minimum it was approaching was not in the set it searched. The reweighting is a cleaner case: it has a fixed point inside its set, and leaves it. An iteration that only multiplies found Newton–Schulz converging exactly when every singular value was below 3\sqrt 3 and diverging otherwise; the reweighting is an iteration that only multiplies whose multiplier is above one in every direction that matters.

Damping slows it and does not stop it

The usual repair for an iteration that overshoots is to take smaller steps: move each weight only part of the way toward the correction’s size, sj←sj (rmsj/sj)αs_j \leftarrow s_j\,(\text{rms}_j/s_j)^{\alpha} with α\alpha below one. That repairs overshoot. It does not repair a fixed point that repels, because it changes the multiplier’s size and not which side of one it is on: a departure that doubled at full step grows by 2α2^{\alpha} at a damped one, which is still more than one for any positive α\alpha.

Measured from the start at c=1c = 1 on the forty fits with equal noise, the damped runs behave exactly so. At full step the median run leaves a millionfold range after six steps; at half a step, after ten; at a quarter, after eighteen and a half. Not one of the hundred and twenty runs converges, and every one ends at the reverse regression, as the undamped run from the same start did. Damping buys time and changes nothing else — which is what a smaller step does to an iteration whose problem is the direction it is pushed in rather than how far.

The two edges, and why they are those two

The runs end at the reverse regression and at ordinary least squares, never at the mixed fit that treats only column one as exact, and the step’s closed form says why. Each step multiplies a weight by its column’s share of the smallest singular vector. A start that weights column one heavily makes that column look noisy, the fit puts its correction there, the share grows, and column one’s weight runs to infinity while the other two shrink together relative to it: all the noise is in column one, which is the reverse regression. A start that weights column one lightly makes it look exact; the fit corrects the second regressor and bb; but the second regressor’s weight is fixed at one by the normalisation, so it is bb’s weight that runs away upward relative to both regressors, which is the same as both regressors’ weights running to zero: all the noise in bb, which is least squares. The mixed fit would need column one’s weight to fall while bb’s and column two’s stay level, and nothing in the feedback holds two weights level.

The projection and the right angle drew least squares as the projection of bb onto the columns of AA, with all the correction perpendicular to them in bb. The reverse regression is the same picture with a regressor playing the part of bb. Total least squares sits between such pictures, and the earlier essay showed rescaling a column carries it from one to the other. The shortcut is a rescaling chosen by the fit’s own output, and the feedback carries it all the way.

The self-consistent weights are the geometry’s

The self-consistent weights of forty fits on each of three placements of the noise, in the plane of the weight on column 1 and on b, beside the true noise ratiosnoise equal: median self-consistent weights (0.515, 1, 0.746), true (1, 1, 1); noise largest in column 1: median self-consistent weights (0.530, 1, 0.708), true (4, 1, 2); noise almost all in b: median self-consistent weights (0.477, 1, 0.782), true (1, 1, 12). The three clouds overlap; the three true points are far apart.-1-0.500.51-1-0.500.51log₁₀ weight on column 1, relative to column 2log₁₀ weight on bnoise equalnoise largest in column 1noise almost all in bdots: self-consistentsquares: the true noiseone cloud, three truthsthe data's own weights are the geometry's
Fig. 4 Every fit’s self-consistent weights, forty fits on each of three placements of the noise, in the plane of the weight on column one and on b. The three clouds overlap. The squares are the true noise ratios, which are far apart.

The fixed point’s location says why. Found on all a hundred and twenty fits, the self-consistent weights have medians of 0.515, 0.530 and 0.477 on column one and 0.746, 0.708 and 0.782 on bb, on the three placements. The true ratios on those placements are one and one, four and two, and one and twelve. The three clouds of self-consistent weights lie on top of one another, a long way from all three truths.

That is non-identifiability made visible. The data are sixty rows of three numbers each, and Gaussian noise of any allocation among the columns, added to points on a plane, produces a cloud whose shape is the same to second order — a plane with scatter about it. What the fit can see is the plane and the size of the scatter, not which column put it there. The weights at which the corrections agree with themselves are a property of the cloud’s shape, which here is set by the spread of the regressors and the coefficients, and they come out the same whether the noise is in the regressors or in bb.

The valley with no bottom found a polynomial fit whose coefficients could move by a third of their size while the residual changed only in its sixth digit: a direction in which the data hold no information, so that the fitted answer along it is decided by rounding, the starting point or the algorithm. The noise ratio is a direction of exactly that kind, one level up. Every allocation of the noise among the columns fits the data equally well to second order, so the data cannot prefer one; whatever a procedure returns along that direction was put there by the procedure. The reweighting returns an edge, because its feedback pushes it along the flat direction until something stops it, and nothing does until a weight is infinite.

The theory says the ratio cannot be identified from second moments. The measurement shows what a procedure that tries anyway does: it finds the one weighting the cloud’s shape singles out, cannot stay there, and runs to an edge.

What each landing costs

The median error of the estimators total least squares reweighted by its own corrections can reach — its self-consistent weights, the reverse regression, least squares — beside the fit with known noise weights and with weights from three replicate readings, on three placements of the noisenoise equal: known 0.114, three replicates 0.127, self-consistent 0.098, reverse 0.161, least squares 0.317; noise largest in column 1: known 0.091, three replicates 0.084, self-consistent 0.106, reverse 0.091, least squares 0.264; noise almost all in b: known 0.042, three replicates 0.046, self-consistent 0.106, reverse 0.148, least squares 0.043.noise equalknown weights0.114three replicates0.127self-consistent0.098reverse regression0.161least squares0.317noise largest in column 1known weights0.091three replicates0.084self-consistent0.106reverse regression0.091least squares0.264noise almost all in bknown weights0.042three replicates0.046self-consistent0.106reverse regression0.148least squares0.0430.00.10.20.3median relative error in the coefficients, forty fitsonly the replicates know where the noise iseach limit is right for one placement
Fig. 5 The median error of each estimator the reweighting can reach — its self-consistent weights, the reverse regression, least squares — beside total least squares with the known noise weights and with weights from three replicate readings, forty fits on each placement.

The prediction’s third clause was that neither start would reach the error of weights estimated from three replicate readings. It holds on two placements and fails on the third, and where it fails is instructive.

With the noise the same in every column, the replicate weights give a median error of 0.127 and the known weights 0.114. The reverse regression gives 0.161, least squares 0.317. Neither landing is close. With the noise largest in the first column, the reverse regression gives 0.091 — exactly the known weights’ error, because this placement puts almost all the noise where the reverse regression assumes it — and three replicates give 0.084. With the noise almost all in bb, ordinary least squares gives 0.043, better than three replicates’ 0.046, because least squares assumes exactly that.

So a run of the shortcut is right when its start happens to put it in the basin of the estimator whose assumption matches the truth, and it has no way to know. From the same data, started on the other side, it returns 0.148 on the third placement and 0.264 on the second, three to six times the known weights’ error. The self-consistent weights, if a procedure could be made to stay there, would give 0.098, 0.106 and 0.106: good on the first placement by coincidence, and two and a half times the known weights’ error on the third.

What the replicates were for

The two numbers a caller has showed that the residual and the condition number of AA cannot say whether total least squares or least squares is the right method. This is the same conclusion reached from the inside: the fit’s own corrections cannot say how the noise is shared either, and an iteration that pretends they can is not a weaker method but a coin with two faces. When the matrix is wrong too introduced total least squares as the method for data in which AA is measured as well as bb; this essay adds the price of that method’s honesty. It needs to be told the noise, and only an experiment can tell it.

That is what replicate readings, repeated measurements of a standard, or an instrument’s specification are for. They are not a refinement of the fit. They carry information the fit does not contain. The earlier essay found three replicates enough to get within a tenth of the known weights’ error; this one finds that zero replicates, plus any amount of cleverness with the residuals, is a choice between two named estimators made by the starting units.

What sixty rows do not show

Every fit here has two regressors, sixty rows and Gaussian noise. With non-Gaussian noise the noise ratio becomes identifiable in principle, through higher moments, and an estimator that used them could do what this iteration cannot; none is measured. The step is the root-mean-square of each column’s correction, plain or damped; other summaries of a correction — its largest entry, its median — would change the multiplier’s form and are not tried, though the argument that a column weighted up is corrected more applies to any of them. Influence is decided before the data is a reminder that a fit’s geometry, set by its regressors, governs much of what it does; whether it governs the self-consistent weights is the first question below. And the explanation of the self-consistent weights as the cloud’s shape rests on their being nearly the same across placements; how they move with the regressors’ spread is not swept.

Still open: the cloud’s shape, and noise that is not Gaussian

What sets the self-consistent weights. If they are a property of the cloud’s shape, they should move with the spread of the regressors and not with the noise. The prediction with a sign is that doubling the spread of the second regressor while keeping every noise level fixed moves the self-consistent weight on column one by more than a factor of 1.5 on all three placements, while multiplying every noise level by three moves it by less than a tenth.

Noise with a skew. With noise drawn from a skewed distribution, third moments carry information about which column is noisy. The prediction is that a reweighting that matches each column’s third central moment of the correction to the data’s, instead of its root-mean-square, converges from every start on noise drawn as centred exponentials, and to weights within thirty per cent of the true ratios on at least two placements of three — the first estimator here that can see the noise from the data alone, and only because the noise is not Gaussian.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A flat tag is an object no other essay names yet.

Errors-in-variablesFixed-point iterationLeast squaresNoise levelScalingSingular vectorsTotal least squaresWeighted least squares