Fundamentals / Numerical mathematics / Inverse problems and least squares / Inferring parameters and fields from observations

How an integral instrument becomes a matrix

Construct two discrete models of the same measurement, diagnose noise with a Picard plot and test a regularisation parameter against a deliberately imperfect instrument model.

Derive the matrix twice from the same kernel

Suppose an instrument measures \(b(s)=\int_0^1 K(s,t)x(t)\,dt+e(s)\). With square-integrable kernel this forward operator is compact on \(L^2\). Small singular values suppress some source directions. For a midpoint rule with source nodes \(t_j\) and weights \(w_j\), collocation at receiver nodes \(s_i\) gives \(b_i\simeq\sum_j K(s_i,t_j)w_j x(t_j)\). To compare spectra over nonuniform meshes, use the variables \(\sqrt{w_j}x(t_j)\) and data \(\sqrt{v_i}b(s_i)\). The Euclidean matrix is \(A_{ij}=\sqrt{v_i}K(s_i,t_j)\sqrt{w_j}\). Noise whitening is an additional operation using the measurement covariance.

Projection instead represents \(x=\sum_j c_j\phi_j\) and tests against \(\psi_i\). For orthonormal bases the matrix and data are

\[G_{ij}=\int_0^1\int_0^1\psi_i(s)K(s,t)\phi_j(t)\,dt\,ds,\]
\[d_i=\int_0^1\psi_i(s)b(s)\,ds.\]

For cell indicators normalised by the square root of cell length this double integral averages the response over both the detector and the source footprint. For nonorthonormal bases use mass matrices to measure physical norms. Omitting these metrics changes the meaning of singular values as the mesh changes.

Take \(K=1+st\), two equal cells and coincident midpoint receivers. The weighted midpoint and cell-average projection agree because the kernel is affine in each argument. The two matrices equal one half times the matrix with rows \((17/16,19/16),(19/16,25/16)\). Their determinant is \(1/16\). Changing to \(K=1+s^2t^2\) gives midpoint squares \(1/16,9/16\) while their cell averages are \(1/12,7/12\). The resulting spectra differ even with exact arithmetic. Refining both grids and inspecting the spectrum that stays above the data-noise floor distinguishes discretisation from information.

Read data and singular values together

For \(A=U\Sigma V^T\), the noise-free continuum solution has finite energy if \(\sum |u_i^Tb_{\rm exact}/\sigma_i|^2<\infty\), with no inaccessible data component. With independent whitened noise of similar variance in each left singular direction, \(|u_i^Tb|\) eventually follows a roughly flat noise floor. A Picard diagram plots \(\sigma_i\), \(|u_i^Tb|\) and their quotient against index. For an exact quotient proportional to \(i^{-1}\) the squared sum converges. If the noise coefficients have typical size \(\delta\) and \(\sigma_i\sim i^{-2}\), their quotients typically grow like \(\delta i^2\). The index where the data cease to decay depends on the observation and its noise.

Derive what an L-curve actually plots

For identity Tikhonov and strength \(\mu\), write \(b_i=u_i^Tb\) and \(f_i=\sigma_i^2/(\sigma_i^2+\mu^2)\). The residual and solution coordinates of the L-curve are

\[R^2=\sum_i(1-f_i)^2 b_i^2+\|b_\perp\|^2,\]
\[S^2=\sum_i(f_i b_i/\sigma_i)^2 .\]

Mark \((\log R,\log S)\) against \(\log\mu\). A bend can reveal the transition from fitting signal to amplifying noise. With \(\eta=\log\mu\) its curvature magnitude is \(|X'Y''-Y'X''|/(X'^2+Y'^2)^{3/2}\) for \(X=\log R,Y=\log S\). Sparse sampling or multiple spectral clusters can give competing curvature peaks. If \(b\) has energy in only one singular direction, the curve reflects the scale of that mode even with zero noise. A corner by itself then provides no data-driven noise estimate. Compare with a discrepancy level justified by instrument noise, or held-out predictive error and GCV.

For a reproducible ambiguous corner choose singular values \((1,s)\) and data coefficients \((1,\sqrt{s})\), with \(s=10^{-3}\). Replacing \(\mu\) by \(s/\mu\) swaps each filter with the complement of the other. Substitution gives \(R(s/\mu)=\sqrt{s}\,S(\mu)\) and \(S(s/\mu)=R(\mu)/\sqrt{s}\). In log coordinates this transformation is a reflection and preserves curvature magnitude. The two outward bends near \(\mu=s\) and \(\mu=1\) therefore have equal curvature. These choices differ by roughly a thousand in regularisation strength. If the second measured coefficient is reliable, damping it away costs information. If that coefficient is mostly noise, keeping it produces a state component amplified by \(1/s\). The shape of this curve cannot decide which measurement assumption applies.

OneSimulation experiment · Reconstruct data from an independently discretised instrument

Vary the true blur width or noise seed. Decide which feature persists across plausible instruments.

Download the executable notebook · Python source

Adjust the experiment in the browser. Start with matching blur widths and zero noise. Increase the noise, then vary \(\mu\) to trade oscillatory reconstruction against loss of the small-scale signal. Finally change only the true width. A small data residual can now coexist with a biased reconstruction. Every adjustment regenerates the data on 1024 source cells and solves the 32-variable regularised normal system by Cholesky factorisation. The browser keeps one reproducible noise pattern so a slider movement isolates a parameter change. The downloadable OneSimulation model below makes the same distinction between data and inversion grids and adds spectral diagnostics; its random generator produces a different noise sample.

"""Observe model error in a periodic deblurring experiment on different grids."""
import matplotlib.pyplot as plt
import numpy as np
from onesim.numerics.linear.matrices.dense_linear_algebra import solve_dense

def instrument(receivers, sources, width):
    delta = (receivers[:, None] - sources[None, :] + 0.5) % 1 - 0.5
    kernel = np.exp(-(delta/width)**2/2)
    return kernel / kernel.sum(axis=1)[:, None]

def signal(x):
    return np.cos(2*np.pi*x) + 0.4*np.sin(10*np.pi*x)

fine = (np.arange(1024)+0.5)/1024
coarse = (np.arange(32)+0.5)/32
design = instrument(coarse, coarse, 0.045)
rng = np.random.default_rng(17)
noise = rng.normal(0, 0.002, coarse.size)
strengths = np.logspace(-4, -0.4, 32)
fig, (picard, resolution, ax) = plt.subplots(1, 3, figsize=(11.2, 4), layout="constrained")
left, singular, _ = np.linalg.svd(design, full_matrices=False)
indices = np.arange(1, len(singular)+1)
picard.semilogy(indices, singular, color="black", label="Singular values")
for trial in [0.01, 0.1]:
    gain = singular**2 / (singular**2 + trial**2)
    resolution.plot(indices, gain, label=f"μ = {trial:g}")
resolution.set(xlabel="Mode", ylabel="Resolution gain")
resolution.legend()
for width in [0.045, 0.065]:
    data = instrument(coarse, fine, width) @ signal(fine) + noise
    picard.semilogy(indices, abs(left.T @ data), ".", label=f"Data, width {width}")
    errors = []
    for mu in strengths:
        state = solve_dense(design.T @ design + mu**2*np.eye(coarse.size), design.T @ data)
        errors.append(np.linalg.norm(state-signal(coarse))/np.sqrt(coarse.size))
    print(f"True width {width:.3f}: minimum grid RMS error {min(errors):.5f}")
    ax.loglog(strengths, errors, label=f"True instrument width {width}")
ax.set(xlabel="Tikhonov parameter", ylabel="Reconstruction RMS error")
ax.legend(fontsize=8)
picard.set(xlabel="Mode", ylabel="Magnitude")
picard.legend(fontsize=8)
fig.savefig("numerics-inverse-blur.png", dpi=170)

Output from the reference run

True width 0.045: minimum grid RMS error 0.01013
True width 0.065: minimum grid RMS error 0.18949
Noise, spectral resolution and reconstruction error expose different limitations of two blur models.
Noise, spectral resolution and reconstruction error expose different limitations of two blur models.
Why separate the generation and inversion grids?

Matrices on the same grid share quadrature and representation errors. Synthesising \(b=Ax\) and inverting with exactly that \(A\) omits those errors from the test. A finer source grid and slightly perturbed blur width create two separately controllable discrepancies. The reconstruction notebook shows how the best achievable error changes when only the assumed width is wrong.

Tutorial on weighted spectra and resolution

Calculate the two singular values of the midpoint example

Work through the solution

The matrix is symmetric positive definite with trace \(21/16\) and determinant \(1/16\). Its eigenvalues are \((21\pm\sqrt{377})/32\), also its singular values. The smaller mode is much more sensitive to perturbations in the measurements.

Distinguish variance reduction from regained resolution

Work through the solution

In singular direction \(i\) the mean reconstruction of a true coefficient \(x_i\) is \(f_ix_i\) and independent data noise of variance \(\delta^2\) contributes variance \(\delta^2 f_i^2/\sigma_i^2\). Larger \(\mu\) lowers both gain and variance. A small repeat-to-repeat spread can coexist with a strongly suppressed feature.

Hansen · discrete inverse problems and teaching materials