- Home
- Library
- Computational Quantum Field Theory
- What Euclidean Data Can Resolve
- Correlated Least Squares and Regularization
Correlated Least Squares and Regularization
A spectral reconstruction can predict every measured correlator reasonably well and still give an unusable density. Regularization controls the poorly measured directions, but its strength and reference spectrum become part of the estimator. Estimating the covariance introduces another source of uncertainty.
This article derives correlated least squares, truncated SVD and Tikhonov regularization, then applies them to one fixed noisy experiment. The results include a failure: a predeclared generalized-cross-validation rule occasionally chooses extreme underregularization. We retain those cases and compare their predictive accuracy with their spectral errors. An exact two-parameter fit shows what additional model information can buy.
Preparation: the positive spectral benchmark and whitened singular directions, covariance, and constrained optimization. For explicitly positive estimators, continue to maximum entropy; for a target chosen before inversion, see smeared spectra.
The observation model determines the residual norm
Our continuous truth is the normalized two-triangle spectrum
The true parameters are ; all support lies in . Its exact correlator is
At , , observe , where . We use
The fixed reference is the primary truth at the nominal times. It does not change with fitted parameters. The three declared noise levels are , , and .
For a proposed mean , the negative Gaussian log likelihood, up to constants independent of , is
Writing gives . Solve with the triangular factor; an explicit covariance inverse is unnecessary. Whitening accounts for both unequal variances and correlations. Replacing by its diagonal changes the statistical problem.
Normalization and the reference spectrum
Represent a density by constant bins of width using the orthonormal functions . Let be its coefficients. Then
The exact normalization constraint is , with . Choose a normalized reference and an orthonormal basis for :
This removes the constraint before fitting. Our main reference is the uniform density. We also test the normalized density , integrated into the bins.
The bin truth used for parameter errors is the orthogonal projection of the continuous triangle spectrum. Its bin masses are obtained from the exact triangular CDF. Since the generating density is not constant in each bin, the forward discrepancy and the projection error are separate from noise.
In particular,
The second term is independent of the estimator. It equals , , and for , , and , respectively. This comparison avoids generating truth on the same grid used for inversion.
Truncation and damping of singular directions
Let . With no regularization, a coefficient along contains . A small singular value amplifies unit-variance whitened noise.
Truncated SVD retains only directions:
Tikhonov regularization instead minimizes
and gives
Here is the fitted whitened mean. Truncation makes a sharp choice of directions; Tikhonov damps them continuously. Both formulas are evaluated by SVD, without forming . P. C. Hansen, §§2.2–2.4 (PDF).
For a fixed filter, write the result in original data coordinates as
Then
The reference contribution is essential. If , the bias is
An unconstrained direction remains at its reference value. A covariance formula describes fluctuations about the estimator's expectation; it does not remove this bias. Changing the reference can change spectral features with little effect on predicted data.
Choose the rule before inspecting truth
Our main selection rule is generalized cross-validation:
Its motivation is prediction of omitted data, with an orthogonally invariant approximation to the prediction penalty. It is not an optimization of unknown spectral error. P. C. Hansen, §2.9, Eq. (2.62) (PDF).
The finite experiment fixes the following choices before sampling:
- Tikhonov uses 67 logarithmically spaced values of , from to .
- TSVD uses , where counts . This arithmetic guard is not a physical resolution criterion.
- Minimize GCV on these grids; exact ties favor more regularization. Retain endpoint minima.
- Repeat the same observations at , , and . The main grid is .
- Independently declared fixed controls use , , and .
No positivity constraint is imposed on these linear reconstructions. Negative bins are reported. Clipping them and renormalizing would define a different nonlinear estimator with different bias and variance.
An actual GCV failure: prediction can remain good
For each noise level, generate 256 independent observations and 256 independent predictive replicates from the same true spectrum. Methods share the actual observed arrays. Independent predictive errors are evaluated using the true covariance.
At and , the frozen calculation gives:
| Selection | Median error | RMSE | Predictive |
|---|---|---|---|
| TSVD, GCV | |||
| Tikhonov, GCV | |||
| Fixed | — |
The last column reports the mean over independent repeats and its standard error. The RMSE includes every repeat. It is not an error bar on one fitted spectrum.
The enormous difference between median error and RMSE is real: TSVD chooses the largest allowed rank, , in 14 of 256 cases. Tikhonov chooses its smallest allowed in two cases, with additional severe underregularized cases nearby. These rare results dominate squared spectral and target errors while adding only moderately to prediction error. All 256 linear reconstructions contain negative bins. Narrowing the candidate grid after observing this outcome would be a new procedure; it was not done.
The fixed control illustrates a different tradeoff: it has larger predictive error but avoids those huge spectral excursions. For the normalized Gaussian target centered at with width , its RMSE is . That good value concerns this particular target and truth. It does not make the visibly biased spectrum generally accurate or establish an optimal rule.
The retained comparisons use all 256 observations at each noise level, including extreme GCV selections. The spectral RMSE and median summarize different parts of a heavy-tailed error distribution. The covariance comparison reuses the same nominal-noise observations with independent calibration samples. These are finite synthetic experiments, not measured lattice spectra.
The large coefficients also expose arithmetic cancellation. Although the parameterization enforces normalization algebraically, the worst binary64 TSVD output at has a normalization defect . Directly multiplying its coefficients by differs from the more stable SVD prediction by at most , or in Mahalanobis norm. The corresponding Tikhonov maxima are for normalization and for prediction. The original outputs are retained; an extra normalization repair is not silently applied.
For the three fixed-alpha controls, the empirical variances of the six Gaussian targets are between about and times their analytic values across 256 repeats. This supports the implemented fixed-filter covariance calculation. It does not justify applying that covariance unmodified after GCV selection: the selected filter depends on the same noisy vector.
What a correct finite family supplies
Now assume the spectrum really belongs to the two-triangle family with and . Fit its exact continuous transform by correlated least squares. This gives genuine parameter errors rather than assigning peak labels to a signed bin reconstruction.
With , the needed derivatives are
The companion uses nine fixed starts, with chosen from , , and , and from , , and . It retains every optimizer outcome. All three stopping tolerances are , with at most 300 function evaluations per start. A successful change-in-cost or step-size termination is distinguished from reaching the requested gradient tolerance. SciPy 1.13.1, bounded least squares.
| Noise | RMSE of | RMSE of | Local 95% ellipse coverage |
|---|---|---|---|
No selected fit touches a parameter boundary. All starts return a successful optimizer termination, but only 9, 6, and 0 selected fits, respectively, meet the gradient tolerance. Those distinctions remain in the output. An exact noiseless control recovers the parameters to .
The local covariance is computed from the SVD of the whitened Jacobian, :
The displayed ellipses use the local quadratic approximation and the 95th percentile of . The coverage estimates from repeated data have binomial uncertainty. The finite family's information does not refute the positive nonuniqueness construction outside that family.
A covariance estimate is another random input
At nominal noise, independently draw 128 calibration vectors for each of the 256 observed data sets. Estimate covariance from either the first 32 or all 128 vectors, subtracting the sample mean and dividing by . Refit the same observations with each estimate.
For components and independent Gaussian calibration samples,
Thus an unbiased sample covariance does not have an unbiased inverse. The scalar factor corrects the mean precision matrix under these assumptions. It does not make the covariance known or supply a generally correct parameter likelihood. Hartlap, Simon and Schneider, §3.1, Eqs. (16)–(17) (PDF).
For our experiment:
| Covariance input | RMSE of | RMSE of | Local 95% ellipse coverage |
|---|---|---|---|
| Known | |||
The ellipses in the latter rows use the uncorrected plug-in covariance. These rows expose its limitation rather than advertising valid 95% intervals. The mean dimensionless precision trace is for 32 samples, compared with the analytic factor ; for 128 samples it is , compared with .
A scalar precision correction cannot improve these point estimates: it multiplies the whole GLS objective by a constant. For our relative-alpha GCV grid it also rescales all singular values and candidate alphas together, leaving the mathematical selection unchanged. A binary64 diagnostic differs by relatively in a sensitive reconstruction, which is recorded as an arithmetic effect. Correcting an average scale is not a substitute for accounting for covariance uncertainty and regularization selection.
The companion repeats the bin reconstructions with these estimated covariances too. Their extreme GCV cases persist, and their nominal fixed-filter intervals omit selection, bias and covariance uncertainty. Their measured coverage is reported with that qualification.
Reproduce the finite experiment
From the source distribution:
python3 examples/computational-qft/inverse-problems/spectral_data.py
python3 examples/computational-qft/inverse-problems/regularized_spectra.py
The first command generates the frozen primary archive. Observation seeds are ; independent predictive seeds use family 11, and covariance calibration uses . The companion retains these settings, selected observations, diagnostics and all optimizer statuses. Exact-family fits are computed once per observation/covariance and reused across bin comparisons. Its checkpoint validates the data and fitting settings before reuse.
Summary
Correlated least squares supplies the correct data metric; regularization supplies a controlled preference in weakly observed spectral directions. Neither makes spectral accuracy equivalent to a good correlator fit. The reference, selection rule and estimated covariance all affect the estimator. Repeated prediction and parameter checks reveal failures that a training residual or optimizer success flag can miss.
Exercises
1. Bias, variance and an invisible reference component
In a whitened singular direction, suppose , with of mean zero and variance one. For , derive the mean-square error. What happens in an exact null direction?
Solution
For ,
Consequently,
The first term decreases as the signal is retained, while the second increases. If the true were known, the minimizing filter would be
This is an explanatory bound on what a filter could achieve, not a usable rule based on unknown truth.
For , the data distribution is independent of . The usual minimum-norm reconstruction sets the deviation coordinate to zero, so the original spectrum retains its reference component in that direction. Its reported noise variance can be zero while its bias is nonzero. Adding the reference term to the expectation makes this distinction explicit.
2. Independent prediction and spectral accuracy
Let be any estimator from the observed data, including a data-selected regularizer. An independent observation is , with known covariance . Prove
Solution
Condition on the fitted data, so is fixed relative to the independent new noise. Expanding the square gives the squared mean-prediction error, the squared whitened noise, and a cross term. The cross term averages to zero; the noise term has expectation . Averaging over the original data proves the identity. Linearity of the estimator is not required.
The identity uses the true covariance and an independent new observation. A training residual uses noise already available to the fit and need not obey it. Replacing by a random estimate also changes the expectation unless its randomness and independence are handled.
Finally, prediction error controls a spectral direction only through its singular value. If lies in a weak direction, its whitened prediction error is . A moderate predictive score can therefore coexist with an enormous coefficient error. An exact null direction costs no prediction error at all.
References
- P. C. Hansen, Regularization Tools: A Matlab Package for Analysis and Solution of Discrete Ill-Posed Problems, Version 4.1 (March 2008), author's manual (PDF), §§2.2–2.4 and §2.9, especially Eqs. (2.61)–(2.63). Reference terms, SVD filters and parameter-choice rules.
- J. Hartlap, P. Simon and P. Schneider, “Why your model parameter confidences might be too optimistic: unbiased estimation of the inverse covariance matrix,” Astronomy & Astrophysics 464, 399–404 (2007), arXiv:astro-ph/0608064v2 (PDF), §§2.1 and 3.1, Eqs. (16)–(17). Gaussian sample-covariance and inverse-covariance assumptions.
- SciPy developers, SciPy 1.13.1 Manual, bounded nonlinear least squares, trust-region reflective method, Jacobian and termination criteria. The numerical experiment uses the installed version and reports its distinct stopping conditions.
Scrollable formula. Use Left and Right arrow keys to reveal hidden content.
Scrollable table. Use Left and Right arrow keys to reveal hidden columns.
Scrollable figure. Use Left and Right arrow keys to reveal hidden content.