Regularisation, and the answer that is chosen

The excess is what the fit spent

A noise level estimated by four-fold cross-validation was never below the true noise, and its upward bias was put down to each fit training on three quarters of the samples. More folds should then shrink it, and leave-one-out, the limit, was predicted to bring the median under 1.1 times the noise everywhere. It does not: at 1.25 samples per unknown leave-one-out reads 1.27 to 1.52, within four per cent of four folds on every cell, because the bias was never the folds'. It is the degrees of freedom the fit spends — the median matches the square root of m over m minus the hat matrix's trace to within five per cent on all twelve cells. Taking that share out gives an estimate within 1.08 of the noise that is below it on 344 of 960 draws, and the discrepancy principle told it does exactly as well as told the truth.

Worth reading first: When the answer is a choice · Choosing without knowing · A parameter that counts steps.

Four folds feed one rule estimated the noise level of a blurred signal from the data alone: hold out each quarter of the samples in turn, fit the other three by Tikhonov regularisation on a grid of λ\lambda, add the held-out squares, and read the noise off the smallest total. On 960 draws the estimate was never below the true noise, and that was the property the discrepancy principle needed — told it, the rule’s worst draw stayed within 1.19 of the oracle where told one held-out quarter it had missed by eighteen. The estimate was high, though, by a median of 1.60 at the worst corner, and the essay gave a reason: “with few samples per unknown each fit, trained on three quarters, has fewer samples to fit with.” It closed on the obvious next step. “With kk folds each fit trains on (k−1)/k(k-1)/k of the samples, so the bias should shrink toward the noise as kk grows while the estimate stays above it. The prediction with a sign is that leave-one-out, the limit, gives an estimate whose median over the true noise is under 1.1 at every ratio and noise level, still never below the noise on any of the 960 draws, and that the discrepancy principle told it keeps its worst draw under 1.2.”

Two of those three hold. The first does not, and the reason it does not corrects the explanation it rested on. The bias was never the folds’. It is a property of the fit at the chosen λ\lambda, every cross-validation pays it whatever the folds, and once it is named it can be taken out — which produces an estimate that breaks the rule the earlier essay thought essential and costs the discrepancy principle nothing.

Leave-one-out without m fits

Leave-one-out sounds expensive: mm samples, mm fits, each one a Tikhonov solve on a grid of 121 values of λ\lambda. For a linear smoother it is not. A Tikhonov fit at fixed λ\lambda predicts the data by b^=Hb\hat b = Hb, with the hat matrix H=Udiag⁡(fk)UTH = U \operatorname{diag}(f_k) U^{\mathsf T} built from the singular vectors and the filter factors fk=σk2/(σk2+λ2)f_k = \sigma_k^2/(\sigma_k^2 + \lambda^2). The fit that never saw sample ii predicts it with residual ri/(1−hii)r_i/(1 - h_{ii}), where rir_i is the whole fit’s residual and hiih_{ii} the sample’s leverage. That identity is the deletion formula one minus a leverage is a subtraction wrote down for least squares, carried through the filter; the observation that cannot be removed is the same 1−h1 - h reaching zero.

So leave-one-out costs one singular value decomposition and a sum over samples at each λ\lambda, less than four folds’ four decompositions. Checked against the real thing — mm separate fits, each with one sample removed — on one draw at each ratio, the two totals agree at every λ\lambda on the grid to a relative 1.3⋅10−121.3 \cdot 10^{-12}. The measurement below uses the identity for leave-one-out and honest refitting for 2, 4, 8 and 16 folds, on the same 960 draws the earlier essays used: five grid sizes from 24 to 96 unknowns, 1.25, 1.5, 2 and 4 samples per unknown, noise of 10−210^{-2}, 10−310^{-3} and 10−410^{-4} of the signal, sixteen draws each.

More folds stop helping at four

The noise estimated by cross-validation at its minimum, over the true noise, against the number of folds up to leave-one-out, at 1.25 samples per unknown and three noise levels: the median of 80 drawsnoise 10⁻²: 2 folds 1.374, 4 folds 1.288, 8 folds 1.275, 16 folds 1.270, leave-one-out 1.271; noise 10⁻³: 2 folds 1.473, 4 folds 1.442, 8 folds 1.412, 16 folds 1.397, leave-one-out 1.397; noise 10⁻⁴: 2 folds 1.720, 4 folds 1.570, 8 folds 1.560, 16 folds 1.518, leave-one-out 1.519.11.11.21.31.41.51.61.71.8foldsestimate ÷ true noise, median24816mthe prediction: under 1.1noise 10⁻²noise 10⁻³noise 10⁻⁴m folds is leave-one-outmore folds stop helping at four
Fig. 1 The noise estimated at the cross-validation minimum, over the true noise, against the number of folds from two to leave-one-out, at the ratio of samples to unknowns on the dial and three noise levels: the median of 80 draws. The dashed line is the prediction’s 1.1.

At 1.25 samples per unknown the median falls from two folds to four — 1.374 to 1.288 at noise 10−210^{-2}, 1.720 to 1.570 at 10−410^{-4} — and then nearly stops. Eight folds, sixteen and leave-one-out read 1.275, 1.270 and 1.271 at 10−210^{-2}; 1.412, 1.397 and 1.397 at 10−310^{-3}; 1.560, 1.518 and 1.519 at 10−410^{-4}. Turn the dial and the shape is the same at every ratio, with the whole curve lower as the samples per unknown rise: at four per unknown leave-one-out reads 1.067, 1.087 and 1.102.

So the prediction fails on ten of the twelve cells. Leave-one-out’s median is under 1.1 only at four samples per unknown with noise 10−210^{-2} and 10−310^{-3}, and it is within four per cent of four folds’ on every cell; the largest difference is 1.570 against 1.519. If the bias came from training on a fraction of the samples it would have shrunk by a quarter of itself between four folds and leave-one-out, which train on 75 per cent and on all but one. It shrinks by about a twentieth. Most of what training size does is between two folds and four, where each fit loses half the samples instead of a quarter, and two folds are high on every cell.

The excess is the fit’s degrees of freedom

What every fold count shares is the fit. Cross-validation’s error at its minimum is the noise plus whatever the fit gets wrong about a sample it did not see, and a regularised fit at a moderate λ\lambda gets something wrong about every sample: it spends some of the data on fitting the signal, and the spending shows up as variance in its predictions. The amount spent has a standard measure. The trace of the hat matrix, df⁡=∑kfk\operatorname{df} = \sum_k f_k, counts the degrees of freedom the fit uses — the number of parameters it is effectively estimating — and a residual from a fit that has spent df⁡\operatorname{df} of mm samples carries noise on only m−df⁡m - \operatorname{df} of them. The prediction error the fit makes at an unseen sample is then larger than the noise by about the reciprocal of that share, and the estimate read from it, over the noise, should be about m/(m−df⁡)\sqrt{m/(m - \operatorname{df})}.

The leave-one-out noise estimate over the true noise against the square root of m over m minus the fit's degrees of freedom at the chosen λ: every draw, and each ratio and noise level's median1.25 per unknown, noise 10⁻²: 1.271 against 1.259, the fit spending 37 per cent of the samples in degrees of freedom; 1.25 per unknown, noise 10⁻³: 1.397 against 1.374, the fit spending 47 per cent of the samples in degrees of freedom; 1.25 per unknown, noise 10⁻⁴: 1.519 against 1.472, the fit spending 54 per cent of the samples in degrees of freedom; 1.5 per unknown, noise 10⁻²: 1.204 against 1.199, the fit spending 30 per cent of the samples in degrees of freedom; 1.5 per unknown, noise 10⁻³: 1.295 against 1.274, the fit spending 38 per cent of the samples in degrees of freedom; 1.5 per unknown, noise 10⁻⁴: 1.399 against 1.345, the fit spending 45 per cent of the samples in degrees of freedom; 2 per unknown, noise 10⁻²: 1.151 against 1.150, the fit spending 24 per cent of the samples in degrees of freedom; 2 per unknown, noise 10⁻³: 1.207 against 1.192, the fit spending 30 per cent of the samples in degrees of freedom; 2 per unknown, noise 10⁻⁴: 1.260 against 1.223, the fit spending 33 per cent of the samples in degrees of freedom; 4 per unknown, noise 10⁻²: 1.067 against 1.069, the fit spending 12 per cent of the samples in degrees of freedom; 4 per unknown, noise 10⁻³: 1.087 against 1.084, the fit spending 15 per cent of the samples in degrees of freedom; 4 per unknown, noise 10⁻⁴: 1.102 against 1.097, the fit spending 17 per cent of the samples in degrees of freedom. The dashed line is equality; 166 of 960 draws lie beyond the frame.11.11.21.31.41.51.61.711.11.21.31.41.51.61.7the square root of m over m minus dfleave-one-out ÷ true noisenoise 10⁻², mediansnoise 10⁻³, mediansnoise 10⁻⁴, mediansopen: single drawstwelve medians on the diagonalthe excess is what the fit spent
Fig. 2 The leave-one-out noise estimate over the true noise against the square root of m over m minus the fit’s degrees of freedom at the chosen λ: every draw, open, and each ratio and noise level’s median, filled. The dashed line is equality.

It is. On all twelve cells the median leave-one-out estimate is within five per cent of the median m/(m−df⁡)\sqrt{m/(m - \operatorname{df})}: 1.271 against 1.259, 1.397 against 1.374, 1.519 against 1.472 at 1.25 samples per unknown; 1.067 against 1.069, 1.087 against 1.084, 1.102 against 1.097 at four. The share of the samples the fit spends is what moves: 37, 47 and 54 per cent at 1.25 samples per unknown from the highest noise to the lowest, 12, 15 and 17 per cent at four. Lower noise means a smaller λ\lambda at the minimum, more filter factors near one, more degrees of freedom spent, and a larger excess — which is the earlier essay’s observation that the bias is largest where the noise is smallest and the samples fewest, with a mechanism attached that has nothing to do with folds. Draw by draw the agreement is looser — the logarithms of the two correlate at 0.63 — because each draw’s df⁡\operatorname{df} is read at a λ\lambda on a grid and each draw’s estimate has its own luck.

The share of the samples a Tikhonov fit spends as degrees of freedom at the leave-one-out minimum — the hat matrix's trace over the number of samples — against the ratio of samples to unknowns, at three noise levels, medians over 80 drawsnoise 10⁻²: 1.25 per unknown 37% (leave-one-out 1.271 times the noise), 1.5 per unknown 30% (leave-one-out 1.204 times the noise), 2 per unknown 24% (leave-one-out 1.151 times the noise), 4 per unknown 12% (leave-one-out 1.067 times the noise); noise 10⁻³: 1.25 per unknown 47% (leave-one-out 1.397 times the noise), 1.5 per unknown 38% (leave-one-out 1.295 times the noise), 2 per unknown 30% (leave-one-out 1.207 times the noise), 4 per unknown 15% (leave-one-out 1.087 times the noise); noise 10⁻⁴: 1.25 per unknown 54% (leave-one-out 1.519 times the noise), 1.5 per unknown 45% (leave-one-out 1.399 times the noise), 2 per unknown 33% (leave-one-out 1.260 times the noise), 4 per unknown 17% (leave-one-out 1.102 times the noise).samples per unknownshare of the samples spent0%10%20%30%40%50%60%1.251.524noise 10⁻²noise 10⁻³noise 10⁻⁴lower noise, a smaller λ, more spentthe excess is set here, not by the folds
Fig. 3 The share of the samples a Tikhonov fit spends as degrees of freedom at the leave-one-out minimum — the hat matrix’s trace over the number of samples — against the ratio of samples to unknowns, at three noise levels, medians over 80 draws.

Drawn against the ratio, the share falls the same way at every noise level and the three lines never cross. At 1.25 samples per unknown the fit spends 37 to 54 per cent of what it is given; at four per unknown, 12 to 17 per cent. That is the whole of the excess’s dependence on the ratio, read straight off the trace: 1/(1−0.54)\sqrt{1/(1 - 0.54)} is 1.47 and 1/(1−0.17)\sqrt{1/(1 - 0.17)} is 1.10, the two ends of the measured medians at the lowest noise. And it says why more samples per unknown help where more folds do not. A fold changes which samples each fit is trained on and leaves the fit’s appetite for degrees of freedom as it was. More samples per unknown leave the appetite roughly fixed, since the signal has the same number of things worth fitting, and divide it by a larger mm.

The draws far above the diagonal are a second effect riding on the first, and where they sit says what it is. Seventy-nine draws read leave-one-out at more than three times the noise, and every one is on the coarsest grid, 24 unknowns, at noise 10−310^{-3} or 10−410^{-4}: all sixteen draws at 10−410^{-4} on every ratio, and fifteen at 10−310^{-3} on the two lowest. None is on a finer grid, and none at noise 10−210^{-2}. That is the signature the grid on which the discretisation stops mattering measured from the other side: on a coarse grid the discretised problem cannot represent the signal it is fitting to better than some fixed accuracy, and once the noise is below that accuracy the misfit is the larger error. Cross-validation measures everything the fit gets wrong about an unseen sample, and on those draws most of it is the model’s, which no choice of folds or λ\lambda removes. The estimate there is not a noise level at all; it is the size of what the grid cannot say.

Never low, and the rule holds

The rest of the prediction stands. Leave-one-out is never below the true noise on any of the 960 draws; its lowest is 1.014, at four samples per unknown. And the discrepancy principle told it keeps its worst draw under 1.2 at every ratio: 1.194, 1.193, 1.180 and 1.179, against four folds’ 1.19. The worst draws of the estimate itself are lower than four folds’ at the corners where it went furthest astray — 36 times the noise at 1.25 samples per unknown and 10−410^{-4}, against four folds’ 51 and two folds’ 141 — but they are the misfit draws, and the rule shrugs them off for the reason the earlier essay gave: the residual curve is flat on the right, so a level too high costs a few per cent.

So leave-one-out is a little better than four folds on every count and the same on the one that mattered. Its cost is lower. Its bias is not, and the bias can now be named.

Taking the fit’s share out

If the excess is m/(m−df⁡)m/(m - \operatorname{df}) in the square, then multiplying the estimate’s square by 1−df⁡/m1 - \operatorname{df}/m should take it out. That is the same correction that turns a residual sum of squares into an unbiased variance by dividing by the degrees of freedom left rather than by the samples — the denominator generalised cross-validation already uses, squared, in its objective.

The leave-one-out noise estimate over the true noise at each ratio of samples to unknowns, as it comes and with the fit's own share taken out: the highest median of three noise levels and the lowest of 240 drawsleave-one-out, median: 1.519, 1.399, 1.260, 1.102; leave-one-out, lowest: 1.078, 1.066, 1.022, 1.014; fit's share out, median: 1.073, 1.046, 1.032, 1.011; fit's share out, lowest: 0.645, 0.722, 0.745, 0.962 at 1.25, 1.5, 2 and 4 samples per unknown. With the share taken out the estimate is below the noise on 344 of 960 draws.of 960 drawsleave-one-out below the noise0share taken out, below3440.60.70.80.911.11.21.31.41.51.6samples per unknownestimate ÷ true noise1.251.524leave-one-out, medianleave-one-out, lowestfit's share out, medianfit's share out, lowestdashed: the highest median · solid: the lowest drawunbiased, and below the noise a third of the time
Fig. 4 The leave-one-out noise estimate over the true noise at each ratio of samples to unknowns, as it comes and with the fit’s share taken out: the highest median of three noise levels, dashed, and the lowest of 240 draws, solid.

It works on the median. With the share taken out, the median over the true noise is between 1.005 and 1.073 on every cell, and within 1.03 on eight of twelve. And it breaks the property the earlier essay held essential: the corrected estimate is below the true noise on 344 of the 960 draws — about a third — and as low as 0.645 at 1.25 samples per unknown. An unbiased estimate of a noise level is below it about as often as above, and that is what an unbiased estimate is.

Choosing without knowing found the discrepancy principle catastrophic when told a noise level ten times too small, and an estimate that shares the dips’ luck watched it miss by 570,000 times when told the least-squares residual’s estimate. Both are what a low level does to this rule. So a third of the draws below the noise looks like a disaster in waiting.

The discrepancy principle's worst draw of 240 at each ratio of samples to unknowns, error over the oracle's, told the leave-one-out noise estimate, told it with the fit's share taken out, and told the true noisetold leave-one-out: 1.194, 1.193, 1.180, 1.179; told it, share taken out: 1.163, 1.162, 1.160, 1.164; told the true noise: 1.163, 1.162, 1.155, 1.164 at 1.25, 1.5, 2 and 4 samples per unknown.11.051.11.151.21.25samples per unknownerror ÷ oracle's, worst draw1.251.524told leave-one-outtold it, share taken outtold the true noiseall three within a fifth of the oraclea level a third low costs nothing here
Fig. 5 The discrepancy principle’s worst draw of 240 at each ratio, error over the oracle’s: told leave-one-out, told it with the fit’s share taken out, and told the true noise.

It is not. Told the corrected estimate, the discrepancy principle’s worst draw is 1.163, 1.162, 1.160 and 1.164 at the four ratios. Told the true noise it is 1.163, 1.162, 1.155 and 1.164. Told leave-one-out uncorrected, 1.194, 1.193, 1.180 and 1.179. The corrected estimate is as good as knowing the noise, on the worst draw at every ratio, and better than the estimate that was never low.

The two facts fit together once the size of the error is in view. What hurt the discrepancy principle before was an estimate low by a factor of ten or of hundreds of thousands, and the least-squares residual’s estimate was that low because it was read at λ=0\lambda = 0, where the fit had spent every degree of freedom it had. The corrected estimate is low by at most 35 per cent. On these problems the residual curve is steep enough that a level a third low moves λ\lambda by little, and flat enough on the right that a level a few per cent high costs a few per cent. “Never low” was the right demand of the estimates the earlier essays had, which were either never low or wildly low. It is not a property the rule needs; what it needs is an estimate that is not far off, and the corrected leave-one-out estimate is never more than 35 per cent below the noise or, at its median, more than 7 per cent above.

Why the folds were blamed

The four-fold essay’s explanation was reasonable from what it could see. It measured one fold count, so it could not separate what changes with the folds from what does not, and the training fraction was the obvious thing a fold count changes. An estimate that shares nothing with the fit, the essay before it, held out a single quarter and fitted the other three, and its estimate’s trouble was scatter — too few held-out samples to average — which more folds did cure. The two defects looked alike from one fold count each, and only one of them belonged to the folds. Its other observation — the bias largest at low noise and few samples per unknown — was true and is explained better here: those are exactly the corners where the fit spends most of its samples on degrees of freedom. A share of 54 per cent at 1.25 samples per unknown and noise 10−410^{-4} puts the excess at 1/0.46=1.47\sqrt{1/0.46} = 1.47, and the measured median there is 1.52.

More samples take the floor and leave the dip found that oversampling does something similar to generalised cross-validation’s objective: it changes what the floor of the curve is, and it leaves the defect that was the reason for looking. Here more samples per unknown shrink the excess by shrinking the share the fit spends — 54 per cent at 1.25 per unknown, 17 at four — and no number of folds does.

What this changes, and what it does not

For the discrepancy principle the practical answer is now simple. Estimate the noise by leave-one-out, which for Tikhonov costs one decomposition and is as good as any fold count; multiply the estimate’s square by 1−df⁡/m1 - \operatorname{df}/m at the λ\lambda where it was read; and hand the result to the rule. On these 960 draws that is indistinguishable from being told the noise.

For the guard on generalised cross-validation it changes nothing, and it is worth saying why. The four-fold essay found the guard needs a noise estimate that does not share the residual’s luck, and that no estimate made from the same samples qualifies. Correcting the bias leaves the sharing exactly where it was: the corrected estimate is made from the same residuals, at the same λ\lambda, with the same draw’s luck in it. A unit is a statement about the noise reached the same conclusion for total least squares: what the data alone can supply about their own noise is limited by the fact that they are the data.

The rule that needs no noise level at all is still in the comparison. The minimum on the right proposed taking generalised cross-validation’s rightmost local minimum, and the earlier essay found it right to the grid on the typical draw — a median of 1.004 or 1.005 over the oracle — and wrong by 2.57 to 3.70 on the worst. The discrepancy principle told the corrected estimate has its median a few per cent above the oracle and its worst at 1.16. The choice between them is the one the earlier essay described, a few per cent on every draw against a factor of three on some, and the corrected estimate moves the second rule’s worst draw down to the true noise’s without changing that trade.

What 960 draws do not show

One family of problems: a blurred signal, Tikhonov’s filter, a grid of 121 values of λ\lambda. The hat-matrix identity holds for any linear smoother, and the degrees-of-freedom argument for any fit whose prediction variance is set by its trace, but a truncated decomposition spends its degrees of freedom in whole units and might read differently at the boundary. White Gaussian noise of one level per draw; with noise whose level varies across samples, leave-one-out weights each sample’s error by its own leverage and the correction by an average share might over-correct some samples and under-correct others. And the misfit draws, where the discretised problem cannot represent the signal to the noise’s accuracy, are present at the coarsest grid only, so how a corrected estimate behaves when model error is the larger part everywhere is not measured.

Still open: a corrected estimate for the guard, and noise from outside the sample

Noise from outside the sample. The earlier essay’s second prediction still stands untested: a guard told an estimate from four replicate readings of each sample — independent of the fitted data by construction — refuses more dips than real minima at the 1% threshold, the first configuration in these essays to do so. This essay adds a sign to its other half: the discrepancy principle told that replicate estimate does no better than told the corrected leave-one-out estimate, whose worst draw is already within 0.01 of the true noise’s at every ratio.

Where the correction over-corrects. The corrected estimate’s lowest draws, at 0.65 to 0.75 of the noise, are all at 1.25 to 2 samples per unknown, where the fit spends the largest share. The prediction is that they are the draws whose chosen λ\lambda sits furthest left of the oracle’s — where df⁡\operatorname{df} is read too high — and that reading df⁡\operatorname{df} at the discrepancy principle’s own λ\lambda instead, iterating once, lifts every one of them above 0.85 without moving the median by more than two per cent.

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.

Cross-validationDiscrepancy principleGeneralised cross-validationLeverageNoise levelParameter choiceRegularisationTikhonov regularisation