Chapter 1 · Forward maps, information and identifiability
Decide what a measurement can tell you before attempting to fit it. Separate nonuniqueness, noise sensitivity and model error.
From first principles
Decide what a measurement uniquely determines
A forward model predicts readings from a state. In a linear discretization write \(y=Ax\); row \(i\) lists the sensitivity of the \(i\)th reading to each state component. If two states give the same data, subtract their equations. Their difference must be invisible to every measurement,
Thus, if \(x_0\) is one solution, all exact solutions are \(x_0+h\) for \(h\) in the null space of \(A\). A reported quantity \(q=c^Tx\) can still be unique even if the full state is ambiguous: its value must be unchanged by every invisible displacement. To test this, find a weight vector \(w\) that expresses \(c\) in terms of the measurement rows. Substituting it into the quantity of interest gives
This equality identifies the quantity directly from the measurements. Small but nonzero sensitivities create a different difficulty: the state can be unique in exact arithmetic while realistic measurement errors leave its numerical value uncertain.
Background · Forward operator
The operator maps parameters to predicted observations. The noise and discrepancy model must use the same physical units as the readout.
Open full-size diagram
Derivation and applications
Separate amplitude and decay rate using two observation times
A single positive reading of \(y(t)=A e^{-kt}\) admits many pairs of amplitude \(A\) and rate \(k\). Two measurements at different times can remove that ambiguity, but the spacing matters when readings are imperfect. Assume a single exponential, constant positive amplitude and positive noiseless signal, with independently calibrated times \(t_1<t_2\). Taking the ratio of the two exact data eliminates the unknown amplitude,
This inversion is unique even though an individual observation cannot distinguish the two parameters. The local sensitivity of the inferred rate is obtained by differentiating both logarithms. For small errors and independently known times,
If the measurements have independent relative standard deviations \(s_1,s_2\), squaring the coefficients and adding their variances gives
A shared multiplicative calibration factor cancels from the ratio exactly. A shared additive background generally does not cancel, particularly once the signal becomes small. Choosing measurements far apart helps at fixed fractional precision; under fixed absolute noise the later signal may lose sufficient precision to reverse that benefit. Two data can fit two parameters exactly and consequently do not check whether a single exponential describes intermediate times.
Worked example
Recover a decay and test an unused observation
At \(t=1\) and \(4\,\mathrm s\), a sensor reads 12 and 3 in the same units. The inferred rate is
At \(2.5\,\mathrm s\), halfway between the observations, the model predicts the geometric mean \(\sqrt{12\times3}=6\). A third reading of 7 reveals a deviation that the exact two-point fit could not show.
Second application
Specify the timing separation required for precision
For a second instrument the fractional standard deviation is 0.030 in both channels. To achieve rate standard deviation \(0.010\,\mathrm{s^{-1}}\), the separation must be at least \(\sqrt2(0.030)/0.010=4.24\,\mathrm s\) under these noise assumptions. Observations separated by only \(0.50\,\mathrm s\) give \(0.0849\,\mathrm{s^{-1}}\), even though they still determine a unique mathematical solution.
Turn a measurement protocol into an operator
Imagine reconstructing the temperatures of two adjoining cells, \(x_1,x_2\), from sensor readings. A sensor averaging both cells gives
The vector \(x\) describes physical properties; the forward map predicts what this particular instrument will report. A second instrument may measure the same properties through a different map. Include spatial averaging, response time and calibration in that map if they are significant. Treating a finite-width sensor as an exact point sample can make an accurate experiment look inconsistent.
For a linear experiment write \(y=Ax+\epsilon\), separating the ideal response from data error. With the averaging sensor, \(x=(20,24)\) and \((21,23)\) both give 22. The difference is a multiple of \((1,-1)\), which \(A\) maps to zero. The data specify an affine family \(x=x_0+z\), \(z\in\ker A\). More decimal places for the very same measurement cannot select one member. A unique reported answer may therefore reflect a chosen convention such as minimum norm or smoothness instead of new physical information.
Build a ray matrix from attenuation measurements
How does a detector reading become a row of a matrix? In a simple transmission scanner, assume a narrow monochromatic beam, negligible scattering into the detector and a known incident intensity \(I_0\). Over a short path segment \(ds\), the fractional intensity loss is \(\mu(s)\,ds\) to first order. Dividing the resulting differential equation \(dI/ds=-\mu I\) by \(I\), then integrating along the ray \(\gamma_i\), gives
The last equality assumes the attenuation is constant within each model cell. The coefficient \(\ell_{ij}\) is the length of the path through cell \(j\). An unvisited cell contributes zero. Model refinement changes these lengths and the number of columns. With lengths in centimetres and attenuation in inverse centimetres, each log reading is dimensionless. This construction models individual rays. A finite detector that pools their intensities requires an additional averaging step in the forward model.
Background · Why does a logarithm change the statistical weight of a ray?
Photon transmission with a known incident mean \(I_0\) produces a mean outgoing count \(\mu=I_0 e^{-a^Tx}\). Geometry becomes linear in optical depth after taking a logarithm. The resulting noise is no longer constant across rays. If the detected count \(N\) is Poisson and reasonably large, its variance is \(\mu\). Linearising \(y=-\log(N/I_0)\) therefore gives
A ray with 100 expected counts has an optical-depth standard deviation near 0.10, compared with roughly 0.01 for 10,000 counts. Equal weights in the log-transformed fit give these readings equal influence despite their different precision. At very low intensities, zero counts make the logarithm undefined; fitting a count likelihood preserves those observations.
Which extra direction resolves a four-cell ambiguity?
Arrange four square cells of side \(1\) cm in two rows and list them in row-major order. Two horizontal and two vertical centre rays have log readings \(0.4,0.6,0.5,0.5\). Each traversed cell contributes one centimetre. The sum of the two horizontal readings equals the sum of the vertical readings, leaving three independent equations. If the top-left attenuation is \(t\), successive substitutions give the family
Even positivity admits \(0\le t\le0.4\). The vector \((1,-1,-1,1)\) describes a checkerboard change invisible to the original views. Add a diagonal ray joining the outer corners through cells 1 and 4. Each diagonal chord is \(\sqrt2\) cm. If the reading is \(0.3\sqrt2\), division by \(\sqrt2\) gives \(2t+0.1=0.3\), so \(t=0.1\). The field is \((0.1,0.3,0.4,0.2)\) in inverse centimetres. The extra row acts on the previous null vector by \(2\sqrt2\). Its orientation supplies the missing information. Repeating any original ray could improve its measurement precision but would preserve the checkerboard ambiguity.
Practise on sheet 1 · A detector that pools two unresolved rays. Further reading · Technical University of Denmark · Scientific Computing for X-Ray Computed Tomography · Discretization of CT Problems, slides 7, 9–10 and 16, Intersection of Line and Pixel, The Line Model and The System Matrix.
Find the observable combinations
Every row of \(A\) is a measured linear combination. Every vector in its null space is orthogonal to all those rows. Thus a derived linear quantity \(c^\mathsf{T}x\) is uniquely determined by ideal data exactly when \(c\) lies in the row space. If \(c=A^\mathsf{T}w\), compute it as \(w^\mathsf{T}y\). Conversely, any component of \(c\) along a null direction changes the quantity while leaving the data unchanged. This test can rescue a useful question from an underdetermined experiment. Both temperatures may be ambiguous while their mean is measured precisely.
Take a second reading \((x_1+x_2)/2+\eta(x_1-x_2)/2\). Subtract the first reading to isolate the contrast,
With \(\eta\ne0\) both temperatures are identifiable in exact arithmetic. At \(\eta=0.01\), a difference error of just 0.02 K changes the recovered contrast by 4 K. Algebraic rank has improved, but the measurement has barely separated the two states. Changing the second sensor's spatial weighting can be much more effective than repeating its reading.
Translate a nonlinear ambiguity into an experiment
For a decay \(y(t)=A e^{-kt}\), an observation at \(t=0\) identifies \(A\) and says nothing about \(k\). A single later observation allows the continuum \(A=y(t)e^{kt}\). Two exact positive observations at distinct times yield
This identifies both parameters under the assumed model. When the times are almost equal the denominator is small, which makes the slope sensitive to measurement noise. Late measurements can also be difficult when responses approach the instrument's noise floor.
Always state the admissible parameter set. A power reading \(y=p^2\) determines \(|p|\); if physics requires \(p\ge0\), the sign ambiguity disappears, though sensitivity near zero still needs attention. In later chapters we will assess local sensitivity with derivatives. A full-rank local derivative distinguishes sufficiently close parameters under suitable regularity; widely separated alternatives can remain.
Establish a baseline for a reconstruction
Write down the unknowns with units, the controlled inputs, the measurements and their precision. Predict what changes when one unknown increases with all others fixed. Look for symmetries and parameter combinations that move predictions together. Finally name a second measurement able to separate them. This sequence gives a reason for the later numerical choices: least squares reconciles inconsistent data, while regularisation controls amplification or deliberately selects among weakly distinguished solutions.
Characterise an identifiable output without reconstructing the state
Suppose an experiment provides exact linear observations \(Ax=y\) and a scientist wants a scalar \(Q=c^Tx\). Any two compatible states differ by a vector \(v\) satisfying \(Av=0\). Their outputs differ by \(c^Tv\). Consequently the output is identifiable for every compatible data set precisely when \(c\) is orthogonal to the nullspace. This condition can be checked entirely from the design, before taking a measurement. If it fails, arbitrarily precise measurements with the same operator cannot answer the scientific question unless other assumptions restrict the states.
There is a constructive version. Every row of \(A\) is orthogonal to every null vector. The row space has dimension equal to the rank, whereas the nullspace dimension is the number of columns minus the rank. These dimension counts show that all vectors orthogonal to the nullspace lie in the row space. Hence the test is equivalent to solving \(A^Tw=c\) for observation weights \(w\). When the test succeeds, \(Q=w^TAx=w^Ty\). The weights specify exactly which combination of instrument readings answers the question without requiring a particular choice of unobserved coordinates.
Recover one observable from overlapping measurements
Three masses sit on a support. One instrument reports \(x_1+x_2=7\) kg and another reports \(x_2+x_3=9\) kg. Subtracting gives \(x_3-x_1=2\) kg. In matrix language the target \(c=(-1,0,1)^T\) equals the second measurement row minus the first, so \(w=(-1,1)^T\). Independently parameterise all solutions by \(x=(7-t,t,9-t)^T\). Every admissible value of \(t\) produces the same difference. In contrast the total mass is \(16-t\), so even requiring all masses to be nonnegative leaves totals ranging from 9 to 16 kg. A convenient equal-mass assumption would select a value by adding external information.
Now give the two readings independent measurement errors of standard deviation 0.20 and 0.30 kg. The same weighted difference has variance \(0.20^2+0.30^2=0.13\) kg² and standard deviation about 0.361 kg. It remains an unbiased estimate of the mass difference. A shared additive zero-offset error cancels in this difference, whereas it would affect an output using the sum. This is a second design question: identifiability determines whether suitable weights exist, while the error covariance determines whether applying those weights yields useful precision.
A third instrument measuring \(x_2\) alone would remove the remaining ambiguity. Measuring the first overlapping pair again would tighten one known sum but retain the null direction \((-1,1,-1)^T\). When choosing the next measurement, evaluate its dot product with that unresolved direction. A nonzero product measures some of the missing information; a very small product makes the newly identifiable quantity fragile under noise.
For example a reading of \(x_1+2x_2+x_3\) merely adds the two original readings. It has nonzero sensitivity to every individual mass yet zero dot product with the missing direction. The instrument can improve precision on a known combination while leaving exactly the same continuum of compatible total masses.
How much information does a second sensor actually add?
The first measurement is the mean of two cells. The second is the same mean plus \(a(x_1-x_2)/2\). Differencing cancels the common mean and allows the contrast to be recovered. Assume independent, identically noisy readings.

Read values from the plot
| Differential weight in second observation | Two independent readings | Four repeats of each reading |
|---|---|---|
| 0.01 | 282.84 | 141.42 |
| 0.26 | 10.879 | 5.4393 |
| 0.505 | 5.6008 | 2.8004 |
| 0.75 | 3.7712 | 1.8856 |
| 1 | 2.8284 | 1.4142 |
Change parameters · How much information does a second sensor actually add?
Change one input at a time and compare the recalculated curves with the argument above. The browser evaluates this small model locally; the accompanying numerical values state its assumptions and reference checks. Reset restores the reference inputs, and the data can be downloaded as CSV.
Study the full derivation
Eliminate linear nuisance parameters before fitting a decay · Inferring parameters and fields from observations
A measured relaxation has an unknown rate, amplitude and background. Derive a one-dimensional profile fit without fixing the nuisance parameters, explain why short observation windows can hide the rate and test an actual numerical dataset.
Chapter 2 · Weighted least squares and residual diagnostics
Derive the fitting criterion from measurement error and separate the uncertainty of an estimated mean from the scatter of a new observation.
From first principles
Derive the least-squares distance from the instrument noise
Suppose \(y=Ax+\epsilon\), with Gaussian measurement noise of zero mean and known positive definite covariance \(\Sigma\). Independent errors of unequal sizes should not count equally in raw units, and correlated errors should not be counted twice. Factor \(\Sigma=LL^T\) and multiply the model by \(L^{-1}\). The transformed noise has unit covariance,
For a candidate state, the negative log likelihood differs by a constant from half the squared norm of the transformed residual. This follows from the Gaussian density,
The likeliest state therefore minimizes ordinary squared residuals in these whitened coordinates. Solves with the triangular factor \(L\) preserve this interpretation without forming its inverse. If the covariance is estimated or state dependent, the stated probability model and resulting uncertainty estimates need to include that extra information.
Background · Whitened residual
For a known positive covariance this expresses mismatch in noise units and removes the modelled correlations between measurements.
Derivation and applications
Construct a model check that requires no fitted parameters
A residual can be compared with noise most cleanly when the particular combination of readings was forced to vanish by the model itself. Consider \(y=Ax+\epsilon\) with zero-mean noise of known positive definite covariance \(\Sigma\). Choose a nonzero contrast \(c\) satisfying \(A^Tc=0\). No value of the unknown \(x\) can change the predicted contrast because its mean is
Under a Gaussian noise model its standardized value is a unit normal random variable. Squaring it gives a one-degree-of-freedom discrepancy,
The corresponding fit interpretation follows by whitening \(b=L^{-1}y,\ B=L^{-1}A\). The vector \(u=L^Tc/\sqrt{c^T\Sigma c}\) has unit norm and is perpendicular to every column of \(B\). Thus every fitted residual has projection \(Z\) along the same direction,
When there is exactly one independent residual direction, equality holds for the least-squares fit. The contrast is a model check only to the extent that the covariance and zero-mean error assumption are justified. It identifies a combination of inconsistent readings, without uniquely locating a faulty sensor.
Worked example
Check an affine trend from three measurements
At times \(0,1,2\) a linear trend predicts zero second difference. Observations \(2,3,6\), each with independent standard deviation \(0.20\), give contrast \(2-2(3)+6=2\). Its standard deviation is \(0.20\sqrt6=0.490\), hence \(Z=4.08\) and \(Z^2=16.7\). Fitting the intercept and slope cannot remove that discrepancy.
Second application
Include a shared calibration mode in a conservation test
Three independent channels should satisfy a balance with contrast \(c=(1,1,-1)^T\). Suppose their independent errors each have deviation \(0.10\) and a common additive offset has independent deviation \(0.20\). Since \(c^T(1,1,1)^T=1\), the offset contributes \(0.20^2\) to contrast variance. For readings \(1.0,2.0,2.6\) the discrepancy is \(0.4/\sqrt{0.03+0.04}=1.51\) standard deviations. Dropping the shared offset would inflate it to \(2.31\).
Start from this chapter. Increase the noise scale while keeping temperatures and sampling times fixed. Predict how the covariance of the activation energy changes before refitting the same model.
OneSimulation laboratory · Find out what a temperature series identifies
A distance in data space depends on the instrument
Let \(y=Ax+\epsilon\) with zero-mean error of known positive-definite covariance \(\Sigma\). If the errors are jointly Gaussian, the negative log likelihood differs from \((y-Ax)^\mathsf{T}\Sigma^{-1}(y-Ax)/2\) only by constants independent of \(x\). This expression still defines a weighted least-squares criterion without normality. Correlated readings can vary together substantially while their difference is very precise; individually dividing them by standard deviations fails to capture that information.
Factor \(\Sigma=LL^\mathsf{T}\) and solve \(L b=y,\ L B=A\) by triangular substitution. Then \(b=Bx+\eta\) with \(\operatorname{Cov}\eta=I\); \(\|b-Bx\|^2\) is the original weighted distance. This is whitening. It also cures a units problem: residuals measured in different units are compared after division by their uncertainty scales. For truly independent readings of standard deviations \(s_i\), the transformation simply divides each row and response by \(s_i\).
Derive the projection and compute it without losing precision
Differentiating the squared norm gives
Thus \(B\hat x\) is the orthogonal projection of \(b\) onto the column space. For full column rank write a thin QR factorisation \(B=QR\) with \(Q^\mathsf{T}Q=I\). The minimiser solves \(R\hat x=Q^\mathsf{T}b\). Forming the normal matrix \(B^\mathsf{T}B\) instead squares its two-norm condition number. QR avoids this extra source of precision loss, though it cannot create information absent from the measurements.
Suppose two instruments measure one constant as 10 and 14 with independent standard deviations 1 and 2. The weighted mean is \((10+14/4)/(1+1/4)=10.8\), with standard deviation \((1+1/4)^{-1/2}=0.894\). The less precise instrument still contributes, but with one quarter of the weight. Giving it half the weight would confuse standard deviation with variance. If both instruments share an unknown calibration bias, the stated independence model overstates what averaging can achieve.
Background · Why can two whitening transformations give the same fitted curve?
A symmetric inverse square root and a triangular Cholesky solve generally give different coordinates for the whitened residual. Let both transformations \(W_1,W_2\) whiten the same positive definite covariance \(\Sigma\). Then the change of coordinates \(Q=W_2W_1^{-1}\) obeys
Whitened residual vectors are therefore related by an orthogonal transformation. Their squared lengths and hence their least-squares minimisers agree. Two individual whitened components can nevertheless have different magnitudes. If a diagnostic needs to identify which physical sensor was faulty, interpret its residual in the original measurement coordinates alongside the correlation model. A large component obtained after rotation cannot by itself identify a physical channel.
Work with residuals after fitting
The fitted whitened response is \(Hb\) with \(H=QQ^\mathsf{T}\), and residual \(r=(I-H)b\) has covariance \(I-H\). Consequently raw whitened residuals after fitting do not have equal independent unit variance. Observation \(i\) has leverage \(H_{ii}\); a high-leverage point can pull the fit toward itself and show a deceptively small residual. Under the stated model, \(\mathbb E\|r\|^2=m-p\) for \(m\) observations and \(p\) independent fitted coefficients. With Gaussian errors the sum has a chi-square distribution with those degrees of freedom. Plot signed residuals against input, time and sensor identity to look for omitted curvature, drift or serial correlation.
Uncertainty in a fitted trend and a future measurement
In the full-rank linear model \(\operatorname{Cov}\hat x=(B^\mathsf{T}B)^{-1}\). For the model mean \(c^\mathsf{T}\hat x\) the variance is \(c^\mathsf{T}\operatorname{Cov}(\hat x)c\); solve \(R^\mathsf{T}v=c\) to obtain it as \(\|v\|^2\). Predicting a future individual reading requires adding its independent measurement variance. This distinction matters when validating fitted response curves. A single point can legitimately lie far outside a narrow interval for the mean. When only relative weights are known, estimate a common variance scale from the residual degrees of freedom and state the additional assumption.
Separate common and independent errors before estimating a mean
Measurements made after one calibration often share a random offset. Write \(y_i=\mu+b+e_i\), where the common offset has mean zero and variance \(\tau^2\), and the individual errors are independent of one another and of \(b\), with variances \(s_i^2\). The covariance matrix is the diagonal matrix of individual variances plus the rank-one matrix \(\tau^2{\bf1}{\bf1}^T\). Consider any linear estimate \(w^Ty\) that reproduces an arbitrary constant, so that \(\sum_iw_i=1\). Its variance separates into \(\tau^2+\sum_iw_i^2s_i^2\). The first term survives every admissible choice of weights because the shared error is indistinguishable from the unknown mean within this set of readings.
Minimising the second term with a multiplier for the sum constraint gives
Normalisation yields weights proportional to the individual precisions, with variance \(\tau^2+1/\sum_i s_i^{-2}\). In particular, estimating the weights from the marginal variances \(s_i^2+\tau^2\) as if every reading were independent gives both an incorrect covariance and generally incorrect relative weights. This derivation uses only second moments. Gaussian assumptions enter if the standard deviation is subsequently turned into a normal-theory probability interval.
Decide whether to repeat a reading or recalibrate
A balance has a random calibration uncertainty of 0.30 g. The first reading is 12.40 g with individual standard deviation 0.10 g. The second, acquired during a shorter averaging window, is 11.90 g with individual standard deviation 0.20 g. The individual precisions are 100 and 25 per g², so the relative weights are 0.8 and 0.2. The estimate is 12.30 g. Its variance is \(0.09+1/125=0.098\) g², giving standard deviation 0.313 g. A long sequence of additional readings using this same calibration can only push that standard deviation toward 0.30 g.
The difference between these two readings removes both \(\mu\) and the shared offset. Its standard deviation is
The observed difference of 0.50 g is about 2.24 such standard deviations. That discrepancy is relevant to the model for individual readings and averaging windows. It supplies no direct evidence for or against a common calibration offset of a particular size, because that offset has cancelled algebraically.
What if the entire two-reading procedure is repeated after an independent calibration? Averaging the two independently calibrated group estimates gives variance \(0.098/2=0.049\) g² and standard deviation 0.221 g. Taking the same number of readings with one calibration instead gives variance \(0.09+1/250=0.094\) g². The choice of sampling protocol changes the uncertainty even when the balance, total reading count and individual variances are identical. If calibrations share an uncertain reference standard, independence between groups must itself be revised.
A separate reference mass weighed during each calibration provides another way to estimate a shared offset. Subtracting that reference reading removes the offset but also introduces the reference measurement error into every corrected value. The corrected readings are therefore correlated again, now through the shared reference. Their covariance should be recomputed from this modified measurement protocol.
Find a measurement floor that averaging cannot remove
Each reading has independent noise of variance one and the same additional zero-mean calibration offset. Repeating the measurement divides the independent variance by the number of readings. The calibration error is shared by every term in their average.

Read values from the plot
| Number of readings | Common calibration σ = 0 | Common calibration σ = 0.3 | Common calibration σ = 1 |
|---|---|---|---|
| 1 | 1 | 1.044 | 1.4142 |
| 26 | 0.19612 | 0.35842 | 1.019 |
| 51 | 0.14003 | 0.33107 | 1.0098 |
| 75 | 0.11547 | 0.32146 | 1.0066 |
| 100 | 0.1 | 0.31623 | 1.005 |
Change parameters · Find a measurement floor that averaging cannot remove
Change one input at a time and compare the recalculated curves with the argument above. The browser evaluates this small model locally; the accompanying numerical values state its assumptions and reference checks. Reset restores the reference inputs, and the data can be downloaded as CSV.
Study the full derivation
Choose a regularisation scale by predicting omitted data · Inferring parameters and fields from observations
Regularised least squares can fit each observation partly with itself. Derive leave-one-out residuals from a single factorisation, approximate them by a trace and identify when a generalised cross-validation score misses a highly influential sensor.
Problem sheet 1 · Which combinations do the data determine?
Use a null-space argument, a covariance model and a residual calculation to assess three proposed measurements.
1. Two instruments on three cells
Let \(y_1=x_1+x_2=5,\ y_2=x_2+x_3=7\). (a) Write all exact solutions. (b) Determine whether \(x_3-x_1\) and \(x_1+x_2+x_3\) are identifiable. (c) Name one additional reading that makes the full vector identifiable and prove it.
Test each quantity along the null direction
With \(x_2=t\) all solutions are \((5-t,t,7-t)\). Their directional change is \((-1,1,-1)\). The contrast \(x_3-x_1=2=y_2-y_1\) stays fixed, while the sum \(12-t\) varies. A reading of the total gives a unique \(t\), since its dot product with the null direction is \(-1\). Repeating either original reading cannot remove this null direction.
Try this calculation. Explore the continuum of parameter pairs with the same observed sum, and see how a chosen norm selects one pair.
2. A shared calibration error
Two sensors read the same constant plus independent random errors of variance 1 and a shared random offset of variance 4. All three errors have zero mean and are mutually independent before the shared offset is added to both readings. (a) Write their covariance matrix. (b) Find the variance of their mean and difference. (c) Extend the mean variance to \(N\) independent sensor-specific errors with the same shared offset.
Track the common component once
Each reading has variance 5 and their covariance is 4. Thus the mean variance is \((5+2\cdot4+5)/4=4.5\), while difference variance is
For \(N\) readings it is \(4+1/N\) for the mean. Treating all readings as independent would instead predict \(5/N\) and would hide the calibration floor. An external calibration can address that floor.
Explore the related calculation with adjustable inputs. Change the parameters in the corresponding calculation and compare its independently recomputed values with the equation derived in this solution.
3. A line with room to test its fit
At \(x=-1,0,1\) observe \(y=0,2,1\), with independent unit-variance errors. Fit \(y=b+kx\). (a) Find the coefficients and signed residuals (observed minus fitted). (b) Compute the residual sum of squares and its degrees of freedom. (c) Compare variance of the fitted mean and variance of a future observation at \(x=2\).
Use the orthogonal design columns
The columns have squared lengths 3 and 2 and zero inner product. The intercept is the mean, 1, and the slope is \(1/2\). The fitted responses are 0.5, 1 and 1.5, leaving residuals \((-0.5,1,-0.5)\) of squared norm 1.5 and one residual degree of freedom. The coefficient covariance is diagonal with entries \(1/3,1/2\). The fitted mean at \(x=2\) has variance \(1/3+4/2=7/3\); an independent future reading there has variance \(10/3\).
Try this calculation. Change one observation’s uncertainty and recompute the weighted projection. More than one fitted coefficient requires the additional basis columns specified in this exercise.
A detector that pools two unresolved rays
A detector averages the transmitted intensities of two equally illuminated rays before reporting one reading. Each traverses 1 cm of material, with attenuation \(0.2\) and \(0.8\) cm\(^{-1}\), respectively. Compute the apparent homogeneous attenuation. Compare it with the equal-weight arithmetic mean and explain whether one pooled reading identifies the two attenuations.
Worked solution
The normalized transmitted intensities are
Their mean is \(0.634030\), so the apparent homogeneous attenuation is
Averaging the two separately measured log readings would have given \(0.5\ {\rm cm}^{-1}\).
The pooled result lies \(0.044341\ {\rm cm}^{-1}\) below the arithmetic mean. Convexity of \(e^{-x}\) explains the sign: the more transparent ray contributes disproportionately to the transmitted intensity. An infinite family of attenuation pairs has this same summed transmission. Two equal attenuations of \(0.455659\ {\rm cm}^{-1}\) provide another example.
Explore the related calculation with adjustable inputs. Rotate an omitted physical effect relative to the measured directions; treat the nonlinear pooling calculation here as an explicit source of model discrepancy.
Revisit chapter 1 · Build a ray matrix from attenuation measurements.
Chapter 3 · Singular systems and the amplification of noise
Identify which patterns survive a forward measurement and which become dominated by uncertainty when inverted.
From first principles
Identify the measured pattern hidden in each singular direction
A forward measurement \(y=Ax+\epsilon\) is easiest to interpret in orthonormal directions where \(A\) acts by simple scaling. For a singular triplet with positive \(\sigma_j\), \(Av_j=\sigma_ju_j\) and \(A^Tu_j=\sigma_jv_j\). Project the complete data equation onto its output direction,
Recovering the coefficient in the state divides the measured projection by \(\sigma_j\). Thus the reconstruction error in that direction is
When the data are whitened with unit noise covariance, the projected noise has standard deviation one and the recovered coefficient has noise standard deviation \(1/\sigma_j\). A zero singular value hides the corresponding state component completely. The numerical rank of a matrix and the set of coefficients that can be inferred at useful precision can therefore differ even for an exactly known forward model.
Derivation and applications
Derive the singular spectrum of a local averaging instrument
An instrument that averages neighbouring locations transmits broad patterns and attenuates rapid changes. Consider a periodic one-dimensional array of \(N\) equally spaced cells. At every cell the detector returns a symmetric three-point average, with response coefficient \(0\le a\le1/2\). With wraparound indices the noiseless map is
Translation symmetry suggests using normalized Fourier patterns \(v_k(j)=e^{2\pi ikj/N}/\sqrt N\). Neighbouring samples of one mode differ only by a phase. Substitution yields its eigenvalue,
The averaging matrix is symmetric and the Fourier modes are orthonormal, so the singular value of each mode is \(|\lambda_k|\). A negative eigenvalue reverses the measured phase of a real sinusoidal pattern but has the same noise amplification as a positive one of equal magnitude. A zero destroys the mode. For independent equal-variance data errors of variance \(s^2\), an inverse on a nonzero mode gives
The periodic boundary assumption supplies the Fourier eigenvectors; a finite array with distinct edge rules generally has a different spectrum. Preservation of the constant mode, \(\lambda_0=1\), checks that the normalized averaging kernel conserves total signal.
Worked example
Identify an invisible checkerboard pattern
For \(N=8\) and \(a=1/4\), the alternating vector corresponds to \(k=4\) and has \(\lambda_4=0\). No improvement in readout precision can infer its coefficient from these data. The quarter-cycle mode \(k=2\) instead has \(\lambda_2=1/2\); noise of standard deviation \(0.020\) in its measured coefficient becomes \(0.040\) in the inferred amplitude.
Second application
Change the optical mixing and forecast a contrast limit
A second array has \(a=0.20\) and even \(N\), giving alternating-mode gain \(1-4(0.20)=0.20\). A true normalized contrast coefficient \(0.30\) appears as \(0.060\) in the data. At coefficient noise deviation \(0.030\) that is only a two-standard-deviation response. To infer the same state coefficient with deviation \(0.050\), the measurement deviation must fall to \(0.20(0.050)=0.010\).
Start from this chapter. Near a single temperature, changing the prefactor can mimic an activation-energy change. Narrow the experimental temperature range and check how the reported standard error changes.
OneSimulation laboratory · Find out what a temperature series identifies
Rotate the coordinates to expose the experiment
For a whitened matrix \(B=U\Sigma V^\mathsf{T}\), the unit vector \(v_j\) is mapped to \(\sigma_j u_j\). Parameter patterns \(v_j\) and measurement patterns \(u_j\) are orthonormal in their respective coordinates. A small singular value means a full unit change in a particular parameter combination makes only a small change in the data. This conclusion depends on scaling: metres or millimetres for one coordinate change the geometry. Scale each parameter by a physically meaningful range before interpreting a singular vector as a weak process.
For nonzero singular values the least-squares minimum-norm inverse takes the form
Left-singular directions orthogonal to the range contribute to the residual and cannot be fitted. Right-null directions contribute nothing to the data and are assigned zero by the minimum-norm convention. For a full-column-rank matrix the largest response of the inverse to a unit data perturbation has norm \(1/\sigma_{\min}\). A relative worst-case bound involves \(\kappa_2=\sigma_{\max}/\sigma_{\min}\); the actual perturbation direction can be far less damaging.
A blur that almost removes the contrast
Let a sensor mix two unknown levels with \(A=\left(\begin{smallmatrix}0.505&0.495\\0.495&0.505\end{smallmatrix}\right)\). It passes the average direction unchanged and attenuates the difference direction by 0.01. For \(x=(2,0)\) it predicts \(y=(1.01,0.99)\). Add the modest perturbation \((0.01,-0.01)\). Inverting the perturbed data exactly gives \((3,-1)\): a 0.01 perturbation per sensor produced a unit change in each reconstructed level. In contrast, perturbation \((0.01,0.01)\) just raises both fitted levels by 0.01. Both inversions have zero residual. Compare the recovered patterns with independently known precision to decide which interpretation is supportable.
Why finer discretisation can make an inverse problem harder
An integrating or blurring instrument smooths rapidly oscillating parameter fields. Discretising more finely introduces additional oscillatory patterns, each with very small image under the forward map. For a convolution on a periodic grid the Fourier modes themselves diagonalise the operation: the response to each frequency is the Fourier transform of the kernel there. In a Gaussian blur this multiplier falls rapidly with frequency. Formally dividing by it at every resolved frequency amplifies high-frequency noise. Finer output sampling cannot automatically recover what the original acquisition smoothed away.
Plot \(\sigma_j,\ |u_j^\mathsf{T}b|\), and their ratio against index. For recoverable modes the projected signal can be distinguished from the noise floor. When the singular values keep decreasing but the data coefficients fluctuate at roughly constant noise magnitude, division begins to generate structure from noise. The transition can be gradual and projections are random, especially in a short record. Use noise estimates or replicated observations before choosing a cutoff.
Distinguish numerical rank from usable resolution
A singular value large enough to represent in floating point may still give a parameter uncertainty too large for the scientific question. Conversely several poorly measured parameters may admit a well-measured sum. In whitened coordinates the uncertainty of a linear functional follows from how it projects onto \(v_j\). A functional orthogonal to small-singular-value directions can remain stable without the full reconstruction being stable. The next chapter makes the decision to suppress these directions explicit and quantifies the bias it creates.
Ask whether a continuum solution has finite energy
A finite matrix has only finitely many singular values, so a formally inverted vector can always be printed after zero modes have been removed. For a compact smoothing operator on a space of square-integrable functions, there can be infinitely many positive singular values tending to zero. Write the data coefficients as \(b_j\) in the left singular basis, with no data component orthogonal to the closure of the range. Solving mode by mode forces the state coefficients to be \(x_j=b_j/\sigma_j\). Orthogonality gives
A square-integrable solution exists exactly when that last series converges; an arbitrary additional nullspace component can then be added if the operator is not injective.
This range condition explains why diminishing data amplitudes are insufficient evidence of a reconstructible state. They must diminish sufficiently fast relative to the strength with which the instrument transmits each mode. The converse is constructive: if the squared quotient series converges then the partial reconstructed states converge in norm, and continuity of the forward operator takes their limit to the original compatible data. A finite truncation conceals failure of this condition because every partial sum is finite.
Follow two spectra as the reconstruction grid grows
Take singular values \(\sigma_j=1/j\), and compare data sets with coefficients \(j^{-2}\) and \(j^{-3/2}\), respectively. Both data sets have finite squared norm. In the first, the reconstructed coefficients are \(1/j\) and the squared state norm is \(\sum j^{-2}\), which converges. Beyond a cutoff \(N\), its tail is bounded by \(\int_N^\infty x^{-2}dx=1/N\). Keeping 100 modes therefore leaves state error at most 0.10 in this particular normalisation. A corresponding forward residual can be much smaller because applying the operator divides each tail term by an additional \(j\).
In the second data set, the state coefficients are \(1/\sqrt j\). Their squared norm through mode \(N\) is the harmonic sum. From 100 to 200 retained modes it increases by about \(\log 2\), and the same approximate increase recurs on every doubling. Meanwhile the squared data discrepancy after truncation is \(\sum_{j>N}j^{-3}\), bounded by \(1/(2N^2)\). At 100 modes the data residual is at most 0.0071. The residual can become arbitrarily small although no finite-energy exact state exists for this idealised data set.
In a measured spectrum, only finitely many coefficients are observed and their far tail includes instrument noise. Exact membership in an infinite-dimensional range cannot be proven by drawing a straight line through a short log plot. The continuum calculation instead suggests two independent checks during refinement: inspect whether reconstruction norms stabilise, and compare data coefficients to an independently estimated noise floor before dividing them by small singular values.
For the first sequence even an excellent forward residual is a relatively optimistic diagnostic: the squared forward tail behaves like \(N^{-3}\), while the squared state tail behaves only like \(N^{-1}\). Comparing norms without specifying whether the operator has already smoothed the discrepancy makes the two convergence rates appear contradictory.
Change parameters · Singular systems and the amplification of noise
Change one input at a time and compare the recalculated curves with the argument above. The browser evaluates this small model locally; the accompanying numerical values state its assumptions and reference checks. Reset restores the reference inputs, and the data can be downloaded as CSV.
Study the full derivation
Recovering sparse coefficients without hiding amplitude bias · Inferring parameters and fields from observations
A sensor records a linear mixture of a few active components. Derive the soft-threshold map, use it in an iterative reconstruction and decide when correlated response columns make an apparently sharp sparse answer ambiguous.
Chapter 4 · Regularisation, resolution and the price of stability
Choose which features to recover, derive the associated filter and quantify the bias introduced by that choice.
From first principles
Derive how a quadratic penalty filters small singular values
Suppose whitened data \(b\) are modeled by \(Ax\), and large reconstructed coefficients are implausible. Penalize their squared norm with strength \(\lambda^2>0\). The minimizer balances the measured residual and penalty,
In singular-vector coordinates let \(z_j=v_j^Tx\) and \(\beta_j=u_j^Tb\), where \(Av_j=\sigma_j u_j\). Orthogonality makes the objective a sum of scalar terms \((\sigma_jz_j-\beta_j)^2+\lambda^2z_j^2\), plus a constant from unmodeled data directions. Setting the derivative of each term to zero gives
At \(\sigma_j\gg\lambda\) this is close to the ordinary inverse. At a tiny singular value it avoids dividing the noise by that tiny number, at the price of attenuating the true coefficient. A null component is set to zero by this penalty. A different physical reference state or a derivative penalty imposes different information and changes what the reconstruction preserves.
Background · Tikhonov estimate
The regularisation operator selects which departures are costly. Compare values of alpha only after fixing how both terms are scaled.
Derivation and applications
Predict a withheld observation without repeating every regularized fit
Suppose a linear model has independent equal-variance readings \(y_i\), design rows \(a_i^T\), and a fixed positive quadratic penalty \(\lambda^2\|x\|^2\). One way to compare penalty strengths is prediction on withheld readings. Define \(H=A^TA+\lambda^2I\), fit all rows to obtain \(\widehat x\), and let \(\widehat x_{-i}\) be the fit with row \(i\) removed while retaining the same penalty. Adding and subtracting the omitted row in the smaller normal equations yields
Subtract the second identity from the first. Multiplying by \(a_i^TH^{-1}\) shows that the shift in the fitted prediction is proportional to the withheld residual. The constant of proportionality \(h_i\) is its regularized leverage,
Writing \(r_i=y_i-a_i^T\widehat x\) and rearranging gives the leave-one-out residual and corresponding validation score,
A point with large leverage helps set its own fitted value, so its ordinary residual can be misleadingly small. The formula assumes rowwise omission makes sense for the data. If nearby observations share noise or the intended prediction is a whole new experiment, withholding complete independent groups answers a different question.
Worked example
Check the shortcut against two explicit refits
Fit a constant to \(y=(1,3)^T\) with \(\lambda^2=1\). The all-data estimate is \(4/3\), and both leverages are \(1/3\). Dividing the ordinary residuals by \(2/3\) gives withheld errors \(-0.5,2.5\), hence \({\rm CV}=3.25\). Fitting only 3 yields \(3/2\); fitting only 1 yields \(1/2\), confirming both predictions.
Second application
Detect a high-leverage reading
For another scalar fit take sensitivities \(1,3\), data \(2,4\) and \(\lambda^2=1\). The estimate is \(14/11\), and the second reading has ordinary residual \(2/11\) and leverage \(9/11\). Its withheld error is
Directly using only the first reading gives \(x=1\), which predicts 3 at the second station rather than the observed 4.
Two ways to control the unstable inverse
A truncated SVD keeps only the first \(k\) singular vectors ordered by decreasing singular value. All retained coefficients are inverted exactly; the others are set to zero. Its noiseless reconstruction is a projection onto the retained right-singular subspace. The choice is transparent but a hard cutoff can place two comparably informative directions on opposite sides of the threshold. In some spatial reconstructions sharp spectral cutoffs also introduce oscillations.
A smoother choice is zero-order Tikhonov regularisation. In scaled parameters and whitened measurements minimise \(\|Bx-b\|^2+\lambda^2\|x\|^2\) for \(\lambda>0\). Differentiation gives
Solve with an augmented QR or with the SVD. Each coefficient now carries a filter:
If \(b=Bx\) exactly, the estimate of \(v_j^\mathsf{T}x\) is the true coefficient times \(f_j\). Where \(\sigma_j=\lambda\) the noiseless amplitude is halved. For a very small singular value, the noise gain now approaches zero; the price is that a real fine-scale feature in the same direction is also suppressed.

Calculate the bias and variance for one component
Suppose a scalar instrument reads \(b=0.1x+\epsilon\), true \(x=2\), with noise standard deviation 0.1. Direct inversion gives an unbiased estimate with standard deviation 1. At \(\lambda=0.1\) the filter is \(1/2\); the estimated mean is 1 and the standard deviation is 0.5. Mean squared error is bias squared plus variance: 1.25 here, compared with 1 for direct inversion. For true \(x=0\) the same regularisation would reduce mean squared error from 1 to 0.25. Stabilising an estimate does not guarantee a smaller error for every possible signal. The importance assigned to plausible signals is part of the modelling decision.
Turn a source condition into a noise-dependent accuracy bound
The bias–variance calculation describes a particular signal and a noise distribution. Suppose instead we know only a deterministic data-error bound \(\|b^\delta-Bx^\dagger\|_2\le\delta\). To derive a uniform reconstruction guarantee we must also specify which signals qualify. One useful assumption is the source condition \(x^\dagger=B^Tw,\ \|w\|_2\le R\), in scaled coordinates. In singular coordinates a coefficient of \(x^\dagger\) is then \(\sigma_j\) times a coefficient of \(w\). Thus arbitrarily large features cannot hide in arbitrarily weak directions for the given \(R\). This assumption also excludes a component in the null space.
Write \(\alpha=\lambda^2\) for the penalty coefficient. Split the reconstruction error into the data perturbation passed through the regularised inverse and the loss produced by regularising exact data. In a mode of singular value \(\sigma\), the noise multiplier is \(\sigma/(\sigma^2+\alpha)\). The noiseless bias is \(-\alpha/(\sigma^2+\alpha)\) times the true coefficient, or \(-\alpha\sigma/(\sigma^2+\alpha)\) times the source coefficient. Because \((\sigma-\sqrt\alpha)^2\ge0\), the first multiplier is bounded by \(1/(2\sqrt\alpha)\). The same inequality bounds the magnitude of the second by \(\sqrt\alpha/2\). Orthogonality and the triangle inequality now give
If \(R,\delta>0\), the two terms balance at \(\alpha=\delta/R\), giving the bound \(\sqrt{R\delta}\). This is an a priori parameter choice based on stated uncertainty. For a family of increasingly resolved operators, keeping \(R\) controlled matters. If the model class admits large coefficients in directions of vanishing sensitivity, the same claim has no uniform basis.
When bias and data error reinforce one another
Take \(B=\operatorname{diag}(1,0.1)\) and \(w=(0,1)^T\), so \(R=1\), the true signal is \((0,0.1)^T\), and exact data are \((0,0.01)^T\). Suppose the second measurement is perturbed downwards by \(0.01\). Then
With exact data, reconstruction would retain half the weak coefficient, producing \(0.05\) and bias \(-0.05\). The data perturbation is multiplied by \(0.1/(0.01+0.01)=5\), adding another \(-0.05\). The reported signal is zero, and the error \(0.1\) attains the theoretical bound. Here the vulnerable direction has precisely \(\sigma=\sqrt\alpha\). On another spectrum the achievable error may be much smaller.
Practise on sheet 2 · A source ball and a different weak direction. Further reading · University of Cambridge · Inverse Problems, Mathematical Tripos Part III · §3.2.3 Tikhonov regularisation and §3.2.4 Source-conditions, pp. 37–39.
Choose what the penalty expresses
For an expected background \(x_0\) and a derivative operator \(D\), a suitable criterion may use \(\|D(x-x_0)\|^2\). A first-difference penalty discourages adjacent jumps while leaving constants unpenalised; a second-difference penalty instead leaves affine trends unpenalised on a simple uniform open grid. The minimiser is unique if \(\ker B\cap\ker D=\{0\}\) for \(\lambda>0\). Check this condition before interpreting a smooth result. Penalising a field whose true behaviour has a sharp interface spreads the interface; inspect the response to a synthetic sharp feature before claiming a physical transition width.
Choose a strength from measurements, then report resolution
If a bound \(\delta\) for the whitened data error is known, the discrepancy principle seeks a fit whose residual norm is comparable to \(\delta\). Smaller \(\lambda\) usually fits data more closely; larger values raise residual and reduce the penalised norm. A noise level estimated in the original physical units must be transformed consistently. If model error alone exceeds the assumed discrepancy, no amount of careful parameter tuning makes the noise model correct. Other choices include validation on genuinely independent observations and examining the residual-versus-penalty curve across several decades.
Report the chosen operator, units, strength and selection criterion. Alongside a reconstruction, show how its resolution changes under a modest change of regularisation. A feature that vanishes under a noise-consistent alternative requires more evidence. A predicted quantity can remain stable despite substantial uncertainty in the underlying image; testing that quantity directly can be the scientifically relevant validation.
Per Christian Hansen develops the singular-value picture and parameter choice further in Discrete Inverse Problems.
When a specified discrepancy determines a unique strength
Consider the zero-background quadratic penalty and express the data in left singular coordinates \(b_j\). Substituting the filtered solution back into the forward model gives residual coefficient \(\lambda^2 b_j/(\sigma_j^2+\lambda^2)\), with the sign chosen as data minus prediction. The data component \(b_\perp\) orthogonal to the range of the matrix survives unchanged for every strength. Orthogonality therefore expresses the squared discrepancy as \(\|b_\perp\|^2+\sum_j |b_j|^2[\lambda^2/(\sigma_j^2+\lambda^2)]^2\), with the sum taken over positive singular values. This equation allows a statement more definite than the heuristic that smoothing worsens the fit.
For each positive singular value the quantity in brackets increases strictly from zero to one as \(\lambda\) grows from zero to infinity. Thus the residual norm increases continuously from the irreducible distance \(\|b_\perp\|\) to the full data norm. There is a unique positive finite strength for every target strictly between these endpoints provided at least one measured singular component is nonzero. A target below the first endpoint is infeasible. A target near the upper endpoint can permit a nearly zero reconstruction. The exact same reasoning for general penalties needs care when some physical modes receive no penalty.
Allocate a discrepancy after accounting for an unmodelled reading
A scaled instrument produces \(b=(3,1)^T\) for a single unknown \(x\), with predictions \(Bx=(2x,0)^T\). The second channel, which should be zero according to the stated model, already consumes one unit of residual norm. Set a total target of \(\sqrt{1.36}\) and use the zero-background criterion. Squaring the norm leaves \(1.36-1=0.36\) for the squared discrepancy in channel one. The required nonnegative first-coordinate discrepancy is therefore 0.6. Its prediction is \(3-0.6=2.4\), so the reconstructed coefficient must be 1.2.
Check by solving the actual penalised problem. The normal equation is
Substituting \(x=1.2\) gives \(4+\lambda^2=5\), hence \(\lambda=1\). The noiseless resolution factor for that coefficient is
This calculation identifies the amplitude tradeoff associated with the selected discrepancy. It also shows why setting the target to 0.9 could never work: the second channel alone contributes one unit for every value of \(x\).
Suppose a second independent reading of the missing channel also repeatedly lies near one, despite a nominal uncertainty of only 0.05 units. The persistent signed defect would be evidence to inspect the forward model or reference subtraction. Treating that behaviour as an excuse to enlarge the noise budget can produce an attainable discrepancy while systematically oversmoothing the channel that does measure \(x\). Inspect residuals by physical observation as well as their aggregate norm before attributing a discrepancy-selected strength to the uncertainty of the instrument.
In this example the formula for arbitrary strength is \(x=6/(4+\lambda^2)\). Differentiating it shows that near \(\lambda=1\) a strength increase of 0.1 initially lowers the coefficient by about 0.048. This local sensitivity is another interpretable number to publish if the noise target is itself estimated from a short calibration series.
Change parameters · Regularisation, resolution and the price of stability
Change one input at a time and compare the recalculated curves with the argument above. The browser evaluates this small model locally; the accompanying numerical values state its assumptions and reference checks. Reset restores the reference inputs, and the data can be downloaded as CSV.
Study the full derivation
Choose a regularisation scale by predicting omitted data · Inferring parameters and fields from observations
Regularised least squares can fit each observation partly with itself. Derive leave-one-out residuals from a single factorisation, approximate them by a trace and identify when a generalised cross-validation score misses a highly influential sensor.
Problem sheet 2 · Spectral filtering and recoverable detail
Calculate what a reconstruction can borrow from the data and what it assumes when it suppresses a noisy direction.
1. A small residual after a large error
In singular coordinates let \(B=\operatorname{diag}(1,0.02)\), true \(x=(1,1)\), and data perturbation \((0,0.01)\). (a) Solve the perturbed inverse exactly. (b) Reconstruct with the second mode truncated and compare residuals and errors. (c) Give an example of a stable target functional.
Compare in parameter and measurement space
The observed data are \((1,0.03)\). Exact inversion gives \((1,1.5)\) with zero residual and parameter error 0.5. Truncation gives \((1,0)\) with residual norm 0.03 and parameter error 1. In this particular realisation truncation loses a real feature and has greater error. The target \(x_1\) is stable under either estimator; its gain from data noise in this example is one.
Explore the related calculation with adjustable inputs. Change the parameters in the corresponding calculation and compare its independently recomputed values with the equation derived in this solution.
2. Choose a discrepancy level
A scalar system has \(B=0.20,\ b=0.30\). (a) Express the magnitude of the residual under zero-order Tikhonov as a function of \(\lambda\). (b) Choose \(\lambda\) to give residual 0.06 and compute the estimate. (c) Quantify the resulting noiseless resolution factor.
Solve for the strength in measurement units
The fitted response is \(b\,0.04/(0.04+\lambda^2)\), leaving magnitude \(0.30\lambda^2/(0.04+\lambda^2)\). For residual 0.06 solve \(\lambda^2=0.01\), so \(\lambda=0.10\) and \(x_\lambda=0.20(0.30)/0.05=1.20\). The retained noiseless amplitude is
Interpreting 0.06 as a sensible discrepancy requires an external noise or model-error estimate.
Explore the related calculation with adjustable inputs. Change the parameters in the corresponding calculation and compare its independently recomputed values with the equation derived in this solution.
3. Penalising jumps without penalising the mean
For three cell values use \(D x=(x_2-x_1,x_3-x_2)\). (a) Find its null space. (b) Show whether measuring \(x_3-x_1\) alone yields a unique regularised solution. (c) Repeat with the mean as the sole measurement, and state what the resulting solution assumes.
Intersect the null spaces
The penalty vanishes on all constant vectors. A measurement of \(x_3-x_1\) also vanishes on constants, so adding a constant to every candidate preserves both terms in the objective. A mean measurement sees constants, and the common null space becomes trivial. With observed mean \(b\) the unique solution for positive \(\lambda\) is \((b,b,b)\) since both residual and differences then vanish. The flat profile reflects the smoothness assumption; the measurement established only its mean.
Explore the related calculation with adjustable inputs. Inspect soft-thresholding and quadratic shrinkage. For two-cell total variation, apply the threshold to the half-difference and retain the mean as derived here.
A source ball and a different weak direction
Let \(B=\operatorname{diag}(1,0.2)\), \(w=(0,1)^T\), and measured data \(b^\delta=(0,0.0375)^T\), with certified error \(\delta=0.0025\). Compute the balanced \(\alpha\), the bound and the observed error. What happens to the guaranteed accuracy if the noise certificate is quartered while \(R\) stays fixed?
Worked solution
The signal \(B^Tw=(0,0.2)^T\) produces exact weak data \(0.04\). Their measured perturbation is \(-0.0025\). With \(R=1\), the balanced \(\alpha=0.0025\) guarantees an error at most \(\sqrt{0.0025}=0.05\). The measured weak reconstruction is \(0.2(0.0375)/(0.04+0.0025)=0.1764706\), an error of \(0.0235294\).
The weak singular value \(0.2\) differs from \(\sqrt\alpha=0.05\). Thus the sharp per-mode multiplier in the proof need not be reached. For a new measurement satisfying a quarter-sized certificate, choosing \(\alpha=0.000625\) gives guaranteed error \(0.025\), only half the former bound.
Explore the related calculation with adjustable inputs. Change the parameters in the corresponding calculation and compare its independently recomputed values with the equation derived in this solution.
Revisit chapter 4 · Turn a source condition into a noise-dependent accuracy bound.
Chapter 5 · Nonlinear fitting and local models
Derive a Gauss–Newton step, recognise misleading local curvature and use step acceptance to protect a nonlinear fit.
From first principles
Build a local inverse from sensitivities
Let a differentiable forward model \(f(p)\) predict several measurements from parameters \(p\). Whiten its prediction errors by the measured noise covariance, and denote the resulting residual by \(r(p)\). To infer a parameter change \(s\) from the current mismatch, expand about the current state,
Here column \(j\) of \(J\) records the response to changing parameter \(j\), with the other parameters fixed at the current values. Minimizing the squared norm of the linearized prediction supplies the Gauss–Newton step,
Independent columns make the local step unique. Nearly parallel columns indicate parameter combinations that can compensate for each other in the data. Because \(J\) describes only the present neighbourhood, compare the actual residual at the proposed new state with the linear prediction. A new trial point must also respect any physical parameter bounds assumed by the forward model.
Derivation and applications
Compare finite updates in a parameter and its logarithm
A positive coefficient such as a diffusivity or decay rate can be fitted directly or via a logarithm that enforces positivity automatically. Consider \(p>0\) and use a reference \(p_0\) of the same units so that \(q=\ln(p/p_0)\) is dimensionless. Let \(r(p)\) be a whitened residual vector and \(J_p\) its derivative column at the current parameter. The chain rule and a linearized solve give
Thus direct and logarithmic coordinates describe the same first-order change when the column is nonzero. Their undamped finite proposals differ. The direct step adds the change; the logarithmic step exponentiates it. Expanding the exponential gives the difference explicitly,
The local variance from the same linear model transforms consistently, assuming unit whitened noise and no added prior:
The positivity of a proposal does not ensure it reduces the nonlinear residual. A line search or other acceptance test can still be needed. Likewise, a prior density specified in one coordinate must be transformed with its Jacobian when a Bayesian analysis changes coordinates.
Worked example
Compare two proposals against an exact one-channel fit
A direct sensor predicts \(y=p\), with reading 1 and initial \(p=4\). The direct correction is \(-3\), reaching the exact fit immediately. The log-coordinate correction is \(-3/4\), giving \(4e^{-0.75}=1.889\). Both reduce the original error of 3, but the two linearizations have different finite remainders. The logarithmic model is nonlinear even for this linear physical sensor.
Second application
Translate a local interval into physical units
A second inversion gives \(p=2.00\,\mathrm{mm^2/s}\) and local standard deviation \(s_q=0.10\) in log coordinates. First-order propagation gives \(s_p=0.20\,\mathrm{mm^2/s}\). Mapping the symmetric log interval \(q\pm0.20\) exactly gives \(p\in[2e^{-0.2},2e^{0.2}]=[1.637,2.443]\,\mathrm{mm^2/s}\). The asymmetric physical interval retains the bounds specified in logarithmic units.
Start from this chapter. Fit simulated concentration histories and compare the fitted activation energy with the value that generated the data. Repeating with different seeds separates noise scatter from a systematic discrepancy.
OneSimulation laboratory · Find out what a temperature series identifies
Expand the residual around a trial parameter
Let \(r_i(p)\) be predicted minus observed data after whitening. Near \(p_k\),
where \(J_{ij}=\partial r_i/\partial p_j\). Minimise the squared norm of this linear expression to obtain the Gauss–Newton step. The exact Hessian of \(\tfrac12\|r\|^2\) is \(J^\mathsf{T}J+\sum_i r_i\nabla^2 r_i\). Gauss–Newton omits the second term. It is especially accurate near a good fit with small residuals. With substantial residuals or severe model curvature it can predict the wrong improvement even if the Jacobian is computed perfectly.
Compute the step from a QR or SVD solve \(Jd\simeq-r\). Verify a derivative independently using a directional difference \([r(p+hv)-r(p-hv)]/(2h)\) and compare with \(Jv\) across a few \(h\). Errors that shrink and then grow as \(h\) decreases are consistent with truncation followed by roundoff. A disagreement stable across several step sizes often signals inconsistent units, residual signs or parameter ordering.
Work one update by hand
For \(g(t;p)=e^{-pt}\), observe \(y(1)=0.50,\ y(2)=0.25\) with equal standard deviations. Start at \(p=0\). The residuals are 0.50 and 0.75 and the Jacobian column is \((-1,-2)^\mathsf{T}\). The least-squares step is
At \(p=0.4\) the two predictions are about 0.670 and 0.449. The residual shrinks, but a single linear step falls short of the exact parameter \(\ln2\). Recompute the derivative at the new point before the next update. Fitting the logarithms instead would change the implied measurement-noise model unless the weights are transformed appropriately.
Limit poor steps and enforce physical scales
A damped step minimises \(\|r+Jd\|^2+\mu\|Dd\|^2\). The diagonal scale \(D\) makes a step of one natural parameter unit comparable across components. Large \(\mu\) restricts the step strongly; small \(\mu\) approaches the ordinary Gauss–Newton solve. Evaluate the true objective at the trial point and compare its actual decrease with the decrease predicted by the linear residual model. A step with negative actual decrease should be rejected or shortened. Repeatedly tiny steps with a large gradient are evidence of a stalled solve, not convergence.
For a strictly positive rate, one can write \(k=e^\theta\); then \(\partial g/\partial\theta=k\,\partial g/\partial k\). This transformation enforces positivity and represents relative changes naturally. It also changes what a penalty on parameter distance means. Distinguish damping of an individual iteration from regularisation in the final objective: damping may decrease toward zero as a local method converges even when no penalty on the final parameters is intended.
The limits of a local uncertainty ellipse
At a well-determined full-rank fit with correctly scaled independent errors, \((J^\mathsf{T}J)^{-1}\) approximates parameter covariance in a local linear model. For \(g(p)=p^2\) and observed positive \(y\), either root has nonzero slope and a narrow local interval can arise around each. That interval misses the other root entirely. Bounds, multiple starts, profile fits and independent predictions give different checks on global uniqueness and nonlinearity. Distinct parameter values with similar residuals are a result to report; selecting the one reached by the first start can hide a scientifically important ambiguity.
Eliminate linear coefficients from a nonlinear fit
A decay amplitude may be unknown alongside its time constant. For fixed positive rate \(k\) the vector of predictions is \(a v(k)\), with \(v_i(k)=e^{-kt_i}\) and an unknown scalar amplitude \(a\). Assume the data have already been whitened, applying the same transformation also to \(v\). Minimising the squared residual at fixed \(k\) is an ordinary one-dimensional projection. Differentiating with respect to \(a\) gives \(v^T(av-y)=0\), so \(a(k)=v^Ty/(v^Tv)\) whenever the column is nonzero. Substitution leaves a scalar objective \(F(k)=\|a(k)v(k)-y\|^2/2\).
To compute its derivative, differentiate the complete residual \(r=a v-y\). The chain rule gives
But the optimal amplitude has already made \(r^Tv=0\), so the first term vanishes exactly. Thus the profile derivative is \(a r^Tv'\), even though \(a(k)\) changes as the rate changes. This cancellation requires an accurately solved inner projection. If an approximate amplitude leaves a visible residual along the column, ignoring its derivative can yield the wrong outer step. Several linear columns can be handled by the same projection argument while their rank remains fixed.
Diagnose the effect on three observations
Take times 0, 1 and 2 seconds, observed amplitudes \(y=(4,2,1.5)^T\), and trial rate \(k=\log2\) per second. Then \(v=(1,1/2,1/4)^T\), \(v^Tv=21/16\), and \(v^Ty=43/8\). Hence \(a=86/21\). Subtract the observations from the predictions to obtain
Its product with the design column is proportional to \(2+1/2-10/4=0\), checking that no amplitude adjustment alone improves the fit. The value of the objective is
Now \(v'=(0,-1/2,-1/2)^T\) in seconds, so
Multiplying by the fitted amplitude gives \(F'=43/49\) per unit rate in the chosen amplitude scaling. The positive derivative says that slightly reducing \(k\) lowers the local discrepancy. This sign has a physical explanation: the late observation lies above the fitted curve and a smaller decay rate raises the relative late amplitude. The amplitude will readjust simultaneously to keep the projection optimal.
What if all three acquisition times are the same? Every \(v(k)\) is a nonzero multiple of the same constant column. Changing \(k\) rescales that column and the best amplitude compensates perfectly. The profiled objective is then flat although the inner projection is perfectly well defined. Eliminating a linear nuisance coefficient improves the structure of a search but cannot cure missing information about decay rates when the timing protocol transmits only one measurement direction.
One can diagnose that limiting design before taking data by projecting the derivative column \(v'\) perpendicular to \(v\). Only this perpendicular component can change the fitted curve after amplitude compensation. At identical times it is identically zero because \(v'=-tv\). With distinct times it usually survives. Under approximately constant additive noise, inspecting its magnitude across candidate sampling schedules gives a quantitative way to choose the times that distinguish a changed shape from a changed amplitude.
The projected derivative has units of amplitude times time, so compare candidate schedules using the same time and amplitude scales.
Change parameters · Nonlinear fitting and local models
Change one input at a time and compare the recalculated curves with the argument above. The browser evaluates this small model locally; the accompanying numerical values state its assumptions and reference checks. Reset restores the reference inputs, and the data can be downloaded as CSV.
Study the full derivation
Eliminate linear nuisance parameters before fitting a decay · Inferring parameters and fields from observations
A measured relaxation has an unknown rate, amplitude and background. Derive a one-dimensional profile fit without fixing the nuisance parameters, explain why short observation windows can hide the rate and test an actual numerical dataset.
Chapter 6 · Design an informative experiment and test its predictions
Choose observations that separate parameters, then check uncertainty against the behaviour of new data.
From first principles
Derive the information supplied by an observation
Near a reference parameter, suppose a reading of known standard deviation \(s_i\) changes by \(a_i^T\delta p\). Under independent, zero-mean Gaussian errors, the local squared mismatch for a parameter perturbation is the sum of the squared responses in noise units. Collecting terms gives the information matrix,
If some nonzero direction is perpendicular to every sensitivity row, the experiment has no local information in that direction. A new independent reading with sensitivity \(a\) and noise deviation \(s\) adds a positive semidefinite term,
The new reading is most informative for combinations to which it responds strongly relative to its noise. In the full-rank linear Gaussian model \(H^{-1}\) is the parameter covariance. For a nonlinear experiment the rows depend on the reference parameters, so a prospective design should be checked across the range in which the experiment may operate.
Derivation and applications
Value a new observation for a specified prediction
Suppose a calibrated inverse experiment already supplies a full-rank linear estimate with parameter covariance \(C\). An independent additional reading would measure \(a^Tx\) with noise variance \(s^2>0\). The information matrices add, giving \(C_{\rm new}^{-1}=C^{-1}+aa^T/s^2\). The decision concerns a prediction \(z=c^Tx\), so compare its variance before and after the proposed observation. Multiplying out the following candidate inverse verifies the rank-one update,
The denominator is the total predicted variance of the new reading. Its numerator connects the uncertain target and the proposed noise-free measurement through the existing covariance. Applying \(c^T\) and \(c\) to either side gives
A candidate with excellent precision can have zero value for this target if the covariance-weighted cross term vanishes. Normalize by the initial prediction variance to express fractional gain as a squared correlation with the actual noisy reading,
The fraction is between zero and one by the covariance inequality. These formulas presume independently acquired data and an unchanged linear model. Reusing a correlated reading as if independent overstates the gain and can distort a sensor-placement decision.
Worked example
Choose between an indirect and a direct reading
Let \(C=\left(\begin{smallmatrix}4&1\\1&1\end{smallmatrix}\right)\) and target \(z=x_2\). Measuring \(x_1\) with \(s=0.5\) removes \(1^2/(4+0.25)=0.235\) from target variance 1. Measuring \(x_2\) with the less precise \(s=1\) removes \(1/(1+1)=0.500\). The second location gives the more precise final target despite its larger detector noise.
Second application
Identify a target-blind but accurate sensor
A separate model has \(C=\operatorname{diag}(9,1)\), and the target is \(x_1+x_2\) with variance 10. A candidate measures \(x_1-9x_2\) with \(s=0.1\). The cross term is \(9-9=0\), so target variance stays 10. A noisy direct measurement of the target with \(s=3\) instead reduces variance by \(100/(10+9)=5.26\), leaving \(4.74\).
Start from this chapter. Keep five experiments and the same sensor noise. Change their temperature spacing to alter the sensitivity directions, then compare the resulting uncertainty in activation energy.
OneSimulation laboratory · Find out what a temperature series identifies
Express design as a change in sensitivity
For independent whitened observations a candidate measurement with row derivative \(j\) adds \(j^\mathsf{T}j\) to the local information matrix. A repeat of the same measurement increases information along its existing direction, while a row with a new orientation can raise rank. After defining physically meaningful parameter scales, one can maximise the smallest eigenvalue to protect the weakest direction, or maximise the determinant to shrink a local uncertainty volume. If the scientific target is a single prediction \(h(p)\), minimising \(\nabla h^\mathsf{T}(J^\mathsf{T}J)^{-1}\nabla h\) at full rank may select a different design. Choose a criterion for the quantity actually needed.
Derive temperature and time sensitivities
Consider \(c=c_0e^{-kt}\) with \(k=k_r\exp[-(E/R)(1/T-1/T_r)]\). Estimate \(\theta=\ln k_r\) and \(E\), taking \(c_0\) as known. At fixed \(T\) the derivatives are
Within one temperature series all sensitivity rows are parallel in this two-parameter space, however many sampling times are used. Exactly at \(T_r\) the second component vanishes. Temperatures on opposite sides of the reference rotate the rows in opposite directions and can reduce parameter correlation. For equal absolute concentration uncertainty, the factor \(kt e^{-kt}\) peaks at \(kt=1\). A wider temperature range changes the rate as well as the orientation, so a time schedule informative at one temperature can miss the decay at another.
OneSimulation · When should the second thermometer reading be taken?
A vessel cools toward a known ambient temperature. The temperature excess is \(A e^{-kt}\), with nominal amplitude 4 K and nominal rate 0.4 per hour. Two independent readings, each with standard deviation 0.08 K, are available. One is taken at time zero. If the amplitude were known exactly, the time sensitivity to the rate would peak in magnitude at \(t=1/k\). But the first reading estimates the unknown amplitude and introduces uncertainty into the rate estimate.
The OneSimulation solve computes the local two-parameter covariance from the sensitivity matrix. Another derivation comes from taking the log ratio of the readings and propagating their errors to first order. The variance of the estimated rate is
Writing \(z=kt\), the minimum satisfies \(z=1+e^{-2z}\). Thus the preferred time is about 2.77 h, slightly later than the 2.50 h optimum with a known amplitude. Two close readings hardly discriminate a rate; a very late reading is nearly lost in absolute instrument noise. The curve is a local design calculation at the nominal rate, before observing any temperatures.
"""Choose a sampling time for a cooling rate when its amplitude is also unknown."""
import matplotlib.pyplot as plt
import numpy as np
from onesim.numerics.linear.matrices.dense_linear_algebra import solve_dense
amplitude = 4.0 # K above a known ambient temperature
rate = 0.4 # per hour
noise = 0.08 # K, standard deviation of each independent measurement
times = np.linspace(0.15, 10.0, 400) # first reading at 0 h; vary the second
standard_errors = []
for t in times:
decay = np.exp(-rate*t)
sensitivity = np.array([[1., 0.], [decay, -amplitude*t*decay]])
covariance = solve_dense(sensitivity.T @ sensitivity / noise**2, np.eye(2))
standard_errors.append(np.sqrt(covariance[1, 1]))
known_amplitude = noise * np.exp(rate*times) / (amplitude*times)
analytic = noise * np.sqrt(1 + np.exp(2*rate*times)) / (amplitude*times)
assert np.allclose(standard_errors, analytic)
best = np.argmin(standard_errors)
print(f"Optimal second reading on grid: {times[best]:.2f} h; rate SE {standard_errors[best]:.4f} /h")
fig, ax = plt.subplots(figsize=(6.8, 3.8), constrained_layout=True)
ax.semilogy(times, standard_errors, color="#176879", label="Estimate amplitude and rate")
ax.semilogy(times, known_amplitude, "--", color="#a4492b", label="Amplitude known exactly")
ax.scatter(times[best], standard_errors[best], color="#273d30", zorder=3)
ax.set(xlabel="Time of the second reading (h)", ylabel="Local rate standard error (1/h)")
ax.legend()
ax.grid(alpha=0.2)
fig.savefig("inverse-problems.png", dpi=160)

Compare an inference with three numerical experiments
The OneSimulation Arrhenius experiment supplies three fits to noisy synthetic histories. First compare two runs at the wider temperature range: doubling the noise scale changes the reported standard error of \(E\) from 0.3636 to 0.7228 kJ/mol. Next restore the original noise and narrow the spacing between temperatures from 5 K to 1 K. The standard error reaches 1.4300 kJ/mol. The second change alters the geometry of the sensitivity rows, even though the number of observations stays the same. The exact factor also depends on the sampling times and nonlinear fit.
The known generating value is 115 kJ/mol. A single fitted standard error describes expected spread under local assumptions. It is not a bound on any particular realised error. Vary the seed and record both the fitted estimate and its reported uncertainty. Compare the empirical spread with the average nominal error and inspect the distribution of standardised errors. A systematic shift under repeated seeds suggests estimator bias or a mismatch in the analysis; one unusual seed alone cannot settle that question.
Validate the model where it will be used
Hold out an entire temperature curve to test the predicted temperature dependence. Randomly omitting isolated time points from every curve mostly tests interpolation within already represented conditions; it also risks leakage if neighbouring errors are correlated. Fit only the training data, make the held-out prediction with its uncertainty, and plot signed prediction errors against time. If different temperatures systematically show opposite curvature errors, revisit the rate model before reporting more digits in \(E\).
A reproducible inference records the forward equations, units, noise law, parameter scales, data split, residual plots and the specific prediction the fit supports. Parameter identifiability is tied to the observations available. Adding a second measurement condition can change the answer more than switching between two competent optimisation algorithms.
Choose a design for the prediction that will be reported
Consider a linear calibration \(y=a+bx+\epsilon\) on an instrument with two available settings \(x=-1,+1\). Assume independent errors of common known variance \(\sigma^2\). Any number of repetitions at the same setting estimates its mean response. Denote the two setting means by \(m_-\) and \(m_+\). The calibration then predicts the value at any target \(t\) by linear interpolation or extrapolation,
This expression follows by equating the coefficients of the constant and linear functions, both of which must be reproduced exactly.
With \(n_-\) and \(n_+\) readings, the variance is \(\sigma^2[(1-t)^2/(4n_-)+(1+t)^2/(4n_+)]\). For a fixed budget \(N=n_-+n_+\), minimise over positive group sizes. Taking the derivative with respect to \(n_-\), or applying Cauchy–Schwarz, gives
The absolute values matter outside the calibration interval, where one interpolation weight becomes negative while its contribution to variance remains positive. This result assumes the slope law is trusted at the target and both settings cost the same.
Allocate twelve readings for a target near one endpoint
At \(t=1/2\) the target weights are \(1/4\) and \(3/4\). The optimal division of twelve readings is therefore three at the negative setting and nine at the positive setting. For unit measurement variance, the resulting prediction variance is
Splitting the readings equally instead gives
The first design reduces this particular variance by one fifth. Both designs can reconstruct the full line because both endpoints have been observed.
If the target were a tight joint estimate of intercept and slope, the answer would change. The information matrix in these two parameters has diagonal entries \(N\) and off-diagonal entries \(n_+-n_-\) for unit variance. Its determinant is \(N^2-(n_+-n_-)^2=4n_-n_+\), maximised by a six–six design. For the three–nine design the determinant is 108 versus 144 when balanced. Giving up joint precision here buys precision specifically for the proposed positive-side prediction. A design decision cannot be assessed without knowing which quantity is intended for publication.
As a further check, allow the physical calibration to contain an unmodelled quadratic term \(d x^2\). At both design points that contribution equals the same constant \(d\), so it is absorbed into the fitted intercept. At \(t=1/2\) its actual contribution is only \(d/4\). Every design using the two endpoints alone therefore incurs prediction bias \(3d/4\), however small its nominal variance. An additional interior validation setting can reveal this defect in a way that more repeated endpoint measurements cannot.
A further constraint may come from instrument startup time. If changing between settings is expensive while taking repeated readings is cheap, run the readings in groups but randomise or balance their order across independent sessions. Otherwise a gradual drift can become indistinguishable from the slope. The independent-error variance derivation offers no protection against an unmodelled time effect confounded with the chosen temperature or excitation.
Change parameters · Design an informative experiment and test its predictions
Change one input at a time and compare the recalculated curves with the argument above. The browser evaluates this small model locally; the accompanying numerical values state its assumptions and reference checks. Reset restores the reference inputs, and the data can be downloaded as CSV.
Study the full derivation
Choose a regularisation scale by predicting omitted data · Inferring parameters and fields from observations
Regularised least squares can fit each observation partly with itself. Derive leave-one-out residuals from a single factorisation, approximate them by a trace and identify when a generalised cross-validation score misses a highly influential sensor.
Problem sheet 3 · Nonlinear estimates and experimental design
Distinguish a successful optimisation step from a reliable parameter estimate and a prediction that generalises.
1. One step, two possible answers
For \(r(p)=p^2-4\), (a) compute the Gauss–Newton steps from \(p=1\) and \(p=-1\). (b) Compare the actual and linear predicted residuals after the positive-start step. (c) Explain what happens from \(p=0\), and why one local standard error cannot describe all possibilities.
Inspect the slope at each starting point
The step is \(-r/(2p)\) for \(p\ne0\). It is \(+1.5\) at 1 and \(-1.5\) at −1. From 1 the linear model predicts residual zero, whereas \(r(2.5)=2.25\). Its magnitude still decreased from 3. At zero the derivative vanishes, and the linear model predicts no improvement in any direction. The two separated exact solutions \(+2,-2\) produce distinct local uncertainty regions unless physics fixes the sign.
Explore the related calculation with adjustable inputs. Explore how initial values and the residual slope affect Newton and secant convergence on the quadratic reference problem; retain the stated residual when checking the present hand calculation.
2. Which two measurement conditions?
In dimensionless whitened coordinates each design may add two rows. Compare \(J_A=\left(\begin{smallmatrix}1&0\\1&0\end{smallmatrix}\right)\) and \(J_B=\left(\begin{smallmatrix}1&-0.5\\1&0.5\end{smallmatrix}\right)\). (a) Determine each information matrix and rank. (b) Find the uncertainty of the second parameter under design B and after repeating the whole design four independent times. (c) Relate the calculation to measuring decay only at a reference temperature.
Compute the information added by each row
Design A gives \(\operatorname{diag}(2,0)\), rank one. Design B gives \(\operatorname{diag}(2,0.5)\), rank two. In the local linear unit-noise model the second parameter has variance 2, hence standard deviation \(\sqrt2\). Four independent copies multiply information by four and halve that standard deviation. At the reference temperature the Arrhenius activation derivative vanishes. More sampling at that one temperature cannot recover the missing direction.
Explore the related calculation with adjustable inputs. Change the parameters in the corresponding calculation and compare its independently recomputed values with the equation derived in this solution.
3. Read a fit as a prediction
Use the temperature-design experiment. (a) Compute the narrow-to-wide standard-error ratio for \(E\) at fixed noise. (b) Compare the wide-range fit error with its own standard error using the known 115 kJ/mol truth. (c) Design a validation that tests a new temperature and one that tests noise calibration.
Change a single condition per comparison
The ratio is
For the wide, lower-noise fit the signed error is \(114.0367-115=-0.9633\) kJ/mol, about \(-2.65\) reported standard errors. This is one draw; it does not estimate the long-run coverage fraction. To assess transfer, hold out a complete temperature series, fit the others and predict that entire curve. To assess noise calibration, repeat the same design with many independent seeds and compare scatter or interval coverage against the local uncertainty calculation.
Choose between repeating and spreading measurements
At fixed noise the wide five-temperature design gives a local standard error of 0.3636 kJ/mol and the narrow design gives 1.4300 kJ/mol. Suppose independent complete replicas of the narrow design are possible. Derive how many are needed to equal or beat the wide design, using the linearised least-squares covariance at a fixed nominal parameter.
Work through the solution
Whiten the observations and call the design Jacobian \(J\). Stacking \(n\) identical independent designs adds \(n\) copies of \(J^TJ\). The covariance is its inverse, so the standard errors shrink by \(1/\sqrt n\). Require \(1.4300/\sqrt n\le0.3636\), giving \(n\ge15.47\), hence 16 complete sets, or 80 temperature experiments. This calculation uses the reported errors as local estimates. Shared calibration offsets or a changed nominal fit can invalidate the independent-replica scaling.
Chapter 7 · Bayesian inversion and the information supplied by a prior
Combine an explicit distribution for the parameters with a noise model. Calculate exactly which uncertainties an observation reduces.
From first principles
Derive a posterior from a prior and a noisy reading
Suppose the scalar parameter \(x\) has Gaussian prior mean \(m_0\) and variance \(v_0>0\), and a sensor reads \(y=x+\epsilon\), with independent Gaussian error of variance \(s^2>0\). Bayes’ rule multiplies the prior density by the probability of obtaining the reading at each trial \(x\). Its negative log, apart from constants, is
The coefficient of \(x^2/2\) gives the inverse posterior variance. Matching the linear coefficient after completing the square determines the posterior mean,
Greater precision means larger weight. An extremely uncertain reading leaves the prior nearly unchanged, while an extremely precise measurement concentrates the posterior near the reading. These statements describe the specified prior and instrument model. They depend on the reliability of both inputs.
Derivation and applications
Predict a future reading using the full posterior uncertainty
A posterior can describe both an unknown state and measurements still to come. Suppose current data give \(x\mid y\sim N(m,C)\). A new independent instrument will observe \(y_*=a^Tx+\epsilon_*\), with known zero-mean Gaussian noise variance \(s_*^2\). Conditional on a fixed \(x\), the only variability is instrumental. Averaging over the posterior makes the expected new reading
Apply the law of total variance. The expected conditional variance is the new instrument variance, and the variance of its conditional mean is the uncertainty in the latent signal,
The new reading is Gaussian because it is a sum of independent Gaussian contributions. Two future readings along the same vector \(a\) share the latent uncertainty while retaining independent measurement errors. For \(n\) such readings of equal precision, their predicted mean has
Increasing the number of future repeats reduces only the noise of their average in this prediction. Once actually observed, those data can be used to update the state further. A predictive check is most informative when the new observations were excluded from the original inference and the instrument model applies under the future conditions.
Worked example
Compare a latent interval and a future reading
A posterior for one temperature has mean \(20.0\,^\circ\mathrm C\), variance \(0.16\,\mathrm{K^2}\). A new thermometer has deviation \(0.30\,\mathrm K\). Its predicted reading deviation is
A new reading of \(21.0\,^\circ\mathrm C\) lies two predictive standard deviations above the mean. Dividing its discrepancy by the latent deviation \(0.40\,\mathrm K\) would assess a different quantity.
Second application
Forecast the precision of an averaged observation
A separate model predicts a linear contrast with \(a^TCa=0.09\), and a single future reading has noise variance \(1.44\). Averaging 16 readings gives predictive deviation \(\sqrt{0.09+1.44/16}=0.424\). Even infinitely many future repeats would leave a prior-to-measurement predictive deviation \(0.300\). To reduce it to \(0.350\) would require \(n\ge1.44/(0.350^2-0.09)=44.31\), hence at least 45 readings.
From one answer to a distribution
In an experiment with \(y=Ax+\epsilon\), let the unknown have a Gaussian prior with mean \(m_0\) and covariance \(C_0\), and let measurement error be independent Gaussian with mean zero and covariance \(\Gamma\). The prior describes the state of knowledge before seeing these data. Bayes' rule multiplies the likelihood by that prior and normalises over parameters. For positive-definite covariances the negative log posterior, up to constants, is
The minimiser is the maximum a posteriori estimate. This objective has the same algebra as Tikhonov regularisation centred on a background. The probabilistic interpretation adds assumptions: if the distributions are taken seriously their scales and correlations imply uncertainty, not just a convenient stabiliser for a solver. A guessed smoothness penalty cannot be given calibrated probability intervals without justifying its scale.
Complete the square
Expanding the quadratic in \(x\) gives precision \(C_{\rm post}^{-1}=C_0^{-1}+A^\mathsf{T}\Gamma^{-1}A\) and mean \(m_{\rm post}=C_{\rm post}(C_0^{-1}m_0+A^\mathsf{T}\Gamma^{-1}y)\). Since the exponent is quadratic and the precision positive definite, the posterior is Gaussian and its mean is also its mode. For implementation, factor and solve the precision system. When data dimension is much smaller than parameter dimension, the equivalent data-space update can be cheaper:
The same matrix multiplying the data discrepancy determines how far knowledge moves from the prior. A reading much more precise than the prior prediction has high influence in its observed direction; an observation compatible with a broad noise distribution does less. In this linear Gaussian setting posterior covariance depends on design and noise, while the posterior mean also depends on the realised data values.
Recover a sum and ask about the difference
Take two independent prior components with means zero and variances 1. Observe their sum as 3 with noise variance 1. The predicted observation variance is \(1+1+1=3\), so the update gives \(m_{\rm post}=(1,1)\). The posterior covariance is \(I-\frac13\left(\begin{smallmatrix}1&1\\1&1\end{smallmatrix}\right)\). Thus the sum has posterior variance \(2/3\), down from 2, while the difference still has variance 2. A unique best estimate of the difference exists (zero), but here the measurement supplied no information about it. Reporting only the point estimate would conceal that distinction.
Interpret prior correlations and check their consequences
If nearby temperatures have positively correlated priors, observing one cell can reduce uncertainty in another even when its forward sensitivity is zero. That reduction is conditional on the correlation model. Change the correlation length, rerun the update and examine the target prediction. Before training, draw plausible prior fields or use representative quantiles and pass them through the forward operator. If almost every predicted data set violates basic instrument ranges or physical constraints, revisit the prior or parameterisation. This prior-predictive check uses no fitted residual and can uncover a consequential modelling error before a numerical optimiser converges.
Condition a second update on what the first already revealed
Suppose two observation errors share a known source, so processing each reading as an independent likelihood risks counting some information twice. For a scalar parameter and common response coefficient one, write \(y_1=x+e_1,\ y_2=x+e_2\). Let the errors be jointly Gaussian with variances \(v_1,v_2\), covariance \(c\), and independence from the prior parameter. Subtract \(\alpha=c/v_1\) times the first reading from the second. The transformed second error \(e_2-\alpha e_1\) has zero covariance with \(e_1\). Gaussianity strengthens that fact to independence. Its variance is \(v_2-c^2/v_1\) and its response coefficient is \(1-\alpha\).
The data can now be processed sequentially with the same result as a full joint update. If the new transformed coefficient is small, its effect is small even if the reading itself appears precise. The assumption that the original covariance is positive definite guarantees a positive residual variance. Perfectly correlated errors require a separate treatment of any exact difference equation. With non-Gaussian errors, decorrelation alone does not establish independent likelihoods, even when a linear unbiased estimator remains available.
Compare an independent replicate with a correlated one
Start with prior \(x\sim N(0,4)\). Two readings, 2 and 3, have unit marginal error variances and covariance \(1/2\). After the first observation, the precision rises from \(1/4\) to \(5/4\) and the precision-weighted mean rises from zero to 2. Thus the intermediate posterior has variance \(4/5\) and mean \(8/5\). The adjusted second datum is \(3-(1/2)2=2\), with observation coefficient \(1/2\) and noise variance \(1-1/4=3/4\). Its contribution to precision is \((1/2)^2/(3/4)=1/3\), much smaller than the unit contribution of an independent replicate.
The final precision is
The adjusted datum adds \((1/2)2/(3/4)=4/3\) to the weighted mean, giving posterior variance \(12/19\) and mean \((2+4/3)(12/19)=40/19\). The mean is about 2.11 and the standard deviation about 0.795. Incorrectly treating both original readings as independent would give variance \(4/9\), mean \(20/9\), and standard deviation \(2/3\). The same pair of readings has therefore yielded a more confident answer solely by suppressing part of the noise model.
An independent check uses the average and difference of the two observations. Their respective signal coefficients are one and zero; equal marginal variances make these two errors uncorrelated and hence independent. The average is 2.5 with variance \((1+1+2\cdot0.5)/4=0.75\) and therefore adds precision \(4/3\) to the prior. The difference remains available for checking the joint error model, even though it supplies no information about \(x\). Both routes give the same posterior when each part of the evidence is used exactly once.
For the numbers used here the difference \(3-2=1\) has variance \(1+1-2(1/2)=1\). It is one standard deviation from the expected zero difference. Thus there is no substantial conflict between these two readings under their correlation model, even though treating them as independent would exaggerate the information available about their shared underlying value.
Update an unobserved parameter through prior correlation
Two cell values have prior means zero, unit variances and correlation \(\rho\). Only the first cell is observed, yielding 3 in measurement noise of variance one. The data-space update transfers information to the other cell through cross-covariance.

Read values from the plot
| Prior correlation between two cells | Second cell mean shift | Second cell posterior σ |
|---|---|---|
| −0.95 | −1.425 | 0.74078 |
| −0.47 | −0.705 | 0.94316 |
| 1.1102e−16 | 1.6653e−16 | 1 |
| 0.47 | 0.705 | 0.94316 |
| 0.95 | 1.425 | 0.74078 |
Change parameters · Update an unobserved parameter through prior correlation
Change one input at a time and compare the recalculated curves with the argument above. The browser evaluates this small model locally; the accompanying numerical values state its assumptions and reference checks. Reset restores the reference inputs, and the data can be downloaded as CSV.
Study the full derivation
What each new sensor reading changes in a Gaussian inverse problem · Inferring parameters and fields from observations
Start with an uncertain vector, condition on one noisy linear observation, and reconstruct the posterior mean and covariance without repeating a batch inversion. Check shared calibration errors before treating repeated measurements as independent evidence.
Chapter 8 · Predictions, parameter profiles and nonlinear uncertainty
Calculate intervals for a quantity of interest, then find where a linear covariance approximation loses the geometry of a nonlinear fit.
From first principles
Propagate fitted uncertainty to a reported quantity
Suppose a fit gives a parameter estimate \(m\) with covariance \(C\), and the quantity to be reported is \(z=h(p)\). Near \(m\), expand a differentiable \(h\) to first order. Writing \(g=\nabla h(m)\), each small parameter change contributes through its directional sensitivity,
Correlations can either reduce or enlarge the propagated variance. For a genuinely nonlinear quantity or a large parameter region, a local line may miss the full shape. One alternative holds the target value fixed and finds the best fit compatible with it. With an objective \(\Phi\), define
Comparing this constrained objective with its unconstrained minimum tracks compensating changes in the nuisance parameters. A confidence level for its increase requires an explicit statistical model; tracing an objective curve alone supplies no probability calibration.
Derivation and applications
Derive a profile interval using the covariance of a linear fit
Suppose a Gaussian linear experiment gives unconstrained estimate \(m\) and strictly positive covariance \(C\), with correctly known noise scale. Its negative log likelihood relative to the optimum is the quadratic distance \(\tfrac12(p-m)^TC^{-1}(p-m)\). To profile a reported scalar \(z=c^Tp\), require the candidate parameters to satisfy that equality. Introduce a multiplier and differentiate with respect to the vector,
The constraint determines \(\lambda=(c^Tm-z)/(c^TCc)\). Substitution gives both the parameter combination selected at each target value and the profile height,
This reproduces the usual propagated Gaussian variance while showing exactly how the other fitted coordinates move along the profile. For a monotone function \(q=g(z)\), imposing \(q\) fixes the corresponding \(z=g^{-1}(q)\). The profile then transforms without approximation,
An interval selected by a likelihood-ratio threshold maps by applying \(g\) to its two endpoints. It can be asymmetric even when the underlying likelihood in \(p\) is exactly quadratic. If \(g\) is not one-to-one, every feasible branch must be considered and the smallest objective chosen.
Worked example
Track the nuisance displacement along a profile
Take \(m=(2,4)^T\), \(C=\left(\begin{smallmatrix}1&0.5\\0.5&1\end{smallmatrix}\right)\), and target \(z=p_1+p_2\). The target mean is 6 and variance 3. At \(z=9\), \(Cc=(1.5,1.5)^T\), giving constrained state \((3.5,5.5)^T\). The twice-log-likelihood increase is \(3^2/3=3\). Holding the second parameter fixed would impose a different and more restrictive path.
Second application
Transform an interval for a positive output
A second model estimates \(z=\ln(q/q_0)\) with mean \(0.4\) and deviation \(0.3\); let \(q_0=10\). At threshold \(2\Delta\Phi=4\), the interval in \(z\) is \([-0.2,1.0]\). Mapping its endpoints gives \(q\in[8.19,27.18]\), around the maximum-likelihood value \(10e^{0.4}=14.92\). A symmetric interval about that value would lose the exact profile geometry.
Push uncertainty through the prediction
Often a user needs tomorrow's temperature or a time to threshold, rather than all fitted coefficients. For a linear target \(h(x)=c^\mathsf{T}x\) and Gaussian posterior, \(h\) is Gaussian with mean \(c^\mathsf{T}m\) and variance \(c^\mathsf{T}C c\). Include covariance terms: positively correlated errors raise uncertainty in a sum and reduce it in a difference. For a new noisy measurement add its own independent measurement variance. Reporting this predictive interval as the uncertainty of the noise-free underlying response would mix two questions.
For a smooth nonlinear \(h\), expand about the mean \(m\). The first-order variance is \(\nabla h^\mathsf{T}C\nabla h\); the leading correction to the mean is \(\tfrac12\operatorname{tr}[H_h(m)C]\). If the gradient vanishes, first-order variance propagation can return zero despite substantial uncertainty. For example, if \(x\) is centred normal with variance \(s^2\) and \(h=x^2\), then \(\mathbb Eh=s^2\) and \(\operatorname{Var}h=2s^4\), using the Gaussian fourth moment. The linear approximation at zero would miss both.
A positive rate and a nonlinear lifetime
Suppose \(\theta=\ln(k/k_{\rm unit})\) is normal with mean \(m\) and standard deviation \(s\). A decay lifetime is
Its median is \(e^{-m}/k_{\rm unit}\); its mean is larger by \(e^{s^2/2}\). A central 95% interval is \([e^{-m-1.96s},e^{-m+1.96s}]/k_{\rm unit}\). These endpoints need not be equally far from the median. For median 10 s and \(s=0.5\), the interval is approximately [3.75, 26.6] s and mean 11.33 s. Transform samples or quantiles if strong nonlinearity makes symmetric error bars misleading.
A profile follows compensating changes
Let the fit have parameters \((p,q)\). To profile \(p\), fix it temporarily at each trial value and minimise the objective over \(q\). The resulting curve reflects how much the other parameter can compensate. Holding \(q\) fixed instead gives a slice that is generally steeper and gives deceptively narrow intervals. For the sum-of-squares surface \(F=(p+q-2)^2+0.04(q-1)^2\), minimising gives
The resulting profile is \(0.04(p-1)^2/1.04\). A slice at the joint optimum's \(q=1\) is just \((p-1)^2\). Both have minimum at one but radically different curvature.
Read the level as well as the curve
A profile likelihood is a maximisation over nuisance parameters. A Bayesian marginal instead integrates their probability. Even when their modes agree the two objects can differ in shape in nonlinear models. A likelihood-ratio threshold yields approximate confidence sets under regularity assumptions and enough informative data. Boundaries, multiple modes and poorly identified nuisance parameters may invalidate a familiar chi-square cutoff. Report the objective convention and how the threshold was calibrated, e.g. by simulated repetitions of the full experiment. A plot of the raw profile and representative predicted curves along it remains interpretable even when an asymptotic confidence level is questionable.
Invert a test to put an interval on a ratio
A scientifically relevant quantity may be \(q=\mu_y/\mu_x\), for example the response per unit excitation. Estimates \(\hat x,\hat y\) can each have nearly Gaussian uncertainty even when their ratio is highly asymmetric. Suppose for now that they are independent normals with known variances \(s_x^2,s_y^2\), and that the true denominator is nonzero. To test a proposed ratio \(q\), consider the contrast \(\hat y-q\hat x\). If the proposed ratio is correct, that contrast has mean zero and variance \(s_y^2+q^2s_x^2\). The source of difficulty, the uncertain denominator, now enters the reference variance explicitly.
Collect all values whose absolute standardised contrast is at most a normal quantile \(z\). Squaring and expanding gives the quadratic inequality
This inversion gives a confidence set because it contains the true ratio exactly when the correctly standardised contrast falls in the specified acceptance region. Its shape need not resemble a symmetric error bar. If the leading coefficient changes sign, the accepted set may be unbounded. A covariance between \(\hat x\) and \(\hat y\) changes the variance to \(s_y^2+q^2s_x^2-2q\,\mathrm{Cov}(\hat x,\hat y)\), so the preceding coefficients require modification.
A precise reading divided by an uncertain excitation
Use \(z=2\), corresponding to about 95.45 percent coverage for the stated normal model. Set \(\hat x=2,\hat y=4,\ s_x=0.5,\ s_y=1\). The quadratic coefficients are 3, −16 and 12. Its roots are \((16\pm\sqrt{112})/6\), about 0.903 and 4.431. The accepted set is the closed interval between them because the polynomial opens upward. The point estimate is two. The interval extends considerably farther upward than downward because a smaller plausible excitation can produce a much larger ratio. A symmetric linearised interval loses this asymmetry.
Now keep the observations and numerator uncertainty fixed but raise \(s_x\) to 1.5. The resulting inequality is \(-5q^2-16q+12\le0\), whose roots are \((-16\pm\sqrt{496})/10\), about −3.827 and 0.627. The accepted set consists of the two exterior rays. It includes very large positive and negative values. For such values the standardised contrast approaches \(|\hat x|/s_x=4/3\), inside the threshold two, precisely because the data cannot rule out an excitation arbitrarily close to zero.
An investigator with independent physical information that the excitation is strictly positive may intersect the set with the resulting permitted parameter space. A numerical routine that simply discards negative draws or clips ratios at a convenient maximum is instead changing the uncertainty analysis. The unbounded set is a measurable statement about what an experiment failed to localise, and identifies the denominator measurement as an appropriate target for redesign.
When \(\hat x^2=z^2s_x^2\) exactly, the quadratic term disappears. The confidence set is then ordinarily a half-line determined by a linear inequality. This is the transition between bounded and exterior solutions. A robust implementation must handle it directly instead of dividing by a leading coefficient that may be zero or extremely small.
Change parameters · Explore the worked calculation
Change one input at a time and compare the recalculated curves with the argument above. The browser evaluates this small model locally; the accompanying numerical values state its assumptions and reference checks. Reset restores the reference inputs, and the data can be downloaded as CSV.
Problem sheet 4 · Which uncertainty came from the experiment?
Compare a posterior update, a nonlinear prediction and a likelihood profile on problems with exact solutions.
1. Learning about an unmeasured cell
Two temperatures have prior mean \((20,20)\) and covariance \(\left(\begin{smallmatrix}4&2\\2&4\end{smallmatrix}\right)\) K². The first cell is measured as 23 °C with independent noise variance 1 K². (a) Compute the updated mean and covariance. (b) Repeat the update of the second cell using zero prior correlation and the same marginal variances. (c) Interpret the difference.
Follow the cross-covariance into the unmeasured cell
The prior observation variance including noise is 5. Its cross-covariance with the state is \((4,2)^\mathsf{T}\), giving updated mean \((22.4,21.2)\). Subtract \((4,2)^\mathsf{T}(4,2)/5\) from the prior covariance to obtain \(\left(\begin{smallmatrix}0.8&0.4\\0.4&3.2\end{smallmatrix}\right)\) K². With zero correlation the second mean and variance stay at 20 and 4. The indirect update relies entirely on the prior correlation assumption and the new first-cell measurement together.
Explore the related calculation with adjustable inputs. Change the parameters in the corresponding calculation and compare its independently recomputed values with the equation derived in this solution.
2. A nonlinear prediction at a stationary point
Let \(x\sim N(0,0.25)\), and take a detector intensity proportional to \(I=x^2\). (a) Calculate the mean and variance of \(I\). (b) Compare with the first-order delta method. (c) Find the upper endpoint of a one-sided 95% predictive interval for the ideal intensity using \(P(|Z|\le1.96)\simeq0.95\).
Transform the Gaussian amplitude before reporting intensity
The mean is 0.25 and variance is
At the mean amplitude the derivative \(2x\) vanishes, so the first-order method predicts zero variance. The ideal intensity is nonnegative and \(P(I\le(1.96\times0.5)^2)\simeq0.95\), giving upper endpoint 0.9604. A new noisy intensity reading would also require an observation model.
Explore the related calculation with adjustable inputs. Change the parameters in the corresponding calculation and compare its independently recomputed values with the equation derived in this solution.
3. Slicing a valley or profiling it
Given \(F=(p+q-3)^2+0.25(q-1)^2\), (a) locate its joint minimum. (b) Derive the profile in \(p\) and the slice with \(q\) fixed at its optimum. (c) Compare the widths of the two sets defined by \(F\le1\).
Allow the nuisance parameter to compensate
The joint minimum has \(q=1,p=2\). For fixed \(p\), differentiation gives
substitution yields
The slice is \((p-2)^2\). The half-widths are \(\sqrt5\) and 1 respectively. Their ratio is independent of the chosen positive contour level for this quadratic surface. Attaching a confidence level still requires a likelihood scale and sampling assumptions.
Explore the related calculation with adjustable inputs. Change the parameters in the corresponding calculation and compare its independently recomputed values with the equation derived in this solution.
Chapter 9 · Adjoint gradients through a forward solver
Differentiate a scalar objective with respect to many parameters without recomputing a separate perturbed solution for each one.
From first principles
Differentiate a scalar objective through a linear state equation
Suppose the state \(u\) solves \(K(p)u=f(p)\) for a given parameter vector, with nonsingular \(K\), and a scalar objective \(J(u,p)\) measures mismatch. A small parameter perturbation changes the state through both the load and the operator. Differentiating the balance gives
To obtain a scalar derivative without computing every state sensitivity, solve the transpose system \(K^T\lambda=J_u\) once. Substitution eliminates \(du\),
Each parameter then contributes through its derivatives of \(f,K,J\). The transpose is required even if the forward solver is more familiar; it moves the scalar objective’s weights backward through the linear response. A directional finite difference of the complete objective is an independent check on a computed adjoint gradient.
Background · Adjoint sensitivity
This operation maps a data-space vector back to parameter space. For a discretised physical model the chosen inner products determine the correct adjoint.
Derivation and applications
Propagate a terminal measurement backward through continuous time
Consider a scalar state satisfying \(\dot u=a(t)u+p\,b(t)\) over \(0\le t\le T\), with known initial state independent of \(p\). A sensor observes \(u(T)\), giving loss \(J=\tfrac12[u(T)-y]^2\). Assume continuous coefficients and exact evolution for this calculation. The forward derivative \(w=\partial u/\partial p\) satisfies an inhomogeneous initial-value problem, and the objective derivative depends on its endpoint,
Instead of solving for every possible forcing sensitivity separately, introduce a terminal weight \(\lambda(T)=u(T)-y\). Choose its evolution to cancel the term proportional to \(w\) in the derivative of \(\lambda w\). The product rule gives
Integrate over the interval. The initial product vanishes because \(w(0)=0\), and the terminal product equals the desired gradient. Thus
One backward weight suffices for many scalar parameters entering through different forcing shapes. A parameter-dependent initial condition would add \(\lambda(0)\partial_pu(0)\). A discrete time integrator approximating the continuous equations also introduces integration error; differentiating the actual discrete steps gives the derivative of the computed loss at that finite step size.
Worked example
Reconstruct a sensitivity in a decaying reservoir
For \(a=-1,\ b=1,\ T=\ln 2,\ u(0)=0,\ p=4\), the terminal state is
With observation \(y=1.5\), the terminal adjoint is \(0.5\). Earlier weights are \(\lambda(t)=0.5e^{-(T-t)}\), so
Direct differentiation of \(\tfrac12(p/2-1.5)^2\) at four confirms the result.
Second application
Compare two controls observed only at the endpoint
For \(\dot u=-u\) between two instantaneous unit-gain input pulses, consider their amplitudes as independent parameters. A pulse at time \(t_i\) contributes \(e^{-(T-t_i)}\) to terminal-state sensitivity. At \(T=3\) with terminal residual 2, the gradient for a pulse at \(t=1\) is \(2e^{-2}=0.271\); for a pulse at \(t=2\) it is
Later forcing has greater leverage because it has less time to decay.
Does the gradient see where the instruments were actually placed?
A periodic ring of parameter nodes is mapped to fewer instrument readings in two operations. First a narrow, slightly asymmetric sensor spreads each nodal signal to its neighbours. Write this as a matrix \(S\). Next the instruments sample between nodes. For an instrument a fraction \(f\) of the way from node \(j\) to \(j+1\), the corresponding row of \(B\) has entries \(1-f\) and \(f\) at those nodes. The complete forward model is \(A=BS\). It is rarely necessary to assemble this product on a large mesh, but a small explicit example makes it possible to audit every entry.
Take Euclidean inner products so the conventions are clear. An adjoint must satisfy \((Av)^Tw=v^TA^Tw\) for every parameter direction \(v\) and sensor residual \(w\). Moving each matrix across the scalar product yields
The interpolation transpose scatters a sensor residual back to both neighbouring nodes with exactly the original weights. The smoothing transpose then exchanges the left and right coefficients of the stencil. Applying the forward smoothing again can look plausible and still shift the inferred sensitivity footprint.
Open full-size diagramTo test the gradient choose the merit function \(J(m)=\tfrac12\|Am-y\|^2\). Its directional derivative is \(v^TA^T(Am-y)\). Expand the quadratic objective exactly to find
Halving \(h\) divides the remainder by four until rounding intervenes. Substituting a wrong derivative leaves an extra term linear in \(h\). The notebook checks both the observed scaling and the coefficient of the quadratic term at one finite step. Several independent directions help avoid a chance cancellation in a single test.
With a fraction \(f=0.35\), one unit of observation residual is split into 0.65 and 0.35 before reverse smoothing. Its total remains one because the row weights sum to one, but conservation of that sum is a weak test: using the wrong asymmetric stencil also preserves it. If the underlying inversion uses volume-weighted mesh or measurement inner products, those weights must be included consistently; the plain transpose in this experiment applies to its explicitly chosen Euclidean metric.
The pictured footprint is obtained by sending a single residual backwards. It can also be reconstructed element by element by perturbing one parameter node forwards and recording just that sensor. The two pictures should agree for every node. This costs more forward evaluations, but on a small test ring it checks the location of a discrepancy directly.
Suppose the continuous forward code records a sensor at fraction 0.35 while its adjoint implementation rounds that sensor to the nearest node. Can an exact solution of the adjoint linear system repair the discrepancy?
Work through the solution
The error occurs in the observation operator itself. For a unit residual the true transpose must assign 0.65 and 0.35, whereas the rounded version assigns one and zero. Accurate solves propagate these different inputs accurately. An isolated dot-product test of the observation operator followed by a test of the full composition locates the discrepancy.
Change parameters · Explore this notebook example
Change one input at a time and compare the recalculated curves with the argument above. The browser evaluates this small model locally; the accompanying numerical values state its assumptions and reference checks. Reset restores the reference inputs, and the data can be downloaded as CSV.
The state is also a function of the parameters
Suppose a discretised forward model solves \(K(p)u=f(p)\). Data enter through \(Hu\), and observations have been whitened. The objective is \(J=\tfrac12\|Hu-y\|^2+R(p)\). A direct perturbation of a material parameter changes the predicted state even when that parameter never appears in the observation operator. For fixed \(H\), the state derivative contribution is \(g_u^\mathsf{T}du\), with \(g_u=H^\mathsf{T}(Hu-y)\). Differentiating the state equation gives
Solving this equation once per parameter would be prohibitively expensive for a fine material field.
Transpose the solve
Define an adjoint state by \(K^\mathsf{T}\lambda=g_u\). Then
For each parameter component the gradient is
This uses one forward and one transposed solve for one scalar objective, independent of the number of gradient components. Forming the contractions for all components still costs work, often local to mesh elements. If sensors or boundary conditions also depend explicitly on parameters, their derivative terms must be included. A symmetric diffusion operator may reuse a factorisation; an advection operator need not equal its transpose.
Work a two-cell example
Consider \(K=\left(\begin{smallmatrix}p+1&-1\\-1&2\end{smallmatrix}\right)\), \(f=(1,0)\), and observe the second component with value \(y=0.4\). At \(p=1\), \(u=(2/3,1/3)\), so the residual is \(-1/15\). The adjoint load is \((0,-1/15)\); solving gives \(\lambda=(-1/45,-2/45)\). Only the first diagonal entry of \(K\) depends on \(p\). With no regulariser the derivative is \(-\lambda_1u_1=2/135\). Check independently: \(u_2=1/(2p+1)\), whose derivative at one is \(-2/9\). Multiplying by the residual gives the same positive gradient. Increasing \(p\) lowers an already underpredicted second reading.
Test the computed gradient in a direction
Pick a physically scaled perturbation \(v\). A correct gradient gives a linear residual \(J(p+hv)-J(p)-h\,g^\mathsf{T}v\) of order \(h^2\) for a smooth problem. Halving \(h\) should roughly quarter this remainder across a useful range. At very small \(h\), forward-solver tolerances and floating-point cancellation can dominate. Repeat with directions touching different components and with the same boundary-condition handling used in production. A close fit to the observed data is a poor gradient test when residuals nearly vanish: a wrong data gradient can then look small by accident. Evaluate at a parameter away from the best fit, solve the state again for each perturbation and compare the resulting objective values. To detect a missing transpose, include a nonsymmetric forward operator in the test. The symmetric two-cell example above can expose a sign error but cannot distinguish the forward matrix from its transpose.
Reverse a sequence of state updates
Suppose the forward solver evolves \(u_{n+1}=G_n(u_n,p)\) for a fixed number of steps, and an objective sums observation losses \(\ell_n(u_n,p)\) from time zero to the final time. The direct chain rule carries a state derivative with respect to every parameter through the entire trajectory. To reverse the calculation, start with \(\lambda_N=\partial_{u_N}\ell_N\) as a column vector. A perturbation \(du_n\) affects both the loss at time \(n\) and the following state by \(G_{n,u}du_n\). Moving the latter action across a dot product gives the recursion \(\lambda_n=\partial_{u_n}\ell_n+G_{n,u}^T\lambda_{n+1}\).
The parameter gradient is the sum of explicit derivatives of all losses, the initial term \((\partial_p u_0)^T\lambda_0\), and the contributions \(G_{n,p}^T\lambda_{n+1}\) from every step. Each reversed step needs the state information used by its forward counterpart. Storing the whole trajectory makes that information available immediately. Recomputing segments between stored checkpoints trades extra forward evaluations for memory. These formulas differentiate the actual discrete transitions, so an adaptive solver with parameter-dependent step rejection or event switches needs a careful interpretation of the differentiated computation.
Make the transpose observable in a two-step calculation
Take a two-coordinate forward transition \(G(u,p)=Mu+pe_2\), with \(M=\left(\begin{smallmatrix}1&2\\0&1\end{smallmatrix}\right)\), \(u_0=0\), and \(p=1\). Two steps give
Observe the first coordinate only at the end, with target value one. The quadratic loss is one half and its final state derivative is
One reverse step gives
The two parameter contributions are \(e_2^T\lambda_2=0\) and \(e_2^T\lambda_1=2\), so the gradient is two.
The zero contribution from the last injection has a physical meaning: the injected second coordinate can influence the first only during a subsequent transition. The first injection has time to do that through the off-diagonal element two. Using \(M\) in place of \(M^T\) in the backwards calculation would instead keep \(\lambda_1=(1,0)^T\), predicting zero total sensitivity. This example exercises a distinction that disappears when every state matrix is symmetric.
For a scalar parameter perturbation \(h\), solving both steps again gives terminal first coordinate \(2(1+h)\) and loss \(J(1+h)=(1+2h)^2/2\). The remainder after subtracting the base loss and the predicted linear term is exactly \(2h^2\). For \(h=0.1\) and 0.05 the remainders are 0.02 and 0.005. The erroneous zero gradient instead gives 0.22 and 0.105. The two sequences have very different observed convergence factors even though they use identical forward trajectories and observation data.
More generally an individual parameter may enter the map at several times with different signs. The corresponding gradient terms must be accumulated rather than overwritten during the backward pass. In this example overwriting after the earliest step happens to return the correct value because the last contribution is zero. Adding a simultaneous observation of the final second coordinate makes both contributions nonzero and provides a complementary regression case for the time-index accumulation.
For a terminal loss summing both coordinate discrepancies, the adjoint load contains both sensor contributions before the first reverse transition.
Change parameters · Adjoint gradients through a forward solver
Change one input at a time and compare the recalculated curves with the argument above. The browser evaluates this small model locally; the accompanying numerical values state its assumptions and reference checks. Reset restores the reference inputs, and the data can be downloaded as CSV.
Recognise an incorrect gradient by the rate of its remainder
Verify the reduced gradient for \(J(p)=(1/(p+2)-0.6)^2/2\) at \(p=1\). For each perturbation solve the scalar equilibrium again and subtract the original objective and the candidate linear term. The sign of the state sensitivity is essential.

Read values from the plot
| Parameter perturbation h | Correct gradient | Gradient with sign reversed |
|---|---|---|
| 3e−5 | 3.3334e−12 | 1.7778e−6 |
| 0.00028663 | 3.0431e−10 | 1.6985e−5 |
| 0.0027386 | 2.7795e−8 | 0.00016226 |
| 0.026166 | 2.5501e−6 | 0.001548 |
| 0.25 | 0.00024107 | 0.014574 |
Chapter 10 · Iteration as a regulariser
Derive the spectral action of a matrix-free iteration and explain why more iterations can eventually make an inverse estimate worse.
From first principles
Derive a matrix-free correction and its singular-mode filter
For measured data \(b\), minimize \(\tfrac12\|Ax-b\|_2^2\). Its negative gradient is \(A^T(b-Ax)\), so a step of fixed length \(\omega\) requires just one forward and one transpose application. Starting from zero gives the Landweber iteration,
For a singular pair \(Av_j=\sigma_j u_j\) with \(\sigma_j>0\), project onto \(v_j\). Each coefficient then follows a scalar geometric recurrence. Summing it gives
Choosing \(0<\omega\le1/\|A\|_2^2\) makes every bracket grow monotonically from zero toward one. Strongly sensed components appear early. Weakly sensed components require many steps, and their final coefficient can greatly amplify noise. This separation of timescales explains why a finite stopping iteration can regularize a noisy reconstruction.
Derivation and applications
Bound the noise admitted by a finite iteration count
Suppose the data are corrupted by an unknown vector \(e\) with \(\|e\|_2\le\delta\). Compare two Landweber runs starting at zero, one with exact data and one with noisy data, with fixed \(0<\omega\le1/\|A\|_2^2\). Orthogonality of the singular vectors makes the worst possible data amplification at iteration \(k\ge1\) the largest singular-mode gain
Put \(t=\omega\sigma^2\in[0,1]\). The numerator lies below one and also below \(kt\), since the sum \(1+(1-t)+\cdots+(1-t)^{k-1}\) contains \(k\) terms each at most one. These two estimates control opposite ends of the spectrum,
The largest value of this upper envelope occurs where its increasing and decreasing branches meet. At \(\sigma=1/\sqrt{k\omega}\), both equal \(\sqrt{k\omega}\). The noise passed to the reconstruction is therefore bounded by
If that crossover is outside the actual singular spectrum, the bound can be conservative. This estimate describes noise only: the bias remaining after an early stop depends on the true solution’s distribution among singular directions. A useful stopping rule considers both effects and the quantity being reported.
Worked example
Budget the iterations allowed by a noise target
In scaled coordinates let \(\delta=0.010,\ \omega=0.25\), and require the noise-induced solution change to be at most \(0.050\). The envelope guarantees this up to \(k=(0.050/0.010)^2/0.25=100\). At 25 steps the guarantee is \(0.025\); quadrupling the count doubles the guaranteed noise allowance.
Second application
Compare the envelope to an actual weak mode
For another run take \(\omega=1,\ k=10,\ \sigma=0.10\). The exact gain is \([1-0.99^{10}]/0.10=0.956\), smaller than the spectrum-independent bound \(\sqrt{10}=3.16\). A perturbation of \(0.020\) entirely along this data mode produces error \(0.0191\) after ten steps. A fully inverted fit would amplify the same perturbation to \(0.200\).
Multiply by the operator without storing its matrix
For large imaging systems a forward projection \(Bx\) and its adjoint \(B^\mathsf{T}r\) may be available as procedures while a matrix with one column per pixel is too large to store. Landweber iteration starts from zero and uses the least-squares gradient:
An implementation requires both procedures to be adjoints in the same inner products. Check \(\langle Bv,w\rangle=\langle v,B^\mathsf{T}w\rangle\) on a variety of inputs; quadrature weights in a discretised integral can change the correct transpose. For the Euclidean norm choose \(0<\omega<2/\sigma_{\max}^2\) to ensure contraction in every nonzero singular direction. Choosing \(\omega\le1/\sigma_{\max}^2\) additionally avoids alternating scalar transients in these directions.
Derive the filter after a finite number of steps
Let \(z_{j,k}=v_j^\mathsf{T}x_k\), \(\beta_j=u_j^\mathsf{T}b\). The recurrence becomes
Summing its geometric series at \(x_0=0\) gives
Components with large singular values reach their least-squares values quickly. Small-singular-value components remain suppressed for many iterations because \(1-(1-\omega\sigma_j^2)^k\simeq k\omega\sigma_j^2\) while \(k\omega\sigma_j^2\) is small. Stopping early is therefore a choice of spectral filter. Changing the initial guess affects the pattern retained in weak or null directions; with initial zero the iteration never invents a null-space component.
Regularise with an artificial evolution time
There are two clocks in a time-dependent inverse experiment. One describes the physical process being measured. A second, entirely artificial clock can limit how far we move towards a data fit. For a fixed real matrix \(A\) and fixed observed data \(b\), evolve the negative least-squares gradient from zero,
The data misfit \(F=\|Ax-b\|_2^2/2\) satisfies
Monotone improvement of the fit alone does not establish improvement of the reconstruction. In singular coordinates \(b_j=u_j^Tb\), each positive singular value gives the scalar equation \(\dot x_j+\sigma_j^2 x_j=\sigma_j b_j\). Multiplying by \(e^{\sigma_j^2t}\) and integrating from zero gives
A null component remains zero. A mode reaches half of its unregularised amplitude at \(t=(\log2)/\sigma_j^2\). At a fixed finite \(t\), weak modes have small noise gain approximately \(t\sigma_j\). At very long times the gain tends to \(1/\sigma_j\). This is asymptotic regularisation, with stopping time acting as a spectral filter. As the noise bound decreases one can allow longer runs, subject to continued noise control. A single fixed noisy measurement offers no justification for sending \(t\) to infinity.
Two modes fitted on different clocks
Let \(A=\operatorname{diag}(1,1/4)\) and \(b=(1,0.04)^T\). At \(t=16\log2\), the weak exponential is exactly \(1/2\) while the strong exponential is \(2^{-16}\). The reconstruction is \((1-2^{-16},\,0.08)^T\). The fully inverted weak datum would give \(0.16\). The strong measurement is fitted to within \(2^{-16}\approx0.0000153\) in amplitude while half the weak amplitude is still suppressed. If some of the \(0.04\) is noise, the same factor suppresses that contribution.
Forward Euler with step \(h\) in this artificial time recovers the Landweber iteration. It replaces each remaining exponential by \((1-h\sigma_j^2)^k\). To make every positive mode decay we need \(0<h<2/\sigma_{\max}^2\). An explicit step beyond this limit can diverge even though the original evolution dissipates misfit. Comparing stopping iterations therefore requires reporting \(h\) as well as \(k\).
Practise on sheet 5 · When explicit reconstruction has its own stability limit. Further reading · University of Cambridge · Inverse Problems, Mathematical Tripos Part III · §3.2.5 Asymptotic regularisation and §3.2.6 Landweber iteration, pp. 39–40.
See semiconvergence in a two-mode experiment
Let \(B=\operatorname{diag}(1,0.1)\), true \(x=(1,0)\) and observed \(b=(1,0.02)\). Set \(\omega=1\). After one step the estimate is \((1,0.002)\), very close to truth, and the first mode is already exact. After 100 steps the second coordinate is
At convergence it is 0.2. The residual shrinks steadily toward zero while the actual reconstruction has deteriorated after the first step. With a genuinely nonzero second component the error curve may initially improve for longer. Which iteration is best depends on the unknown signal and noise, so a solver's normal residual criterion is not a suitable scientific stopping rule by itself.
Select an observable stopping test
When a data error bound is known, stop the first time the residual falls below a noise-compatible level. With independent validation measurements monitor their predictive error across iterations. A fast Krylov method can bring useful modes in much sooner but may also reach noise-dominated directions sooner. Compare algorithms by scientific accuracy and forward/adjoint applications at a defensible stopping point. If a prior-weighted variable or preconditioner changes how quickly individual modes enter, the early-stopped result changes as well. Record that choice alongside the step size, starting state and stopping rule so the reconstruction can be interpreted.
Read the polynomials selected by a Krylov inverse
Landweber iteration applies a predetermined residual polynomial once the step size and count are chosen. Conjugate gradients on the normal equations instead choose each update from a growing search space using the actual data. With \(x_0=0\), write \(g=B^Tb\) and \(C=B^TB\). The first Krylov approximation is \(x_1=\alpha g\). Minimising \(\|b-\alpha Bg\|^2\) gives \(\alpha=(Bg)^Tb/\|Bg\|^2=\|g\|^2/\|Bg\|^2\) when \(g\ne0\). The first step is thus a data-dependent scaling of the backprojected measurements. It uses only products by the forward operator and its transpose.
At iteration \(k\), the corrections lie in the span of \(g,Cg,\ldots,C^{k-1}g\). In singular coordinates the solution coefficient is a polynomial in \(\sigma_j^2\) times \(\sigma_j b_j\). In exact arithmetic, once the span contains every excited singular direction the least-squares fit is exact in the measured range. Faster convergence of the data residual is valuable for well-determined components. It can also admit a noise-dominated direction much more abruptly than an investigator expects from watching just the residual.
See the second iteration introduce a spurious peak
Let \(B=\operatorname{diag}(1,0.05)\), true state \((2,0)^T\), and observed \(b=(2,0.10)^T\). The second reading is entirely noise in this constructed test. Then \(g=(2,0.005)^T\) and \(Bg=(2,0.00025)^T\). The optimal scalar is \((4+0.000025)/(4+0.0000000625)\approx1.00000623\). The first state is approximately \((2.0000125,0.00500003)^T\), closely matching the known truth. Its predicted second reading is only about 0.000250, and the total residual is consequently just below 0.10. A discrepancy threshold of 0.11 would accept this result.
Both nonzero singular directions are excited by the data. The second Krylov space is the whole plane because \(g\) and \(Cg=(2,0.0000125)^T\) are independent. Its minimiser is therefore the exact inverse state \((2,2)^T\), with zero data residual. The second true coordinate is zero, so this last step increases the state error from about 0.005 to two. The improvement in the objective is an improvement in fitting the particular noise draw. It has supplied no additional physical information about a weakly measured component.
For a real experiment the true state is unavailable, so a plot of state error cannot choose the iteration. Use measured uncertainty, predicted quantities on held-out readings or credible prior constraints to decide about stopping. If independent repeats show the same signed second reading with uncertainty far below 0.10, the case for treating it as pure noise would weaken. A stopping threshold calibrated for the present example should then change with the measurement evidence.
The data-based early step also changes under a rescaling of the parameter coordinates. A different scaling changes the shape of the first search space after backprojection, although the final unregularised solution expressed in the original coordinates remains the same. For that reason the iteration number by itself does not fully specify an iterative regulariser. Record the scaling, preconditioner and starting estimate as part of the reconstruction.
Observe semiconvergence before the residual is exhausted
Run unit-step Landweber iteration from zero on a diagonal operator with singular values 1, 0.35 and 0.07. The true modes are (1, 0.3, 0); add measurement errors (0, 0.001, 0.02). Track both norms using the known synthetic truth.

Read values from the plot
| Landweber updates | Reconstruction error | Data residual |
|---|---|---|
| 0 | 1.044 | 1.0058 |
| 38 | 0.048655 | 0.016611 |
| 75 | 0.088092 | 0.013837 |
| 112 | 0.12093 | 0.011537 |
| 150 | 0.14899 | 0.0095728 |
Change parameters · Observe semiconvergence before the residual is exhausted
Change one input at a time and compare the recalculated curves with the argument above. The browser evaluates this small model locally; the accompanying numerical values state its assumptions and reference checks. Reset restores the reference inputs, and the data can be downloaded as CSV.
Study the full derivation
Recovering sparse coefficients without hiding amplitude bias · Inferring parameters and fields from observations
A sensor records a linear mixture of a few active components. Derive the soft-threshold map, use it in an iterative reconstruction and decide when correlated response columns make an apparently sharp sparse answer ambiguous.
Problem sheet 5 · Derivatives and early stopping
Check a forward solver gradient independently, then decide when its iterative inverse has started fitting noise.
1. Differentiate through a scalar equilibrium
A steady sensor reads \(u\) satisfying \(pu=2\). The normalised measured value is 0.8 and \(J=(u-0.8)^2/2\). (a) At \(p=2\), compute the adjoint, gradient and direct derivative. (b) What sign would a one-step gradient descent change have? (c) Does that sign make physical sense?
Check the sign against the forward response
The state is 1, residual 0.2. The adjoint equation \(p\lambda=0.2\) gives 0.1. With no forcing derivative the gradient is \(-\lambda u=-0.1\). Directly \(du/dp=-2/p^2=-0.5\), yielding the same gradient. A descent step increases \(p\); increasing \(p\) lowers the model output toward the observation.
Explore the related calculation with adjustable inputs. Inspect the Taylor remainder with the correct and wrong-sign adjoint. The explorer uses a two-state equilibrium; apply the stated scalar or nonsymmetric operator to obtain this exercise’s exact gradient.
2. A directional derivative check
At \(p=1\) for \(J(p)=p^3\), choose direction \(v=2\). (a) Derive the Taylor remainder after subtracting the predicted linear term. (b) Evaluate it for \(h=0.10\) and 0.05. (c) Predict what halving \(h\) would do if the component gradient 3 were accidentally coded as 2.
Examine the order of the diagnostic
The exact directional slope is \(3v=6\). Expanding \((1+2h)^3\) leaves \(12h^2+8h^3\) after subtracting 1 and \(6h\). The remainders are 0.128 and 0.031, close to a factor of four apart. With incorrect slope 4 the error becomes \(2h+12h^2+8h^3\). At small enough \(h\) it will fall by about a factor of two instead, until numerical noise intervenes.
Explore the related calculation with adjustable inputs. Change the parameters in the corresponding calculation and compare its independently recomputed values with the equation derived in this solution.
3. Stop before the weakest direction is inverted
Use \(B=\operatorname{diag}(1,0.2),\ b=(1,0.1),\ x_0=0,\ \omega=1\). (a) Derive the second coordinate and residual after \(k\ge1\) iterations. (b) Find the first iteration whose residual norm is at most 0.09. (c) Compare the result there with the converged second coordinate and explain when early stopping helps.
Solve the scalar recurrence
The first coordinate reaches 1 in one step. The second tends to 0.5 as \(x_{2,k}=0.5(1-0.96^k)\). Thus \(\|r_k\|=0.1(0.96)^k\), and crossing 0.09 requires \(k\ge\ln(0.9)/\ln(0.96)=2.58\), or three updates. The early estimate is 0.0576 while the converged one is 0.5. If most of the observed weak-mode coefficient is noise the early estimate is protective; if it mostly represents signal the same stopping rule underestimates it.
Explore the related calculation with adjustable inputs. Vary noise and iteration count to distinguish a decreasing training residual from a worsening reconstruction. CGLS in the explorer and the exercise’s Landweber recurrence have different polynomial filters.
When explicit reconstruction has its own stability limit
Let \(A=\operatorname{diag}(2,1/2)\). Explain why the continuous residual decays in both modes but a Landweber step \(h=0.6\) can fail. Repeat with \(h=1/4\). Find when the weak component has first acquired at least half its unregularised amplitude, and compare with the continuous half-time.
Worked solution
The continuous residual factors are \(e^{-4t}\) and \(e^{-t/4}\). At \(h=0.6\) the strong discrete factor is
Any excited strong residual changes sign and grows. The step exceeds the upper bound \(2/4=0.5\).
At \(h=1/4\) the strong factor is zero, and the weak factor is
Solve \((15/16)^k\le1/2\): the real threshold is \(10.7401\), hence the first integer is \(11\). Its artificial time is \(11/4=2.75\). The continuous half-time is \(4\log2=2.7726\). The small difference reflects the exponential approximation and inspection at discrete steps.
Explore the related calculation with adjustable inputs. Vary noise and iteration count to distinguish a decreasing training residual from a worsening reconstruction. CGLS in the explorer and the exercise’s Landweber recurrence have different polynomial filters.
Revisit chapter 10 · Regularise with an artificial evolution time.
Notebook practice · Does the gradient see where the instruments were actually placed?
Chapter 11 · Constraints, sparse signals and edge-preserving penalties
Derive a solution at a bound, a soft-threshold rule and the behaviour of a total-variation penalty at a material interface.
From first principles
Derive thresholding from an absolute-value penalty
A coefficient that can physically vanish can be estimated by balancing squared measurement mismatch against a penalty on its absolute magnitude. For a scalar reading \(y\), consider \(F(x)=\tfrac12(x-y)^2+\lambda|x|\) with \(\lambda\ge0\). On either open half-line the derivative is ordinary, giving candidates
When neither candidate has the assumed sign, the kink at zero must be checked. The left derivative at zero is \(-y-\lambda\) and the right derivative is \(-y+\lambda\). A convex minimum occurs there if these enclose zero, namely if \(|y|\le\lambda\). Combining the cases gives
The shrinkage creates exact zeros and biases surviving amplitudes toward zero. Applying a similar penalty to differences between adjacent field values instead of to the field itself favours neighbouring sites that share one value while permitting isolated jumps.
Derivation and applications
Shrink a two-dimensional gradient while preserving its direction
At an image pixel or a mesh cell the inferred gradient can have two measured components. If the physical surface has no preferred coordinate axes, a rotationally invariant local penalty is proportional to the Euclidean length of the gradient vector. Consider the local optimization with equally scaled and equally precise components,
For a fixed trial length \(r=\|g\|\), the data mismatch is minimized by making \(g\) parallel to \(y\), since this maximizes their dot product. For \(y\ne0\) write \(g=r y/\|y\|\). The remaining one-dimensional constrained problem is
Thus both gradient components are attenuated by a common factor; if \(y=0\), the solution is zero directly. The componentwise absolute-value penalty gives a different rule,
The first expression is for \(y\ne0\). A local gradient shrinkage step is used inside some total-variation algorithms, but arbitrary independently shrunk gradient vectors need not be differences of one global image. A full reconstruction must enforce consistency with the field and the measurement equations. Different component units or uncertainties likewise require a corresponding metric.
Worked example
Compare an inclined edge under two penalties
For measured gradient \(y=(3,4)\) and \(\lambda=2\), the isotropic solution has length \(5-2=3\) and vector \((1.8,2.4)\); its angle is unchanged. Applying componentwise shrinkage gives \((1,2)\) with angle \(63.4^\circ\), compared with the measured \(53.1^\circ\). The choice of penalty can therefore affect an estimated orientation.
Second application
Test whether a detection threshold depends on the grid axes
A second gradient has length \(1.2\) with \(\lambda=1\). Along an axis, both rules return length \(0.2\). Rotating it by \(45^\circ\) gives coordinates \((0.849,0.849)\). The isotropic rule still returns length \(0.2\), whereas componentwise thresholding returns zero because neither coordinate reaches one. An orientation-dependent disappearance can therefore be introduced by the estimator itself.
Physical constraints change the optimality test
An attenuation coefficient cannot be negative. In a convex inversion with lower bound zero, the unconstrained least-squares normal equations need not hold at a valid constrained solution. Consider minimising a differentiable \(F(x)\) with \(x_j\ge0\). At a free component the derivative must be zero. At a zero component only positive feasible perturbations exist, so the derivative must be nonnegative. Negative reconstructed cells cannot generally be repaired by clipping after inversion because the forward operator couples neighbouring parameters.
For example minimise \(\tfrac12[(x_1+x_2-1)^2+(x_1+1)^2]\) under \(x_i\ge0\). The unconstrained solution is \((-1,2)\). Clipping gives \((0,2)\), which overpredicts the first observation. On the active face \(x_1=0\), the minimising \(x_2\) is 1. At \((0,1)\) the gradient is \((1,0)\) and the bound conditions hold. The price of feasibility appears in the data residual; it is important to show which observations the constrained model cannot fit.
Derive the soft-threshold rule
For a scalar coefficient with observation \(b\), minimise \(\tfrac12(x-b)^2+\lambda|x|\). On \(x>0\) the stationary point is \(b-\lambda\), feasible there only when \(b>\lambda\); on \(x<0\) it is \(b+\lambda\). At zero, the admissible slopes of the absolute value range from \(-1\) to 1, so zero solves the condition when \(|b|\le\lambda\). Together these give
Even retained coefficients shrink by \(\lambda\), a real amplitude bias. With \(b=(-0.2,0.7,2.4)\) and \(\lambda=0.5\), the estimate is \((0,0.2,1.9)\) for an identity forward map.
Penalise changes in a field
In one dimension discrete total variation is \(\sum_j|x_{j+1}-x_j|\). A single large jump and several monotone small steps spanning the same overall change have equal total variation. In contrast a squared difference penalty favours spreading the jump over several sites. That explains why total variation can preserve an abrupt edge when the data localise it. It can also create nearly constant plateaus in a field that really changes smoothly.
For two observed values \(b_1,b_2\), use the variables \(m=(x_1+x_2)/2,\ d=(x_2-x_1)/2\). With objective \(\tfrac12\sum(x_i-b_i)^2+\lambda|x_2-x_1|\), the optimal mean is the observed mean and half-difference is the soft-thresholded observed half-difference with threshold \(\lambda\). When \(|b_2-b_1|\le2\lambda\) the two estimated levels fuse. This concrete loss of resolution should be reported when interpreting a uniform patch in a reconstructed image.
Make an edge claim testable
Generate test fields both with a sharp jump and with a smooth ramp. Pass them through the same sensor model and noise level, then fit with the same strength-selection procedure used for real data. Measure contrast bias and edge-location error separately; an image can put an edge in the correct place but suppress its amplitude. For a nonnegative material field inspect the gradient at active zeros alongside the residual. The regulariser and the bounds each supply information that the instrument may not have measured.
Follow total variation through three coupled cells
Consider three ordered cell values observed directly with equal independent precision. Minimise \(\tfrac12\sum_i(x_i-b_i)^2+\lambda(|x_2-x_1|+|x_3-x_2|)\). Introduce edge variables \(s_1,s_2\) equal to the signs of nonzero differences. At a zero difference either variable may take any value between minus one and one. Differentiation with these admissible subgradients gives the three balances \(x_1-b_1-\lambda s_1=0,\ x_2-b_2+\lambda(s_1-s_2)=0,\ x_3-b_3+\lambda s_2=0\). A candidate solution must satisfy all three balances and must agree with the sign choices that produced it.
Adding the balances eliminates both internal edge forces. Consequently the reconstructed values have exactly the same sum as the observations, regardless of the penalty strength. The quadratic part is strictly convex, so any feasible sign assignment satisfying the balances proves that the state is the unique minimiser. Adding lower bounds can introduce reactions and break the sum identity. Unequal precision also changes which weighted average is conserved. The calculation depends on the observation operator being the identity; after blurring, the first derivative of the data term already couples all cells.
Derive the complete fusion path for a short profile
Take \(b=(0,1,5)^T\). For small positive \(\lambda\), both differences remain positive, so
The equations give
The first two coordinates meet at \(\lambda=1\), while the second and third are still unequal. Assume those first two now form a plateau of height \(a\), with \(s_2=1\). Adding their balances gives \(2a-1-\lambda=0\), hence \(a=(1+\lambda)/2\). The first equation then requires
which lies in the permitted interval exactly when \(\lambda\ge1\).
The third coordinate stays \(5-\lambda\). Equating it to the plateau gives \((1+\lambda)/2=5-\lambda\), or \(\lambda=3\). Beyond this value all three cells coincide, and sum conservation fixes them at two. The required subgradients are \(s_1=2/\lambda\) and \(s_2=3/\lambda\), both admissible for \(\lambda\ge3\). This completes the path without numerical optimisation. At strengths 0.5, 2 and 4 the respective profiles are \((0.5,1,4.5)\), \((1.5,1.5,3)\) and \((2,2,2)\).
The thresholds record when the data imbalance inside a proposed plateau can be supported by the admissible edge subgradients. A flat patch at the second strength is therefore compatible with unequal raw values of zero and one. Conversely, a visible third-cell edge at that strength has already lost much of its amplitude. A reconstruction report that uses one threshold for declaring the existence of a jump and another for estimating its amplitude should explain both decisions.
Checking the final all-fused solution using only its observed mean would miss the second edge constraint. For example at strength two that constant candidate would require \(s_2=1.5\), outside the admissible unit interval, despite reproducing total mass perfectly. The failed local balance tells which boundary of the candidate plateau has to reopen. This provides a simple hand diagnostic for more complicated one-dimensional reconstructions when an apparently reasonable flat interval has been proposed.
Choose how weak coefficients enter a reconstruction
For unit forward gain, minimise half squared data error plus either \(0.5|x|\) or \(0.5x^2/2\). Solve the derivative equation away from zero and use the subgradient at zero for the absolute-value penalty. Here the plotted input is the measured datum.

Read values from the plot
| Measured scalar coefficient | Unpenalised | Soft threshold λ = 0.5 | Quadratic penalty λ² = 0.5 |
|---|---|---|---|
| −2.2 | −2.2 | −1.7 | −1.4667 |
| −1.1 | −1.1 | −0.6 | −0.73333 |
| 0 | 0 | 0 | 0 |
| 1.1 | 1.1 | 0.6 | 0.73333 |
| 2.2 | 2.2 | 1.7 | 1.4667 |
Change parameters · Choose how weak coefficients enter a reconstruction
Change one input at a time and compare the recalculated curves with the argument above. The browser evaluates this small model locally; the accompanying numerical values state its assumptions and reference checks. Reset restores the reference inputs, and the data can be downloaded as CSV.
Study the full derivation
Recovering sparse coefficients without hiding amplitude bias · Inferring parameters and fields from observations
A sensor records a linear mixture of a few active components. Derive the soft-threshold map, use it in an iterative reconstruction and decide when correlated response columns make an apparently sharp sparse answer ambiguous.
Chapter 12 · A reconstruction audit from observations to a defensible claim
Combine residuals, resolution, uncertainty and independent predictions to decide what one spatial experiment establishes.
From first principles
Audit a recovered contrast in measurement units
Suppose two equally calibrated channels sense neighbouring state values with symmetric cross-talk \(0\le a<1/2\). Their noiseless observations are \(y_1=(1-a)x_1+ax_2\) and \(y_2=ax_1+(1-a)x_2\). Subtracting removes the common level and reveals how strongly the desired contrast \(d=x_1-x_2\) appears in the readings,
Independent zero-mean channel noise of common standard deviation \(s\) gives difference variance \(2s^2\). Inverting only this observable therefore yields the data-based estimate and uncertainty
The noise is amplified as the channels approach identical response. A useful resolution audit reports the measured difference, the calibrated contrast gain and the relevant uncertainty sources. If the gain itself is uncertain or channel noise is correlated, those effects must enter the audit before a physical contrast is claimed.
Background · Resolution matrix
For a linear regularised inverse, a row describes how the estimated parameter mixes the actual components. A sharp-looking result may still have broad resolution kernels.
Derivation and applications
Quantify signal leakage into an estimate of a local field
A reconstructed pixel is often a weighted average of several true cells. A resolution audit can predict that mixing and bound its effect using independent knowledge of admissible field gradients. Consider a linear model \(y=Ax+\epsilon\) with zero-mean measurement error of covariance \(\Sigma\), and a chosen linear estimator for the target cell \(j\), \(\widehat x_j=w^Ty\). Define its resolution weights by the response to unit signals in individual true cells,
To reproduce a uniform field exactly, require \(\sum_i k_i=1\). The bias relative to the target is then a sum of differences from that cell. Suppose independently supported spatial smoothness gives
where \(d_{ij}\) is cell distance. Taking absolute values yields
This weighted distance has units of length even when resolution weights have negative lobes. If Gaussian measurement noise is justified, a conservative two-sided interval with at least the usual 95 percent coverage for the true cell is
The bias bound is added to the statistical margin because it represents an unknown fixed error, not an independent random draw. The guarantee depends on the supplied smoothness information and calibrated forward model. At a genuine sharp interface the assumed gradient bound may be inappropriate.
Worked example
Audit a local mean on a uniform grid
Three true cell centres lie \(0.5\,\mathrm m\) apart. An estimator of the middle temperature has weights \((0.2,0.6,0.2)\), output noise deviation \(0.10\,\mathrm K\) and independently verified gradient bound \(2.0\,\mathrm{K/m}\). Its effective weighted distance is \(0.20\,\mathrm m\) and maximal mixing bias is \(0.40\,\mathrm K\). An estimate of \(18.0\,^\circ\mathrm C\) has interval half-width \(0.40+1.96(0.10)=0.596\,\mathrm K\).
Second application
Compare a sharper reconstruction at a noisy boundary
An alternative three-cell estimator has weights \((-0.1,1.2,-0.1)\) at distances \(1,0,1\,\mathrm m\). For \(L=0.50\,\mathrm{K/m}\) its bias bound is \(0.10\,\mathrm K\). With noise deviation \(0.30\,\mathrm K\), the total half-width is \(0.688\,\mathrm K\). A smoother estimator of the same target with weighted distance \(0.50\,\mathrm m\) and noise deviation \(0.12\,\mathrm K\) gives
The sharper-looking estimator yields the wider interval for this stated field class.
Set a question that can fail
Two adjacent thermal zones are blurred by the sensor matrix \(A=\left(\begin{smallmatrix}0.55&0.45\\0.45&0.55\end{smallmatrix}\right)\). Let the observations be \(y=(21.08,20.92)\) °C with independent standard deviations 0.10 K. The engineering question is whether the first zone is at least one kelvin hotter than the second. Work in mean and difference coordinates. The mean passes unchanged, while the difference is attenuated by 0.10. Before fitting, predict that uncertainty in the contrast will dominate this decision.
Derive the data-only estimate and interval
The observed mean is 21 °C, with standard deviation \(0.10/\sqrt2=0.0707\) K. The estimated true contrast is
Its standard deviation is
For known Gaussian noise, a two-sided 95% data-only interval is about \([-1.17,4.37]\) K. The inverse values \((21.8,20.2)\) exactly reproduce both readings. Nevertheless, even the sign of the contrast is uncertain at this level. The exact residual consumed both degrees of freedom and cannot test the instrument model.
Compare a prior-based inference on the same scale
Assume an independent prior for the contrast \(d\sim N(0,1\ \mathrm{K}^2)\), leaving the mean very weakly constrained. In contrast coordinates the data variance is 2 and the observed estimate is 1.60. Adding precisions gives posterior variance \(1/(1+1/2)=2/3\) K² and mean \((2/3)(1.60/2)=0.533\) K. The probability \(P(d>1\mid y)\) is \(1-\Phi[(1-0.533)/\sqrt{2/3}]\simeq0.28\). The prior changed both the centre and the width; this probability is explicitly conditional on the zero-centred prior. Repeating with a wider prior shows how much the conclusion depends on that assumption.
Buy information in the direction the decision needs
Suppose one additional test is available. Another independent repeat with the same blurred sensor reduces the data-only standard deviation of the contrast by \(\sqrt2\), to 1.0 K. A new differential sensor reading \(d+\epsilon\) with standard deviation 0.50 K and errors independent of the original instrument directly adds precision 4 K⁻² to the existing 0.5 K⁻², giving combined standard deviation \(1/\sqrt{4.5}=0.471\) K. This pre-data comparison depends on geometry and precision alone, not on an unknown future reading. Use held-back calibration objects to verify that the new sensor's stated precision and averaging model hold near an actual interface.
Communicate the final claim
Retain the observable mean and the uncertain contrast as separate reported quantities. State the noise law and model assumptions behind any interval. Where a numerical solver contributed, distinguish verified numerical precision from the statistical precision of the data. The difference is also visible in the temperature-design case: making the optimisation converge more tightly cannot restore information lost when all temperatures are close to the reference. A successful analysis may conclude that a particular observation needs redesign while still supplying an accurate prediction of another quantity.
Propagate a spatially varying calibration error
The preceding contrast calculation assumes a known blur and unbiased independent channel errors. Add two possible calibration terms: an offset \(b\) shared by both readings and a differential offset \(c\) that enters the first reading as \(+c/2\) and the second as \(-c/2\). The measurement equations then give mean reading equal to the true mean plus \(b\) and mean random error. Their difference is \(0.10d+c+e_1-e_2\). A shared offset cancels exactly from the contrast, whereas a differential offset is amplified tenfold when the contrast is reconstructed.
If the differential offset has an independently calibrated mean zero and known standard deviation \(s_c\), variance propagation gives \(\operatorname{Var}(\hat d)=(2s_e^2+s_c^2)/0.10^2\) for equal individual standard deviations \(s_e\). Treating the offset as random is appropriate for an ensemble of independently calibrated experiments with the stated calibration model. Within one installation it is a common unknown across all repeated exposures. If only a deterministic bound on \(c\) is justified, its effect is better reported as a bounded systematic displacement in addition to random sampling uncertainty.
Test the decision after averaging a hundred exposures
Suppose the original pair is observed one hundred independent times with the same differential calibration. The observed average difference remains 0.16 K, individual channel noise is 0.10 K per exposure, and calibration tests support \(|c|\le0.04\) K. The standard deviation of the averaged difference from independent channel noise alone is
In physical contrast units the random standard deviation is 0.1414 K. The possible systematic error is \(0.04/0.10=0.40\) K in either direction, undiminished by the additional exposures.
A conservative one-sided 95 percent lower limit under Gaussian independent channel noise subtracts both the worst allowed positive offset and the sampling margin. In contrast units it gives \(1.60-0.40-1.645(0.1414)\approx0.967\) K. Even with one hundred exposures this calculation falls slightly below the one-kelvin engineering threshold. Omitting the differential offset would give a lower limit about 1.367 K and reverse the decision. The discrepancy originates in the calibration model, although all raw measurements and all random-noise calculations are unchanged.
What new evidence would change the result? A reference specimen known to have zero contrast estimates \(c\) directly through the observed channel difference. If calibration tightens the guaranteed bound to 0.01 K, the same calculation gives \(1.60-0.10-0.233\approx1.267\) K. If the reference itself has uncertain contrast, propagate that uncertainty through its own blur factor before claiming the tighter bound. This comparison assigns the new measurement a clear purpose: it reduces the component of uncertainty aligned with the decision, rather than collecting more observations of a systematic offset that cancels in neither channel difference nor repeated averages.
An orientation-reversal test can also distinguish true contrast from a fixed differential channel offset. Reversing a specimen of equal geometry reverses the sign of its true contrast but preserves the channel offset. Half the difference of the two measured contrasts then isolates the blurred physical contrast, provided the specimen is stable and both orientations sample comparable regions.
Design the reversal and propagate its uncertainty
Write the normal and reversed orientation mean differences as \(D_+=0.10d+c+\epsilon_+\) and \(D_-=-0.10d+c+\epsilon_-\). Solving for the two unknowns gives
The independent information comes from changing the sign of the physical response while keeping the offset fixed. Repeating the normal orientation alone produces another row proportional to the first and cannot separate the two quantities, however many times it is repeated.
Suppose each orientation is averaged over 100 exposures with the same independent channel noise as before. The standard deviation of either orientation difference is 0.01414 K. If the two averages have independent random errors, then \(\operatorname{sd}(\hat d)=\sqrt{2}(0.01414)/0.20=0.10\) K and \(\operatorname{sd}(\hat c)=0.010\) K. With readings 0.18 K and −0.14 K, one obtains \(d=1.60\) K and \(c=0.02\) K as estimates. The one-sided lower contrast limit is \(1.60-1.645(0.10)\approx1.435\) K. Unlike the earlier bounded-offset calculation, this inference estimates the shared differential offset from the design itself.
If the specimen cools differently between orientations, or rotating it changes the sensor footprint, the two signs might no longer describe equivalent regions. A reversal carried out in alternating order across independent blocks can expose drift. Check the recovered offsets for consistency across these blocks before claiming that orientation has separated the physical contrast from an instrument artifact.
Change parameters · Explore the worked calculation
Change one input at a time and compare the recalculated curves with the argument above. The browser evaluates this small model locally; the accompanying numerical values state its assumptions and reference checks. Reset restores the reference inputs, and the data can be downloaded as CSV.
Problem sheet 6 · Edges, decision thresholds and validation
Determine whether an apparent feature survives a change of penalty, a noise calculation and an independent test.
1. Fusing two adjacent estimates
Take identity observations \(b=(1,2.2)\). Minimise \(\frac12\sum(x_i-b_i)^2+\lambda|x_2-x_1|\). (a) Compute both fitted values for \(\lambda=0.2\) and 0.7. (b) Identify the fusion threshold. (c) Does observing a flat fit establish equal true values?
Retain the mean and shrink the half-difference
The observed mean is 1.6 and half-difference 0.6. At \(\lambda=0.2\), the fitted half-difference is 0.4 and the fit is \((1.2,2.0)\). At 0.7 it is zero, giving \((1.6,1.6)\). Fusion starts at \(\lambda=0.6\). A flat solution can be induced by the penalty; report the relevant contrast, noise and sensitivity to penalty strength before making a physical equality claim.
Explore the related calculation with adjustable inputs. Inspect soft-thresholding and quadratic shrinkage. For two-cell total variation, apply the threshold to the half-difference and retain the mean as derived here.
2. A blur and a threshold
A sensor attenuates a physical contrast by 0.20 and gives a measured difference 0.60 K with standard deviation 0.20 K. (a) Find the data-only estimated contrast and standard deviation. (b) Can a one-sided 95% lower limit establish that the contrast exceeds 2 K? Use the Gaussian multiplier 1.645. (c) Assuming independent repeats with identical mean, how many would make that lower limit exceed 2 K?
Propagate the contrast scale only once
The estimate is 3 K with standard deviation 1 K. The lower limit \(3-1.645=1.355\) K is below 2 K. If the sample mean remains 3 K when expressed in physical units, require \(1.645/\sqrt N<1\), so three independent repeats suffice for that projected precision. Future means are random, hence this is a conditional planning calculation rather than a guaranteed outcome.
Explore the related calculation with adjustable inputs. Change the parameters in the corresponding calculation and compare its independently recomputed values with the equation derived in this solution.
3. Challenge a smooth reconstruction
A smoothed image fits all training readings within their stated noise and shows one broad transition. (a) Describe two distinct synthetic truths to use in a resolution audit. (b) Specify two numerical metrics and one measurement to hold out. (c) Explain how a code error, statistical uncertainty and regularisation bias would appear differently across the tests.
Use tests that can disagree with the interpretation
Choose a sharp step and a gradual ramp with similar large-scale contrast. Generate observations using a finer or independent forward discretisation, realistic noise and the actual sensor footprint. Record recovered edge location and recovered contrast or width. Reserve an independent measurement that is sensitive to the transition, ideally at a finer spatial scale. Failure on a noiseless manufactured case can expose an implementation mistake. Scatter across noise realisations quantifies sampling variation. A consistently broadened step across seeds at an otherwise verified discretisation indicates regularisation or finite sensor resolution; vary both separately to distinguish them.
Choose a sensor direction that resolves an unobservable combination
A prior for two parameters is Gaussian with zero mean and identity covariance. A first reading measures x₁+x₂ = 2.0 with noise standard deviation 0.1. Find the posterior mean and the variance along each normalised sum and difference direction. A second sensor of the same noise level can measure the sum again or the difference. Which design constrains both parameters, and why?
Worked solution
In the orthonormal directions s = (1,1)/√2 and d = (1,−1)/√2, the first measurement row is (√2,0). Its precision contribution has diagonal (200,0). Adding the unit prior precision gives posterior variances 1/201 and 1. Multiplying the precision-inverse by Aᵀb/0.01 gives a posterior mean with both components 200/201 ≈ 0.995.
Repeating the sum doubles the sum-direction information, giving variances 1/401 and 1. Measuring the difference instead adds information along d, giving 1/201 for both directions. The trace of the second covariance is about 0.00995, versus about 1.0025 for the repeated-sum design. The second measured value changes the posterior mean but, for this linear Gaussian model, not the covariance.
An objective concerned only with the sum would favour the repeated sensor. For reconstructing both parameters, sensitivity in independent directions matters. A very small residual for the original measurement is compatible with a whole line of plausible parameter pairs, which is why reporting only that residual would conceal the design difference.
Explore the related calculation with adjustable inputs. Change the parameters in the corresponding calculation and compare its independently recomputed values with the equation derived in this solution.
Chapter 13 · Choosing regularisation when the true answer is hidden
Derive two parameter choices from different information, then see how an excellent fit to sensor data can restore the noise in a weakly visible mode.
Each observation competes with a penalty
In orthogonal singular coordinates, let \(d_i=\sigma_i x_i+\eta_i\). For a candidate \(\lambda>0\), minimise \(\sum_i(\sigma_i x_i-d_i)^2+\lambda^2\sum_i x_i^2\). Setting each derivative to zero gives
Predicted data are \(H_i d_i\), where \(H_i=\sigma_i^2/(\sigma_i^2+\lambda^2)\). These factors range from zero to one. Their sum is the effective number of fitted data directions.
If an independently obtained bound for the whitened noise norm is \(\delta\), compare \(\sum_i[(1-H_i)d_i]^2\) with \(\delta^2\). The residual rises as \(\lambda\) increases. A discrepancy choice seeks the largest smoothing consistent with the stated noise level. If there is no crossing, either the search range, model or noise estimate needs examination.
A prediction criterion without a noise bound
For a linear smoother \(\widehat d=Hd\), deleting observation \(i\) gives the leave-one-out residual \(r_i/(1-H_{ii})\) under the usual fixed-design ridge fit. Generalised cross-validation replaces the individual leverages by their mean. This produces the computable quantity
The denominator penalises fits that spend nearly one degree of freedom per datum. The criterion estimates predictive performance under assumptions on noise and design. A selected value need not minimise the error in the unknown parameter, and highly unequal leverages can defeat the approximation.
A sensor that barely sees a mode
Take sensitivities \(1,0.01\), true parameters \((1,1)\) and data \((1,0.02)\). Unregularised inversion returns \((1,2)\) with zero residual. A perturbation of one hundredth in the second observation doubled the second parameter. With \(\lambda=0.01\) the second gain is \(\sigma/(\sigma^2+\lambda^2)=50\), so the same datum yields 1. This exact agreement with the hidden truth is accidental.
For \(\lambda=0.1\), the second estimate drops to about 0.0198. A weak direction has been almost removed. Meanwhile the first estimate remains about 0.9901. A single residual norm does not tell you which parameter direction was suppressed.
Inspect an entire regularisation path
Three synthetic sensors have sensitivities \(1,0.2,0.02\), true parameters all equal to one, and an adjustable perturbation only in the last sensor. This deliberately uneven noise makes it possible to test when the GCV assumptions are plausible. Inspect parameter error and data residual over a logarithmic range of \(\lambda\). The result reports the best GCV value on the sampled grid and the residual at that choice.
Tutorial on choosing a criterion
If all \(H_i\) equal a common \(h<1\), can GCV distinguish different values of \(h\) for fixed data?
Worked solution
The numerator contains \((1-h)^2\|d\|^2/n\) and the denominator \((1-h)^2\). They cancel exactly. There is no identifiable minimum from this score.
If residuals remain much larger than a well-calibrated noise norm even at negligible regularisation, should increasing the penalty help?
Worked solution
Increasing the penalty shrinks the fit and usually increases residual. Check the forward model, its range and data preparation, including the uncertainty units used in whitening.
Read the university treatment
Compare the information each stopping rule needs about measurement noise with the information available in the three-sensor experiment. Per Christian Hansen · Stopping rules for noisy data
Study the full derivation
Choose a regularisation scale by predicting omitted data · Inferring parameters and fields from observations
Regularised least squares can fit each observation partly with itself. Derive leave-one-out residuals from a single factorisation, approximate them by a trace and identify when a generalised cross-validation score misses a highly influential sensor.
Chapter 14 · Learning a drifting temperature from a sequence of readings
Derive the scalar Kalman update by completing the square and see how process uncertainty controls memory of the past.
Propagate a distribution through time
A drifting offset follows \(x_k=x_{k-1}+w_k\). A thermometer reports \(z_k=x_k+v_k\). Assume independent, zero-mean Gaussian process increments of variance \(Q\) and sensor noise of variance \(R\), independent at each time and of the initial state. Before the next reading, the mean stays at \(m^-=m_{k-1}\) and the variance adds, \(P^-=P_{k-1}+Q\).
The negative log posterior, up to constants, is \((x-m^-)^2/(2P^-)+(z_k-x)^2/(2R)\). Collect the coefficient of \(x^2\) and its linear term. The result can be written in two equivalent forms:
Thus the fraction of the innovation used is a model prediction. When sensors are noisy the gain falls. When the model permits rapid drift, uncertainty grows between readings, giving the new measurement a larger role. These are variances, so a stated standard deviation must be squared first.
A reading with units and a repeated reading
A prior says \(20.0\pm2.0\) °C (one standard deviation), with negligible intervening drift. A sensor of standard deviation 1 °C reads 23 °C. The gain is \(4/(4+1)=0.8\), giving \(22.4\) °C and variance \(0.8\) °C². A second independent reading of 23 °C gives gain \(0.8/1.8\) and mean \(22.6667\) °C. Treating a duplicate record as independent would falsely claim the same information gain.
In a long random walk with \(Q=0.25\) and \(R=1\) in squared units, a steady posterior variance satisfies
Rearrangement gives \(P^2+QP-QR=0\), so the physically positive root is about 0.3904. New uncertainty replenishes the information squeezed out by measurement.
Follow a change in the underlying temperature
For a reproducible illustration, a fixed synthetic thermometer trace contains a smooth periodic disturbance and a step in the hidden temperature. It is deliberately held fixed while the filter's assumed \(Q\) and \(R\) change. Compare the lag just after the step with the wiggle once the temperature settles.
Tutorial on noisy data over time
If \(Q=0\), show how \(n\) independent readings with the same variance affect precision.
Worked solution
Each update adds \(1/R\) to precision \(1/P\). Induction gives
This is precisely the precision of a batch Gaussian update.
What pattern in the innovations would call the random-walk assumptions into question?
Worked solution
A long run of positive innovations after a systematic ramp suggests bias in the prediction. Serial correlation suggests missing dynamics or correlated observation errors. Check against predicted innovation variance \(P^-+R\) and examine signs and lags as well as their sizes.
Read the university treatment
Extend the scalar precision update to several state variables and identify the matrix made invertible by a positive observation variance. Stephen Boyd · Stanford EE363, estimation and the Kalman filter
Study the full derivation
What each new sensor reading changes in a Gaussian inverse problem · Inferring parameters and fields from observations
Start with an uncertain vector, condition on one noisy linear observation, and reconstruct the posterior mean and covariance without repeating a batch inversion. Check shared calibration errors before treating repeated measurements as independent evidence.
Chapter 15 · When a single uncertainty interval hides two explanations
Start from a squared-amplitude measurement, derive the full posterior and design a second observation capable of identifying the sign.
Symmetry is an identifiability statement
A sensor measures \(d=x^2+\eta\) with Gaussian noise of standard deviation \(s\). A symmetric Gaussian prior of variance \(\tau^2\) puts equal weight on opposite signs. Bayes' rule gives the density
The exponent is even, so the posterior mean is exactly zero whenever the integral exists. That mean may make an extremely poor prediction of the observed quantity. To locate modes, differentiate the negative log density to get \(x[2(x^2-d)/s^2+1/\tau^2]\). Two off-centre modes appear precisely when \(d>s^2/(2\tau^2)\). At smaller \(d\), the prior and noise merge the explanations into one central mode.
Numbers and competing summaries
Set \(d=1\), \(s=0.2\), and \(\tau=2\). The modes are at \(\pm\sqrt{0.995}\), close to \(\pm0.9975\). The density ratio of \(x=0\) to \(x=1\) is \(\exp[-1/(2s^2)+1/(2\tau^2)]\), about \(4.2\times10^{-6}\). The reported mean of zero sits in a very low-density region.
For \(d=-0.05\), there is no real parameter that exactly fits the measured amplitude squared. A noisy sensor can still produce this value. The distribution has a single mode at zero, and there is no justification for taking the square root of the negative datum or discarding the observation.
Buy a measurement that identifies the sign
Assume an independent second sensor reports \(b=x+\epsilon\) with known standard deviation 0.5. Add \(-(b-x)^2/(2\cdot0.5^2)\) to the log density. The original two signs now receive different weights. Both curves in the plot are independently normalised by quadrature on the displayed interval; the sign probability is conditional on that interval. Compare the observation \(b=0\) with \(b=1\).
Tutorial on designing another experiment
Repeat the squared-amplitude measurement a hundred times with independent noise. What can become precise?
Worked solution
The magnitude \(x^2\) can become very precise. Every likelihood factor remains even in \(x\), so the sign probabilities stay equal with this prior. More data of the same kind cannot break that symmetry.
If the two candidate states were exactly \(x=\pm1\), what likelihood ratio does \(b=0.5\) give in favour of the positive state?
Worked solution
The exponent difference is
The likelihood ratio is \(e^4\), about 54.6. A continuous posterior also averages over the spread around each candidate.
Chapter 16 · How model error masquerades as a fitted physical parameter
Project an omitted spatial effect into the fitted parameter space. Work out when residual checks reveal the omission and when they are silent.
A misspecified instrument
Suppose \(d=A x_*+b+\eta\), with zero-mean measurement noise and a deterministic but omitted contribution \(b\). Assume \(A\) has independent columns. Least squares gives
Taking expectations leaves the parameter bias \(A^+b\). The fitted residual is \((I-AA^+)(b+\eta)\). Thus the same model error separates into a component that biases the parameters and an orthogonal component that remains visible to residual checks.
For a single sensitivity column \(a\), decompose \(b=b_\parallel+b_\perp\), where \(b_\parallel=a(a^Tb)/(a^Ta)\). Repeating the measurement reduces independent random error; the deterministic projection remains. Error bars computed solely from measurement variance can become more misleading as more readings are acquired.
Calibration with an omitted offset
Fit \(d_i=m t_i\) at \(t=(1,2,3)\) to observations actually generated by \(d_i=2t_i+0.3\). The unmodelled constant has nonzero projection onto \(t\). The bias is \(0.3(1+2+3)/(1+4+9)=0.12857\), giving fitted slope 2.12857. The residuals at the three points are approximately 0.17143, 0.04286 and −0.08571. Their signed trend suggests a missing intercept. At \(t=6\) the model predicts 12.7714 while the actual law gives 12.3; an apparently modest training residual has grown into a substantial extrapolation error.
Now use a discrepancy exactly proportional to time, \(b_i=0.1t_i\). The fitted slope becomes 2.1 with zero residual at every training point. Additional times under the same model cannot separate the true slope from this contribution. A separate calibration that suppresses the extra physical effect can.
Rotate the missing physics
In a two-reading instrument, the model sensitivity is the unit horizontal vector. Vary the magnitude and direction of the omitted contribution. Observe parameter bias and visible residual separately, and locate cases with the same discrepancy norm but completely different fit diagnoses.
Tutorial on experimental design
Repeat the offset example at symmetric times \((-1,0,1)\). Which part of the fitted result changes?
Worked solution
The constant is now orthogonal to \(t\), giving zero slope bias. The residual is a constant 0.3 in every reading. The experiment has made an offset visible without corrupting the slope.
Can adding an unrestricted discrepancy parameter for every datum solve the identifiability problem?
Worked solution
It permits exact fits for any physical parameter by assigning the remaining signal to the discrepancy. Constrain the discrepancy from theory, independent data or a justified prior to extract the physical parameter.
Read the university treatment
Compare errors that project into a fitted singular direction with errors seen in the orthogonal data residual. Per Christian Hansen · Discrete Inverse Problems
Chapter 17 · Predicting a new measurement when the fitted parameters are correlated
Propagate the full posterior covariance to a quantity of interest, distinguish latent and measured uncertainty and select the observation that reduces the uncertainty of the actual prediction.
One model supplies many possible targets
For parameters \(\theta\) with posterior mean \(m\) and covariance \(C\), a linear target \(s=h^T\theta\) has mean \(h^Tm\). Subtract the mean and expand the quadratic product to obtain
An independent sensor with variance \(R\) changes the variance of a future measured value to \(h^TCh+R\). Repeated fits of noisy datasets and repeated physical measurements are distinct sources of variation.
A candidate new observation \(z=a^T\theta+\epsilon\) with variance \(R_a\) has covariance \(h^TCa\) with the target. For a Gaussian posterior the conditional covariance update is \(C_+=C-Caa^TC/(a^TCa+R_a)\), found either by completing the square or projecting out the optimal multiple of the innovation. The target variance decreases by
Background · Posterior predictive
A distribution over parameters induces uncertainty in a new observation. Measurement noise and uncertainty of the prediction mean are distinct contributions.
A precise sum and an uncertain difference
Let \(C\) have diagonal entries 1 and correlation \(-0.9\). A target \(h=(1,1)\) has variance \(2-1.8=0.2\). The difference \(h=(1,-1)\) has variance 3.8. Ignoring correlations would predict 2 for both. With sensor variance 0.25, a newly measured sum has variance 0.45 although the latent sum variance remains 0.2.
For the target sum, measuring the first coordinate with variance 0.25 reduces variance by \((1-0.9)^2/(1+0.25)=0.008\). Measuring the sum itself at the same variance reduces it by \(0.2^2/(0.2+0.25)=0.0889\). These two sensors have differently normalised sensitivity vectors. Their stated noise levels refer to their own output units and must be calibrated before a cost comparison.
Choose the measurement direction
For a fairer geometric comparison, restrict both measurement and prediction directions to unit length. Fix the target along the normalised sum. Sweep candidate observation angles and read the remaining prediction variance. Change the parameter correlation: when does a coordinate sensor improve the target appreciably?
Tutorial on prediction and parameter recovery
If \(h^TCa=0\), can a noise-free measurement of \(a^T\theta\) improve the linear prediction under these Gaussian assumptions?
Worked solution
The covariance reduction is exactly zero. The measurement may determine another direction precisely while carrying no linear information about the target.
The posterior on \(\theta\) is strongly non-Gaussian. Which conclusions still hold exactly?
Worked solution
Mean and variance of a fixed linear prediction still follow from its first two moments, and independent sensor variance still adds. The Gaussian conditional update and an interval based only on two standard deviations need additional assumptions.
Read the university treatment
Compare the projection of a vector measurement with the covariance of a scalar target. Check the direction of each matrix product. Stephen Boyd · Stanford EE363, estimation
Chapter 18 · Calibrating two instruments when both axes fluctuate
The horizontal axis of a calibration plot is often described as an input. In this experiment it is itself a reading from a second noisy instrument. Infer a straight calibration relation from paired data, derive the metric in which the fit should be performed, and use a change of units to reveal an easily overlooked modelling error.
What was actually held fixed during the experiment?
At setting \(i\), let the unknown true first-channel signal be \(\xi_i\), measured in millivolts. Suppose the true second-channel value, in kelvin, is \(a+b\xi_i\) over the limited operating range. What the laboratory records is the pair \(x_i=\xi_i+\epsilon_{xi}\),
Repeatability tests supply standard deviations \(s_x,s_y>0\). For now fix them across observations, with independent zero-mean Gaussian errors in both channels. The physical settings \(\xi_i\) are treated as unknown fixed quantities, one per record.
Ordinary vertical least squares implicitly treats the observed \(x_i\) as the exact horizontal values. That choice would make sense if the settings had been specified by a sufficiently accurate standard and \(x_i\) denoted those settings. It changes the inference when \(x_i\) comes from a noisy meter. Every displayed point can then move both horizontally and vertically as we estimate its underlying position on the calibration line.
A geometric phrase like “shortest distance to the line” has no unique experimental meaning yet. A displacement of one millivolt and a displacement of one kelvin cannot be compared by drawing the points on square graph paper. Measurement uncertainty supplies a metric. Divide each horizontal adjustment by \(s_x\) and each vertical one by \(s_y\). Under the stated Gaussian assumptions their squared sum is proportional to twice the negative log likelihood, up to additive constants independent of the parameters. This also clarifies why the relative scale requires a separate calibration: one cloud does not automatically reveal how much of its spread belongs to each axis.
Eliminate the unobserved setting algebraically
For a proposed line, estimate each unknown \(\xi_i\) by minimising its pair of squared corrections. Define \(r_i=y_i-a-bx_i\) and write \(\xi_i=x_i+\delta_i\). Then the horizontal term is \(\delta_i^2/s_x^2\), and the vertical term is \((r_i-b\delta_i)^2/s_y^2\). Differentiating their sum with respect to \(\delta_i\) leaves a scalar linear equation. Its solution apportions the original vertical residual between the two measurement errors.
For example, let \(b=2\,\mathrm{K/mV}\), \(s_x=0.5\,\mathrm{mV}\), \(s_y=1\,\mathrm K\), and \(r_i=1\,\mathrm K\). The inferred horizontal correction is 0.25 mV and the remaining vertical error is 0.5 K. In uncertainty units each has magnitude one half and the squared cost is one half. Keeping the first reading fixed would assign the whole kelvin to the second channel and produce cost one. The formula decides the split from the line sensitivity and the two instrument uncertainties.
Substitute the optimal correction into the objective. The profiled contribution simplifies to \(r_i^2/(s_y^2+b^2s_x^2)\). For fixed slope the denominator is common to all records. Differentiating with respect to \(a\) therefore gives
Every candidate slope now passes through the sample centroid. The remaining scalar optimisation is an independent way to check a geometric solution.
Do not attach a slope-dependent logarithm of this denominator to the present objective. We obtained it by maximising over fixed nuisance coordinates, each with its own original pair of measurement densities and fixed noise normalisation. A different experiment might specify a distribution for the latent settings and integrate them out instead. That would be a different likelihood construction. The fitting rule follows from how the unknowns and observations have been modelled.
Fit in coordinates in which the noise is isotropic
Make a data matrix with one row per observation. Subtract the centroid and divide the first column by \(s_x\), the second by \(s_y\). Call the result \(Z\). A line through the origin in these whitened coordinates is completely specified by a unit normal \(n\), including vertical lines that would cause a slope parameter to diverge. The squared perpendicular distances sum to \(\|Zn\|^2=n^TZ^TZn\). Minimising over unit normals selects the eigenvector of the smallest eigenvalue of \(Z^TZ\). With a singular value decomposition \(Z=U\Sigma V^T\), it is the last right singular vector.
The other right singular vector points along the fitted line. Transform that direction back to the physical instrument units by multiplying its components by \(s_x\) and \(s_y\). The slope is the ratio of those transformed components. The sign of the singular vector is mathematically arbitrary and has no effect on the line. The feet of the perpendiculars are simple in whitened coordinates: subtract \((z_i\cdot n)n\) from each whitened point. Transform them back and add the centroid. In a physical plot with unlike axis scales those connecting segments need not look perpendicular by eye.
A three-point calibration you can check without a computer
Use dimensionless readings \((-1,-2),(0,1),(1,1)\) and equal measurement standard deviations. Both column means are zero. The centred sums are
Ordinary vertical least squares gives slope \(3/2\). For a line direction \((1,b)\), requiring that this direction be an eigenvector of the scatter matrix yields
There are two roots. The direction along the major axis corresponds to the positive one,
The negative root is the perpendicular minor-axis direction.
The residual cost of the vertical fit, evaluated in its own vertical metric, should not be directly compared with the perpendicular cost of the other fit. Evaluate both using the same profiled cost instead. With \(s_x=s_y=1\), the minimum equals the smaller scatter eigenvalue \((8-\sqrt{52})/2\simeq0.39445\). Substituting 1.5 into the profiled formula yields \((6-9+4.5)/(1+2.25)\simeq0.46154\). The orthogonal fit has achieved the smaller value in the metric actually specified by the instrument model.
Open full-size diagramWhen is a best direction too weak to interpret?
The separating quantity is the gap between the two eigenvalues of the whitened scatter matrix. If they are nearly equal, the data cloud is nearly round in the metric that matters. Rotating the line then changes the score very little. If they are exactly equal, every line through the centre has the same score. A numerical routine can return a perfectly normalised eigenvector in this situation. Its normalisation and tiny algebraic residual say nothing about whether the data determine a preferred direction.
Try the notebook's seven paired readings first with its default uncertainty scales. The weighted slope is approximately 1.7290 K/mV and the vertical slope about 1.6490 K/mV. Decrease the declared uncertainty of the first channel while retaining the numerical observations. The fit approaches the vertical least-squares answer because horizontal adjustments become expensive. Increasing this uncertainty instead assigns more of a discrepancy to the first instrument. When the recorded inputs span too narrow a range, even very accurate readouts cannot robustly establish a sensitivity over a wide operating range.
A reliable implementation should survive changes of units. Convert millivolts to volts, and divide both the first coordinates and their standard deviation by one thousand. The whitened first column and the minimum score remain unchanged. The newly reported slope has units of kelvin per volt and is one thousand times the original physical number. If the slope fails this conversion test, inspect noise scaling, plotting aspect ratios and any normalisation by sample variance that was used in place of a known measurement uncertainty.
One may also ask for a confidence interval on the inferred line. That requires a sampling model for repeat experiments. In particular, treating each corrected pair as a known physical truth ignores uncertainty in the inferred settings. A simple exploratory test simulates new independent measurement errors at plausible fitted settings, refits the complete procedure and examines the spread of slopes over many trials. The result is conditional on those settings and the stated noise levels. A common calibration error shared by every specimen or correlated errors within a reading would require a different covariance model before interpreting such an interval.
A useful practical control is to interchange the two instruments, fit again with interchanged uncertainties, and convert the line to the original orientation. Whitened orthogonal regression should recover the same geometry. In contrast, two separate vertical regressions generally give different lines after their slopes are inverted. Directional regression can be an appropriate predictor for new observations under another sampling model; this reversal test specifically examines the symmetry of the latent-line calibration adopted here.
Tutorial on calibration uncertainty and identifiability
1. With slope 2 and a positive vertical residual of 1 in the units of the hand example, change \(s_x\) to 0.25 and retain \(s_y=1\). What correction is assigned to each instrument?
Work through the solution
The denominator becomes
The latent first coordinate increases by \(2(0.25)^2/1.25=0.1\). The unexplained vertical error is
Scaled corrections of 0.4 and 0.8 give a total cost of 0.80. Improving the horizontal meter shifts more of the inferred error to the vertical channel.
2. Multiply both standard deviations by three while retaining the same actual data. Which reported quantities change?
Work through the solution
The centred whitened matrix is divided by three. Both singular values scale by one third, but the right singular directions and fitted physical line stay fixed. The squared score decreases by a factor of nine. A fixed fit can therefore be more or less consistent with an instrument specification even when its slope is unchanged.
3. Four measurements in whitened coordinates lie at \((1,0),(-1,0),(0,1),(0,-1)\). What slope will a physically meaningful calibration report?
Work through the solution
The scatter matrix is twice the identity, so every line through the origin has squared score two. A unique calibration slope cannot be recovered from these measurements under the stated equal-uncertainty model. To break the symmetry, obtain additional measurements spanning a wider range of true settings or supply new information about instrument uncertainties.
Further reading · NIST, orthogonal distance regression and errors in the explanatory variables
Change parameters · Calibrating two instruments when both axes fluctuate
Change one input at a time and compare the recalculated curves with the argument above. The browser evaluates this small model locally; the accompanying numerical values state its assumptions and reference checks. Reset restores the reference inputs, and the data can be downloaded as CSV.
Problem sheet 7 · Project · Which thermometer should the laboratory buy?
Separate an unknown common temperature, a calibration contrast and temporal drift. Design a measurement that improves the weakly determined quantity and check whether a small residual signals a trustworthy reconstruction.
Resolve two independent directions
Two calibrated outputs in orthogonal data coordinates are \(d_1=x_1+\eta_1\), \(d_2=0.02x_2+\eta_2\). Both noise standard deviations are 0.01 °C. The observed outputs are 1.00 and 0.03. Compute the unregularised estimates and their standard deviations. Which parameter does the experiment measure reliably?
Work through the solution
The estimates are 1 and 1.5. Independent noise standard deviations propagate by division by the sensitivities, giving 0.01 and 0.5. Both fitted data residuals are zero. Sensor fit alone has hidden the factor of fifty between parameter uncertainties.
Explore the related calculation with adjustable inputs. Change the parameters in the corresponding calculation and compare its independently recomputed values with the equation derived in this solution.
Separate an assumption from a measurement
With \(\lambda=0.02\) apply the zero-centred Tikhonov penalty. Calculate both fitted parameters, their predicted data and the residual. Compare with the regularisation path. Its three-channel test adds a middle sensitivity of 0.2. Set the weak-channel error to 0.010 for the same weak observation and compare the weak-channel prediction. The third sensor changes the total residual norm. Would another identical weak measurement halve the unregularised standard deviation?
Work through the solution
The first estimate is \(1/1.0004\approx0.9996\). The second gain is \(0.02/(0.0004+0.0004)=25\), hence \(x_2=0.75\). The two predicted data are about 0.9996 and 0.015. Subtracting these from the observed data gives residuals 0.0004 and 0.015, with Euclidean norm about 0.0150. Two independent readings at the same design divide standard deviation by \(\sqrt 2\). A change of sensitivity from 0.02 to 0.04 would halve it directly.
Reuse the sensors over time
For a common temperature whose prior variance is 0.04 °C², a time step adds process variance 0.01 °C². A new independent reading has variance 0.04 °C² and lies 0.3 °C above prediction. Calculate the posterior mean shift and standard deviation. Use the temperature filter to predict what increasing process variance does to lag.
Work through the solution
The predicted variance is 0.05. Gain is \(0.05/(0.05+0.04)=5/9\), hence the mean shifts by 0.1667 °C. The posterior variance is \(0.05(4/9)=0.02222\), giving standard deviation 0.1491 °C. Larger process variance gives a higher gain, tending to reduce lag while allowing more measurement variability into the estimate.
Audit the purchase decision
A cheaper replacement responds to \(x_2^2\) with very low noise. Is it a good replacement when the sign of the calibration contrast decides whether to add or subtract a correction? Explore the signed measurement experiment.
Work through the solution
A precise squared measurement alone still cannot distinguish equal positive and negative contrasts under a symmetric prior. A weak signed reading can split the two explanations. Evaluate loss in the corrected temperature and the cost of choosing the wrong sign before choosing hardware.
Problem sheet 8 · Estimate optical thickness when both measurements count photons
A dim red calibration source is viewed through an absorbing filter and then with the filter removed. Both observations fluctuate. Build the inverse problem directly from the photon counts, profile out the unknown source brightness, and decide how to distribute scarce observation time.
Choose the generative model before transforming the data
Take a linear counter with negligible dark counts and a stable monochromatic source. In a blank exposure of duration \(t_b\) the photon rate is an unknown \(\lambda\); with the sample inserted the rate is \(\lambda e^{-a}\), where optical thickness \(a=\mu L\ge0\) is the desired parameter. Counts \(b\) and \(s\) in disjoint exposure windows are independent Poisson random variables. At only a few photons it is quite possible to record zero. Consider a glass sample of thickness 2.00 mm and ask which part of the inference requires this geometric information.
Profile out the source rate
Write the joint log likelihood at finite counts, then find the best source brightness for each proposed optical thickness.
Work through the solution
Independence adds the log probabilities. Ignoring only terms independent of both unknown parameters gives
Holding \(a\) fixed, set \(\partial_\lambda\ell=0\) to obtain \(\hat\lambda(a)=(b+s)/(t_b+t_se^{-a})\) whenever the total count is positive. Substitution gives
The specimen thickness \(L\) has yet to enter the calculation. One measures optical thickness directly; reporting an absorption coefficient \(\mu=a/L\) additionally assumes a known geometrical length and an appropriate single-pass transmission model. Scattering out of the acceptance or reflections can contribute to apparent extinction if the apparatus admits them.
Explore the related calculation with adjustable inputs. Change the parameters in the experiment on this same project page and compare its output with this part of the derivation.
Check the result with an independent probability model
Condition on the observed total count
Show that the sample count given total \(n=b+s\) is binomial. Derive the interior maximum and evaluate it for equal exposure times with \(b=40,\ s=10\).
Work through the solution
Conditional on a recorded photon belonging to either run, its probability of being in the sample run is \(p(a)=t_s e^{-a}/(t_b+t_s e^{-a})\). The binomial probability of observing \(s\) such assignments among \(n\) is proportional to \(p^s(1-p)^b\). Substitution reproduces the same profile likelihood as eliminating brightness analytically. The two routes make the disappearance of the source rate transparent. This conditioning removes its information about brightness while keeping the information about relative attenuation when brightness itself is free.
For positive interior counts the best fraction is \(s/n\), giving \(\hat a=\ln[(b/t_b)/(s/t_s)]\). With equal times it is \(\ln4=1.3863\), and the reported coefficient would be \(693.1\ \mathrm{m^{-1}}\). If the sample rate happens to exceed the blank rate, the constrained maximum is \(a=0\). A negative unconstrained estimate is still informative as a check on fluctuations or alignment. Hiding it with a silent positivity correction makes repeated calibrations difficult to interpret.
Explore the related calculation with adjustable inputs. Change the parameters in the experiment on this same project page and compare its output with this part of the derivation.
Ask what the experiment establishes when no photon arrives
Contrast a curvature estimate with an exact one-sided statement
Evaluate the local standard error for the positive-count example. For a second equal-time experiment with \(b=8,\ s=0\), obtain a one-sided conditional 95% lower bound on optical thickness.
Work through the solution
The profile curvature at the interior maximum has magnitude \(np(1-p)=bs/(b+s)\). Its reciprocal gives the local variance \(1/b+1/s\), so the standard error is \(\sqrt{0.125}=0.354\) for the first run. This local quadratic approximation is a high-count diagnostic. It is weak near a boundary and can miss asymmetry. A direct profile plot of twice the log likelihood loss reveals that asymmetry without taking the logarithm of an observed zero.
With zero sample counts and eight total, the MLE tends to infinity. Yet the data carry finite information. For a candidate \(p\), the conditional probability of observing zero is \((1-p)^8\). Solve \((1-p_U)^8=0.05\) to obtain
At equal exposure \(a=\ln[(1-p)/p]\), giving the exact one-sided conditional lower bound \(a\ge0.789\) after rounding. There is no finite upper bound from these counts alone. Adding one artificial count to numerator and denominator would manufacture a finite point estimate tied to that convention. A specified prior or a measured background can change the inference, but must be included in the generative model.
Explore the related calculation with adjustable inputs. Change the parameters in the experiment on this same project page and compare its output with this part of the derivation.
Allocate the two exposures and interpret the profile graph
For a total time \(T=t_b+t_s\) and a provisional transmission \(q=e^{-a}\), use expected counts to approximate \(\operatorname{var}(\hat a)\simeq1/(\lambda t_b)+1/(\lambda q t_s)\). Optimisation requires a provisional attenuation. After a short pilot run its uncertainty can be propagated through a range of candidate designs. The graph below instead holds observed counts fixed and recomputes the profile loss over trial optical thickness. Use its time-ratio slider to correct the transmission for unequal known exposures. It is a reanalysis of those counts under the selected acquisition timing, rather than a simulated independent observation.
Find the best time ratio and distinguish design from estimation
If \(q=1/4\), find the variance-minimising fraction of time spent on the specimen and compare with the strategy of aiming for equal expected counts. How would a fluctuating source alter the protocol?
Work through the solution
Substituting \(t_b=T-t_s\) and differentiating gives \((T-t_s)^{-2}=1/(q t_s^2)\), hence
Spend two thirds of the time on the specimen. The equal-count rule would require a ratio of four, overusing sample time while leaving the blank reference noisy. For \(\lambda T=120\), the optimum expected counts are 40 blank and 20 sample; the predicted variance is 0.075. At equal expected counts it becomes
The pilot estimate of transmission affects the best allocation but has no role in the profile formula once exposure times are fixed.
If source brightness varies systematically between the two runs, a lower sample rate can represent source drift rather than attenuation. Short interleaved blank and sample segments, or a simultaneously monitored reference, provide observations that identify this nuisance effect. More photons within a pair of separately drifting runs reduce counting error while leaving the confounding intact. At appreciable independently measured background, replace each Poisson mean by signal plus background and fit the counts jointly; the simple conditional probability above then also depends on the background rates.
Explore the related calculation with adjustable inputs. Change the parameters in the experiment on this same project page and compare its output with this part of the derivation.
Further reading
Notebook practice · Calibrating two instruments when both axes fluctuate
Inferring parameters and fields from observations
Follow information from a forward model back to its unknowns. Evaluate identifiability, numerical sensitivity and how an additional observation changes the inference.
- Eliminate linear nuisance parameters before fitting a decay
A measured relaxation has an unknown rate, amplitude and background. Derive a one-dimensional profile fit without fixing the nuisance parameters, explain why short observation windows can hide the rate and test an actual numerical dataset.
- Choose a regularisation scale by predicting omitted data
Regularised least squares can fit each observation partly with itself. Derive leave-one-out residuals from a single factorisation, approximate them by a trace and identify when a generalised cross-validation score misses a highly influential sensor.
- Recovering sparse coefficients without hiding amplitude bias
A sensor records a linear mixture of a few active components. Derive the soft-threshold map, use it in an iterative reconstruction and decide when correlated response columns make an apparently sharp sparse answer ambiguous.
- What each new sensor reading changes in a Gaussian inverse problem
Start with an uncertain vector, condition on one noisy linear observation, and reconstruct the posterior mean and covariance without repeating a batch inversion. Check shared calibration errors before treating repeated measurements as independent evidence.
- What can unfinished endurance tests reveal about lifetime?
When a test stops, a surviving bearing has supplied information. Derive the likelihood from first principles and examine how changing the observation deadline moves the rate inferred from a small batch.
- 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.
- Early stopping and penalties that leave part of a field free
Derive two matrix-free least-squares iterations, find where noise first enters their solution and separate the measured and penalised directions of a nonstandard Tikhonov problem.
Inferring parameters and fields from observations · 1. Eliminate linear nuisance parameters before fitting a decay
A measured relaxation has an unknown rate, amplitude and background. Derive a one-dimensional profile fit without fixing the nuisance parameters, explain why short observation windows can hide the rate and test an actual numerical dataset.
Separate the unknowns by how they enter the observations
Suppose observations at known times \(t_i\) have mean \(y_i=b+a e^{-k t_i}\) with \(k>0\). Both \(a\) and \(b\) enter linearly once \(k\) is specified. For independent equal-variance measurement noise, minimising squared residuals is a natural fit. More general known covariance can be incorporated by whitening the data and model columns together. Fitting all three unknowns by nonlinear iteration is possible, but every candidate rate should be judged against the best available amplitude and background at that rate. Otherwise an apparent improvement or failure of the rate may merely reflect a poor nuisance estimate.
Let \(s_i=e^{-kt_i}\), bars denote sample means, and regress \(y_i\) on \(1,s_i\). Differentiating the sum of squared residuals with respect to \(b\) gives
Substitution and differentiation with respect to \(a\) yield
The denominator vanishes when all times coincide or \(k=0\), at which point the two columns are identical. A QR or SVD of the whitened design reveals this rank loss. The simple centred formulas are transparent for analysis; for large poorly scaled datasets a stable factorisation remains preferable to unmonitored normal equations. Define profile objective \(\Phi(k)=\tfrac12\sum_i r_i^2\),
A one-dimensional search can now explore its shape, bounds or competing minima.
Differentiate the profiled objective without differentiating the whole fit
Write \(X=[\mathbf1,s]\), \(c=(b,a)^T\) and \(r=y-Xc\). At the least-squares solution \(X^Tr=0\). Taking the total derivative of \(\Phi=r^Tr/2\) gives \(-r^T(X'c+Xc')\). The term with \(c'\) vanishes by orthogonality, leaving \(\Phi'=-r^TX'c=a\sum_i r_i t_i e^{-kt_i}\). This simplification applies to the scalar objective gradient, not necessarily to the full residual Jacobian or second derivative. The projected component \((I-P_X)X'c\) is the local model change with rate that cannot be absorbed by a linear-nuisance adjustment. Its whitened squared norm characterises rate information near a well-fitting model.
At short times,
Data resolving only a constant and a slope constrain \(a+b\) and \(ak\), not \(a,b,k\) individually. Making the inner least-squares solve arbitrarily accurate cannot create curvature information absent from the acquisition. Include times approaching the decay time and a late observation near the baseline if feasible. Alternatively supply an independently characterised background with uncertainty rather than fixing it silently. A flat profile exposes this identifiability issue more clearly than a single successful three-parameter optimiser status.
Recover a rate exactly before introducing noise
At \(t=0,1,2,3\) s consider the noiseless data \(5,3,2,1.5\) in sensor units. Successive differences are \(-2,-1,-0.5\), a geometric sequence with ratio \(q=e^{-k}=1/2\). The rate is \(k=\ln2\,\mathrm{s^{-1}}\), and substituting the first two points gives
At the correct rate the profile residual vanishes. An independent numerical implementation should reproduce both the rate and these coefficients and show \(X^Tr\) near zero for every rate, including incorrect candidate rates. These checks distinguish errors in profiling from failures of the outer search.
The difference ratio gives a poor general estimator when the later differences approach the measurement noise. Its numerator and denominator share observed samples, so their errors are correlated. Profiling the original observations uses all data without creating these ratio singularities and permits weighting by known variances. A late-time outlier can nonetheless bias a nonlinear fit with only a handful of samples. Examine the four individual residuals and compare predictions at a held-out time before interpreting a narrow numerical minimum as an identified physical mechanism.
Inspect the rate profile after refitting amplitude and background
The calculation uses the four times above and adds a controlled perturbation to one late observation. It solves the two linear nuisance parameters afresh at each trial rate; a second curve evaluates the same rate with amplitude and background fixed to their original noiseless values. Comparing them makes visible how allowing nuisance parameters to adapt changes both the best rate and the apparent uncertainty. At zero perturbation both curves share \(k=\ln2\), but only the profiled curve describes the stipulated joint fit.
What precision would the four measurements support?
Let the four observations have independent, equal standard deviation \(\sigma\). A small change in rate has derivative vector \(v_i=-a t_i e^{-kt_i}\). Refitting amplitude and background can mimic any change in the span of \(s_i=e^{-kt_i}\) and the constant vector. Only the orthogonal component \(v_\perp=(I-P_X)v\) distinguishes the rate. At the baseline \(a=4,\ k=\log 2\), the unprojected derivative is \((0,-2,-2,-1.5)\). Regressing it on \(s\) and a constant gives slope \(1.98261\) and intercept \(-2.30435\). Subtract that fit and add the squared remainders to obtain
The local least-squares change in rate due to a noise vector is \(v_\perp^T\epsilon/\|v_\perp\|^2\). Its standard deviation is therefore \(\sigma/\|v_\perp\|\). For \(\sigma=0.10\) this is approximately \(0.104\ {\rm s}^{-1}\). Tiny tolerances in the scalar optimiser cannot supply additional information. The estimate assumes small perturbations and an adequate decay law. A visibly asymmetric profile requires inspecting the actual objective on both sides before attaching symmetric error bars.
Tutorial · distinguish a narrow numerical minimum from identified data
Check a false rate numerically
For the noiseless observations take \(q=e^{-k}=1/4\). Compute the best linear background and amplitude approximately. Verify that the sum of residuals vanishes although the fit is wrong.
Work through the solution
Here \(s=(1,0.25,0.0625,0.015625)\). Using the centred expressions gives \(a\simeq3.325,\ b\simeq1.771\). The mean prediction equals the observed mean \(2.875\) by construction, forcing the residual sum to zero. The individual residuals are not all zero because their successive differences have ratio \(1/2\) instead of \(1/4\). Orthogonality to fitted columns certifies the conditional linear solve, not the outer rate.
Measure how the profile changes if the sampling interval doubles
Suppose the same four numerical readings are obtained at \(0,2,4,6\) s. Which parameters change, and which ratio argument still works?
Work through the solution
The decay per sample remains \(q=0.5\), but now \(q=e^{-2k}\), so
Amplitude and baseline stay 4 and 1. Reporting \(q\) as a per-second rate without including time spacing would create a factor-of-two physical error even though every fitted residual vanishes.
Identify a structurally invisible rate
Take a preparation with true amplitude \(a=0\), independent equal-variance noise and an unknown baseline. Can any choice of times identify \(k\) from the exact noiseless data?
Work through the solution
For every \(k>0\) the inner fit permits \(a=0,b=\bar y\), giving zero residual for constant data. The local rate derivative \(X'c\) vanishes and the profile carries no rate information. Random noise may select a numerical minimum, but it does not turn the true no-decay signal into an identified relaxation rate. The experiment needs a preparation with measurable nonzero excitation or a different observable sensitive to the rate.
Further reading
Inferring parameters and fields from observations · 2. Choose a regularisation scale by predicting omitted data
Regularised least squares can fit each observation partly with itself. Derive leave-one-out residuals from a single factorisation, approximate them by a trace and identify when a generalised cross-validation score misses a highly influential sensor.
Express a regularised fit as a map on measured data
Let whitened observations \(y\in\mathbb R^n\) be modelled by \(Ax\), and for \(\lambda>0\) minimise \(\|Ax-y\|^2+\lambda\|x\|^2\). The minimiser satisfies
Predicted data are \(\hat y=H_\lambda y\), where \(H_\lambda=A(A^TA+\lambda I)^{-1}A^T\). This “hat” matrix maps the observations to their own fitted values. If \(A=U\Sigma V^T\), its nonzero eigenvalues are
Their sum \(d(\lambda)=\operatorname{tr}H_\lambda\) is an effective degrees-of-freedom count. A weakly determined direction with small singular value can contribute a fraction of an independently fitted parameter.
The norm of the training residual decreases or stays constant as the penalty weakens. For a square full-rank model it tends to zero as the penalty tends to zero, even with noisy data. Individual residuals can change in either direction. It does not measure out-of-sample error. Instead ask how well the fitted model predicts each observation when it was left out. Repeating the full solve \(n\) times conceptually works but wastes structure. An exact deletion identity gives each left-out residual \(r_i^{(-i)}=(y_i-\hat y_i)/(1-H_{ii})\), where \(H_{ii}\) is the observation's leverage. To derive the formula, remove row \(a_i^T\), subtracting \(a_i a_i^T\) from the penalised normal matrix. Multiplying its inverse update by the original residual along \(a_i\) gives the factor \(1/(1-a_i^TG^{-1}a_i)\), with \(G=A^TA+\lambda I\). This derivation assumes the same penalty strength in the objective for the held-out and full fits.
Replace individual influences by their average only once
The leave-one-out score is the mean of \([r_i/(1-H_{ii})]^2\). Generalised cross-validation replaces the individual diagonal elements by the common mean \(d/n\), giving
When every leverage is equal, this approximation reproduces leave-one-out exactly. Its expression is invariant to orthogonal transformations of the whitened data space because both trace and residual norm are invariant. Exact leave-one-observation-out instead depends on which physical observations are removed, which matters for a particular instrument arrangement. GCV is useful when a rotationally averaged prediction criterion is appropriate; it is not a universal interpretation of removing an actual sensor or predicting an unmeasured parameter direction.
Consider \(A=(1,1,1)^T\) fitting a scalar common signal, \(y=(1.1,0.9,1.0)\), and \(\lambda=1\). The fit is \(\hat x=3/4=0.75\), so residuals are \(0.35,0.15,0.25\). All leverages are \(1/4\). Exact prediction errors on deleting each datum are residuals divided by 0.75. For example removing 1.1 leaves \((0.9+1.0)/(2+1)=0.6333\), giving 0.4667 error, equal to \(0.35/0.75\). GCV equals exact leave-one-out here. Clear agreement in this symmetric scalar case should be a first numerical verification before interpreting a higher-dimensional score whose influences vary.
Background · What counts as an independent observation when validating?
Suppose each specimen is read twice on the same instrument, and its calibration offset changes only between specimens. Omitting one reading leaves its twin available to the fit. A low single-reading validation error then describes another reading of an already observed specimen. It can be optimistic for the next specimen, whose offset is unknown.
For an omitted group \(G\), the scalar denominator \(1-h_{ii}\) from leave-one-out becomes a small matrix. With fixed regularisation, unchanged data weights and squared loss, the group prediction residual satisfies
The off-diagonal entries account for the influence that the two readings exert on each other. If removing an entire group leaves a poorly constrained direction, the solve amplifies that direction. Match the omitted group to the intended future experiment before choosing a score.
See how one sensitive observation can dominate a fit
For another scalar design \(A=(1,1,4)^T\) with \(\lambda=2\), \(G=20\) and \(H_{ii}=(0.05,0.05,0.80)\). A residual on the third sensor is multiplied by five in a true deletion while the first two are amplified only slightly. GCV uses the same factor \(1/(1-0.9/3)=1.429\) for all. If the model discrepancy is concentrated in that high-leverage reading, trace averaging can underestimate the consequence of losing it. Conversely if errors fall only on low-leverage sensors it can overstate their delete-one loss. Inspecting the leverage distribution is inexpensive compared with attributing precision to a single scalar tuning criterion.
Whitening rotates and rescales observations when errors are correlated. Leaving out one row after a dense whitening transformation is generally not the same experiment as removing one physical sensor before whitening. A time-correlated series may demand holding out an entire time block so training data cannot predict a held-out noise realisation through short-range correlation. Predictive selection should specify whether the intended prediction concerns a new repeat at known conditions, a missing detector or a new range of the physical parameters. A penalty that works well for a data prediction need not minimise reconstruction error in a weakly observable component of \(x\).
When does using the average leverage change the answer?
Four sensors have sensitivity one. Their readings are 1.10, 0.90, 1.05 and 0.95. The fifth reading equals its sensitivity plus an adjustable offset. First give all five equal sensitivity. The two scores coincide even with a nonzero offset. Now set the fifth sensitivity to 5 and its offset to 0.8. At λ = 1, compare the fifth leverage with the mean leverage. Predict the fifth reading from the other four, then use this single omitted-sensor error to check which score can reach 0.66.
The OneSimulation model refits five separate reduced data sets for every penalty. The first CSV score therefore measures actual omitted-sensor predictions. Compare it point by point with the faster identity used in the browser.
Tutorial · recover two kinds of influence from one factorisation
Compute the symmetric-case score
Using the common-signal example, evaluate GCV and verify it by explicit deletion of all three observations.
Work through the solution
The residual squared sum is
Its mean divided by \(0.75^2\) gives 0.12296. The three exact predictive residuals are \(0.4667,0.2000,0.3333\); squaring and averaging reproduces 0.12296. The unit of this score is squared whitened observation units. Taking its square root gives an rms predicted datum error, not a standard deviation of the fitted underlying parameter.
Recover effective dimension from singular values
A whitened model has singular values \(4,1,0.1\) and six readings. For \(\lambda=1\), calculate \(d\) and the GCV multiplier applied to mean square residual.
Work through the solution
The gains are
Their sum is 1.4511 and \(1/[1-d/6]^2\simeq1.740\). The weak singular direction barely enters the prediction even though the algebraic rank is three. With vanishing penalty all three nonzero gains tend to one; with very large penalty they approach zero. This continuous change is why a count of nonzero columns cannot replace the trace in the score.
Diagnose misleading use of the diagonal basis
For \(A=I\) of size \(n\) and the same ridge penalty, compute GCV for every positive \(\lambda\). Can these data identify a preferred penalty from that score?
Work through the solution
Here \(H=I/(1+\lambda)\),
Cancellation gives \({\rm GCV}=\|y\|^2/n\), independent of \(\lambda\). Leaving one coordinate out leaves no data at all about that independent parameter, so the prediction by the penalised system for that coordinate is always zero. A numerical minimum created by roundoff does not select a meaningful smoothing strength. Structural correlations, replication, a noise model or external validation are needed to decide how much shrinkage helps the intended task.
Further reading
Inferring parameters and fields from observations · 3. Recovering sparse coefficients without hiding amplitude bias
A sensor records a linear mixture of a few active components. Derive the soft-threshold map, use it in an iterative reconstruction and decide when correlated response columns make an apparently sharp sparse answer ambiguous.
Derive a nonsmooth optimum before choosing a solver
Let a whitened linear model be \(y=Ax+\eta\) and consider minimising \(F(x)=\|Ax-y\|^2/2+\lambda\sum_j|x_j|\). The parameter \(\lambda\ge0\) balances fit with sparsity in this chosen coordinate system. Rescaling one column of \(A\) while leaving its penalty unchanged changes how expensive the corresponding physical component is; normalise columns or use documented coefficient-specific weights before comparing support selection across different quantities. Sparsity of a signal in one basis is a modelling assumption, not evidence generated by the penalty itself.
For an orthonormal design \(A^TA=I\), expanding the square shows that minimisation separates into scalar terms \((x_j-z_j)^2/2+\lambda|x_j|\), with \(z=A^Ty\). For a positive solution the derivative is \(x-z+\lambda=0\); for a negative one it is \(x-z-\lambda=0\). At zero the absolute-value subgradient is the interval \([-1,1]\), so zero is optimal when \(|z|\le\lambda\). These cases give
Unlike simply removing small coefficients, soft thresholding also shrinks every retained amplitude by \(\lambda\). This predictable bias can matter even if the selected support is physically correct.
For \(z=(2.4,-0.7,0.18)\) and \(\lambda=0.5\), the solution is \((1.9,-0.2,0)\). The residual correlations \(A^T(y-Ax)\) must equal \(\lambda\) times the sign on active coordinates and stay in \([-\lambda,\lambda]\) on inactive coordinates. Here they are \((0.5,-0.5,0.18)\). These conditions independently certify optimality for the convex objective, without proving the true sample actually contains only two active mechanisms.
Majorise the smooth loss and solve its local model exactly
For a general \(A\), write \(f(x)=\|Ax-y\|^2/2\) and \(\nabla f=A^T(Ax-y)\). Taylor expansion is exact with second-order term \(\|A(z-x)\|^2/2\le L\|z-x\|^2/2\), \(L=\|A\|_2^2\). Replace the true quadratic term by this upper bound, keep the penalty exact and minimise over \(z\). Completing the square produces
componentwise. This proximal-gradient or ISTA step decreases the objective for this step bound. An under-estimated \(L\) can break the majorisation. A backtracking check evaluates the true smooth loss at the candidate instead of requiring an exact power-method estimate of the largest singular value. Acceleration can reduce the number of iterations, while a numerical termination test based on the subgradient or objective gap remains necessary.
Take \(A=\left(\begin{smallmatrix}1&1\\0&1\end{smallmatrix}\right), y=(1,0)^T,\lambda=0.2\). Its spectral \(L=(3+\sqrt5)/2=2.618\). Starting at zero, \(A^Ty=(1,1)\), so the first iterate is
Both components initially enter equally even though the first column alone fits the pattern exactly. The second measurement penalises a nonzero second coefficient. At the optimum \((0.8,0)\), residual correlations are \((0.2,0.2)\), so the inactive second coefficient sits exactly on its subgradient boundary. A small data perturbation can change its selected status, despite a well-defined convex optimum for this full-rank matrix. Stability of objective value and stability of support are different questions.
Interpret support and debias only after validating it
If two columns of \(A\) are identical, two nonnegative amplitudes with the same sum give the same predictions and the same \(\ell^1\) penalty. A solver may split an identifiable total between the columns or report one arbitrary active component. Lowering the residual tolerance will not resolve this ambiguity. Acquire a measurement where the columns respond differently, merge them if only the total is scientifically meaningful or report a range of admissible allocations. Near-collinear columns give an approximate version of this effect that can be revealed by perturbing the data within their measured noise or holding out a sensor condition.
A common second step is to refit by ordinary or weighted least squares on the selected support to remove shrinkage bias. For the orthonormal example it would restore the retained amplitudes to \(2.4,-0.7\). This is a conditional estimate after choosing that support; it does not undo selection effects and can amplify noise strongly for a nearly singular active submatrix. Test the selected support and refitted prediction on held-out observations. An uncertainty interval that assumes the support known in advance can be too optimistic when small perturbations switch the active set.
Can support and amplitudes both be correct?
The six orthogonal channels have three true nonzero coefficients. Set the perturbation multiplier to one and start with zero threshold. Increase the threshold just far enough to remove the three noise-only channels. Does the weak third signal survive? Now set the perturbation to zero while keeping that threshold fixed. Compare the third estimate with its true value to measure the shrinkage introduced by the penalty itself.
Tutorial · verify an inverse solution using subgradients
Find the penalty where everything switches off
For a general \(A,y\), derive the smallest \(\lambda\) for which \(x=0\) is optimal. Evaluate for the small matrix above.
Work through the solution
At zero, stationarity requires \(A^Ty\in\lambda[-1,1]^p\). Thus \(\lambda_{\max}=\|A^Ty\|_\infty\), which equals 1 in the example. At any larger penalty no component is supported by its residual correlation relative to the threshold. At exact equality an inactive coordinate can lie on the boundary. The criterion concerns the scale of whitened data and normalised design and changes when units or weights change.
Compare soft thresholding with hard component deletion
For a scalar reading 1.2 and \(\lambda=0.5\), compare objectives at the soft estimate, raw reading and zero. Which is lowest and what does it show?
Work through the solution
The soft estimate is 0.7, with objective \(0.5(0.5)^2+0.5(0.7)=0.475\). At 1.2 the residual vanishes but penalty yields 0.600; at zero the loss is 0.720. The shrinkage is a deliberate consequence of the stated objective rather than an error of an iterative algorithm. If amplitude preservation is important, a separate support-conditioned refit answers a different optimisation question.
Prove nonidentifiability with two equal columns
Take \(A=(1,1)\), \(y=3\) and \(\lambda=1\). Characterise an entire family of optimal nonnegative solutions and the unique total that data and penalty identify.
Work through the solution
On nonnegative inputs the objective depends only on \(s=x_1+x_2\) as \((s-3)^2/2+s\). Its minimum is at \(s=2\). The triangle inequality shows no signed decomposition of that same sum can lower its penalty. Every pair \((q,2-q)\) for \(0\le q\le2\) is therefore globally optimal. An algorithm returning \((2,0)\) has not established that the first physical species is present and the second absent. Only their aggregate is determined without a distinguishing observation or another justified prior.
Further reading
Inferring parameters and fields from observations · 4. What each new sensor reading changes in a Gaussian inverse problem
Start with an uncertain vector, condition on one noisy linear observation, and reconstruct the posterior mean and covariance without repeating a batch inversion. Check shared calibration errors before treating repeated measurements as independent evidence.
Condition a joint Gaussian by eliminating a correlated component
Let \(x\) have a Gaussian prior with mean \(m\) and positive definite covariance \(P\). A scalar instrument returns \(y=h^Tx+\epsilon\), with zero-mean Gaussian noise independent of \(x\) of variance \(r>0\). The predicted observation mean is \(h^Tm\); the innovation \(d=y-h^Tm\) has variance \(S=h^TPh+r\), and cross covariance of \(x\) with this innovation is \(Ph\). Seek a corrected error \((x-m)-Kd\) uncorrelated with \(d\). Its covariance with \(d\) vanishes when \(K=Ph/S\). Because the joint distribution is Gaussian, uncorrelated then implies independent, so conditioning on the observed \(d\) gives
The covariance correction is rank one and positive semidefinite when subtracted. It depends on geometry and declared noise, not the particular measurement value. The new mean can move strongly when a large innovation occurs even if the predicted covariance reduction was modest. A very unlikely innovation is reason to check the physical model and reported uncertainty before proceeding as though the calibration were known. Recomputing an ad hoc smaller measurement variance after seeing the data would change the probabilistic assumptions.
An equivalent route minimises \((x-m)^TP^{-1}(x-m)+(y-h^Tx)^2/r\), yielding posterior precision \(P^{-1}+hh^T/r\). Multiplying by the proposed covariance above verifies its inverse directly, a one-row Woodbury identity. For several independent readings, applying rank-one updates sequentially produces the same posterior as one batch solve in exact arithmetic. If the instrument errors are correlated, either whiten the full observation model or explicitly include shared error components in the state before applying independent updates. The matrix identity is exact only for the covariance actually specified in the statistical model.
A correlated prior transfers information to an unmeasured coordinate
Set \(m=(0,0)^T\), \(P=\left(\begin{smallmatrix}4&1\\1&1\end{smallmatrix}\right)\). Measure only the first coordinate with \(h=(1,0)^T,\ r=1,\ y=3\). The innovation variance is 5 and the gain is \((0.8,0.2)^T\). Hence
The second coordinate moved even though the instrument does not directly sense it. That inference uses prior correlation. If prior off-diagonal covariance were zero, its posterior mean and variance would remain unchanged. A conclusion about an unobserved material parameter should therefore report whether sensitivity comes from data or from that imposed correlation structure.
The innovation itself is \(3/\sqrt5=1.34\) predicted standard deviations, plausible under the original model. Conditioned residual at the same reading becomes \(3-2.4=0.6\), much smaller because that observation helped fit the estimate. A model check should use the pre-update innovation or an independent held-out observation. In a sequence of independent conditionally generated data, correctly normalised innovations provide a useful diagnostic for error scale and neglected correlation. An extremely small training residual after every assimilation can simply reflect a model that overweights its own observations.
Maintain a valid covariance over many updates
In exact arithmetic \(P^+=P-Kh^TP\). In finite precision subtracting two nearly equal matrices can erode symmetry or produce a small negative eigenvalue in a direction known very precisely. The equivalent Joseph form \(P^+=(I-Kh^T)P(I-Kh^T)^T+KrK^T\) expresses the result as a sum of positive semidefinite pieces. It also derives directly from the prior state error and independent measurement noise entering the update. A square-root covariance or information factor can improve numerical robustness over repeated strongly informative observations. Simply setting negative diagonal entries to zero after a bad update may still leave an indefinite correlated matrix.
If the state evolves between observations with \(x_{\rm next}=Fx+w\), independent process noise covariance \(Q\) gives predicted mean \(Fm^+\) and covariance \(FP^+F^T+Q\). Choosing \(Q=0\) asserts exact dynamics; it is not a harmless way to remove an implementation parameter. Repeated observations can then drive covariance toward zero in a falsely rigid physical model. Conversely arbitrarily increasing process noise to make any data appear plausible sacrifices the predictive test. Estimate or validate process variability independently when deciding whether a sequential inverse problem represents one stationary parameter or an evolving hidden state.
One hundred readings with one shared calibration
Two parameters have unit prior variance and adjustable correlation. Observe the first parameter repeatedly. Each reading has independent Gaussian noise of standard deviation 0.4 plus the same Gaussian calibration offset, drawn independently of the parameters and the individual noise. First set the calibration uncertainty to zero. Restore it and compare the limiting widths. Finally set the prior correlation to zero and decide which reading could possibly update the second parameter.
Tutorial · separate new information from repeated calibration
Assimilate an independent second measurement
Continue from the two-coordinate example and measure the second coordinate with \(h=(0,1)^T,\ r=0.2,\ y=1.1\). Compute the updated mean and covariance.
Work through the solution
The predicted reading is 0.6, innovation 0.5 and \(S=0.8+0.2=1\). The gain is \((0.2,0.8)^T\), giving mean \((2.5,1.0)\). Subtract \(\left(\begin{smallmatrix}0.04&0.16\\0.16&0.64\end{smallmatrix}\right)\) from the preceding covariance, giving \(\left(\begin{smallmatrix}0.76&0.04\\0.04&0.16\end{smallmatrix}\right)\). Its determinant is 0.12 and both diagonal entries are positive, consistent with a positive definite remaining uncertainty.
Quantify a shared calibration floor
A scalar prior has variance 4. Two or more readings each have independent noise variance 1 and share the same unknown additive calibration bias of variance 0.25. Find posterior variance of the scalar from \(n\) readings and its limit.
Work through the solution
The sample mean measures the scalar plus shared bias with variance \(0.25+1/n\); independent deviations of readings from their mean contain no information about the scalar in this Gaussian model. Thus posterior variance is \([1/4+1/(0.25+1/n)]^{-1}\), tending to \(1/4.25=0.2353\). Incorrectly assigning all errors independent would make the posterior variance vanish. An independent reference sensitive to the calibration bias can lower this floor.
Choose a sensor for a requested derived quantity
Two candidate sensors of the same noise cost are available. Derive the covariance reduction in \(q^Tx\) and evaluate for \(q=(0,1)\), the original \(P\), \(r=1\) and direct measurements of either coordinate.
Work through the solution
The variance reduction is \((q^TPh)^2/(h^TPh+r)\). Measuring coordinate 1 lowers the desired variance by \(1/5=0.2\); measuring coordinate 2 lowers it by \(1/2=0.5\). The larger variance of coordinate 1 could make it an attractive sensor target under a different design criterion, yet the specified prediction favours direct measurement of coordinate 2. State the scientific quantity whose uncertainty the design should reduce.
Further reading
Inferring parameters and fields from observations · 5. What can unfinished endurance tests reveal about lifetime?
When a test stops, a surviving bearing has supplied information. Derive the likelihood from first principles and examine how changing the observation deadline moves the rate inferred from a small batch.
Count failures and add the time spent on test
Assume identical bearings fail independently at a constant rate \(\lambda\) per hour. Over a short interval \(dt\), the conditional probability of failure for an operating bearing is \(\lambda\,dt+o(dt)\). This gives the differential equation \(S'(t)=-\lambda S(t)\) with \(S(0)=1\) for the fraction surviving beyond \(t\). Its solution is \(S(t)=e^{-\lambda t}\) and the failure-time density is
Choose a fixed administrative deadline \(c\) in advance. Each observed duration is the earlier of the failure time and \(c\). Write \(\delta_i=1\) for a recorded failure, zero for an unfinished run. A failure contributes its density. An unfinished run contributes the probability of lasting at least its recorded duration. Multiplying these quantities over the bearings gives
For positive \(d\), differentiating \(d\log\lambda-\lambda T\) gives a score \(d/\lambda-T\). It vanishes at \(\hat\lambda=d/T\). The curvature \(-d/\lambda^2\) is negative. With zero failures the likelihood falls immediately to the right of zero, making zero the boundary maximum. A survivor contributes no failure to \(d\) and still adds positive exposure to \(T\). Removal triggered by a bearing's imminent failure would require a model for that mechanism. A predeclared deadline avoids this selection issue.
Audit a batch stopped after seven hours
Suppose the simulated complete lifetimes are 2, 4, 6, 9 and 14 hours. At seven hours the actual records are three failures and two unfinished tests. Their total exposure is \(2+4+6+7+7=26\) bearing-hours. The rate estimate is \(3/26=0.11538\) per hour and the fitted mean lifetime is \(26/3=8.667\) hours. Discarding the two survivors leaves 12 bearing-hours and inflates the apparent rate to \(3/12=0.25\) per hour.
For a candidate rate of 0.20 per hour the log likelihood relative to the full-data maximum is
This is a relative likelihood near 0.58. The absolute density changes when time units change, while this likelihood ratio is invariant. In the notebook change the deadline to five hours. Each failure that now occurs after the deadline becomes an unfinished observation. Inspect the time lines before interpreting the new estimate.
Open full-size diagram
Open full-size diagramExercise · change the stopping time
What does a five-hour deadline yield for the same five bearings? Can extending the deadline without any additional failure increase the estimated rate?
Work through the solution
The durations are 2, 4, 5, 5 and 5 hours with two observed failures. The new estimate is \(2/21=0.09524\) per hour. While additional operating time accumulates with the same failure count, the ratio \(d/T\) falls for positive \(d\). The estimate can jump upward at an actual failure event. A generally increasing or decreasing trend with a moving deadline is therefore not guaranteed.
Exercise · infer an upper rate after zero failures
Five fresh bearings all survive ten hours. Find the rate for which observing no failures would have probability 0.05 under the model.
Work through the solution
All five must survive ten hours. Independence gives probability \(e^{-50\lambda}\). Setting this equal to 0.05 gives \(\lambda=-\log(0.05)/50\approx0.05991\) per hour. Inverting this zero-failure event gives a one-sided 95% upper confidence bound for the rate in this experiment. The likelihood maximum itself remains at zero.
Change parameters · Explore this notebook model
Change one input at a time and compare the recalculated curves with the argument above. The browser evaluates this small model locally; the accompanying numerical values state its assumptions and reference checks. Reset restores the reference inputs, and the data can be downloaded as CSV.
Inferring parameters and fields from observations · 6. 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
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
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

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.
Inferring parameters and fields from observations · 7. Early stopping and penalties that leave part of a field free
Derive two matrix-free least-squares iterations, find where noise first enters their solution and separate the measured and penalised directions of a nonstandard Tikhonov problem.
Obtain a full iteration without forming the normal matrix
Let \(r=b-Ax,\ s=A^Tr\). Applying conjugate gradients to \(A^TAx=A^Tb\) starting at \(x=0\) works on the range of \(A^T\), where the operator is positive definite even if \(A\) has a nullspace. Initialise \(p=s\) and \(\gamma=s^Ts\). Along \(p\) the residual minimisation gives \(\alpha=(Ap)^Tr/\|Ap\|^2\). Conjugacy of earlier directions implies \(p^Ts=s^Ts\). Thus one CGLS iteration is
Replace \(\gamma\) by \(\gamma_{\rm new}\) and continue. A vanishing gradient means stationarity. Handle a zero denominator before division and recompute true residuals when finite precision matters. The recurrence needs only forward and transpose products. Exact-arithmetic search spaces are nested, so the training residual falls monotonically. The distance to the unknown state can increase.
Solve a sequence of projected rectangular problems
Normalise \(u_1=b/\beta_1\), \(\beta_1=\|b\|\), and \(v_1=A^Tu_1/\alpha_1\), \(\alpha_1=\|A^Tu_1\|\). Alternate orthogonal projections:
These are the Golub–Kahan recurrences, with signs fixed by positive norms. In exact arithmetic induction using transposition shows both sets are orthonormal until breakdown. Collect the coefficients in a lower bidiagonal \((k+1)\)-by-\(k\) matrix \(B_k\). Since \(AV_k=U_{k+1}B_k\), minimise \(\|\beta_1e_1-B_k y\|\) and put \(x_k=V_ky\). LSQR applies plane rotations as each bidiagonal row is appended. Its exact-arithmetic iterates match CGLS started at zero. Finite precision, explicit residual checks and stopping rules affect their returned solutions.
Take \(A=\operatorname{diag}(1,0.01)\), true state \((1,0)\), measured \(b=(1,0.01)\). The first CGLS step uses \(p=(1,10^{-4})\), with \(\alpha\) essentially one, leaving the error about \(10^{-4}\). The second step can drive both residuals to zero by returning \((1,1)\), whose state error is one. A discrepancy threshold near the known noise norm \(0.01\) can stop before fitting the weak direction.
Diagonalise a matrix pair in the right metric
Consider \(\|Ax-b\|^2+\mu^2\|Lx\|^2\). Uniqueness requires \(\ker A\cap\ker L=\{0\}\). Then \(M=A^TA+L^TL\) is positive definite. Factor \(M=R^TR\). The matrices \(\widetilde A=AR^{-1}\), \(\widetilde L=LR^{-1}\) satisfy \(\widetilde A^T\widetilde A+\widetilde L^T\widetilde L=I\). Orthogonally diagonalise the first Gram matrix. In that same basis the second is diagonal with complementary nonnegative entries \(c_i^2,s_i^2\). Thus the associated right directions \(x_i=R^{-1}v_i\) satisfy \(\|Ax_i\|=c_i,\ \|Lx_i\|=s_i\) and \(c_i^2+s_i^2=1\). Their images separately are pairwise orthogonal. This construction derives the GSVD geometry. A production algorithm avoids explicitly forming ill-conditioned Gram matrices.
For \(c_i>0\) put \(u_i=Ax_i/c_i\). With \(x=\sum\xi_i x_i\), the component objective is \((c_i\xi_i-u_i^Tb)^2+\mu^2s_i^2\xi_i^2\). Minimisation gives
f_i=\frac{c_i^2}{c_i^2+\mu^2s_i^2}.
An unpenalised but measured mode has \(s_i=0\) and filter one. A measured-data null direction with \(c_i=0\) has coefficient zero at the minimum. With a nonzero reference \(x_{\rm ref}\), apply the same derivation to its correction and the data \(b-Ax_{\rm ref}\).
What if both operators miss the field average?
A gradient penalty and a differential measurement can have the same constant nullspace. Adding any constant changes neither term of the objective. An extra measurement or physically specified mean is needed to fix the offset. An arbitrary minimum-norm convention changes the interpretation of the result.

Tutorial on filtered and unfiltered directions
Interpret a first-difference penalty in a two-cell experiment
Work through the solution
With \(A=I,\ L=(1,-1)\), normalised sum and difference are Euclidean eigenvectors. Their fitted gains are \(1\) and \(1/(1+2\mu^2)\). Increasing \(\mu\) enforces nearly equal cells while retaining their experimentally measured mean.
Choose a fair comparison between LSQR and CGLS
Work through the solution
Start both at zero, use identical operators and noisy data, count one forward and one transpose product per iteration, and plot reconstruction error and independent prediction error alongside the training residual. Equal iteration counts isolate finite-precision effects. Equal stopping rules test what an investigator actually reports.
Hansen · iterative and general-form regularisation
Change parameters · Early stopping and penalties that leave part of a field free
Change one input at a time and compare the recalculated curves with the argument above. The browser evaluates this small model locally; the accompanying numerical values state its assumptions and reference checks. Reset restores the reference inputs, and the data can be downloaded as CSV.
Which field can be recovered from boundary data?
Relate an observation to its spatial sensitivity. Use reciprocity, smoothing with distance and changes of electrode configuration to identify recoverable features.
- Green functions, the Poisson kernel and what a small electrode can influence
- Normalised spherical harmonics and the field of an arbitrary three-dimensional source
- Capacitance matrices, floating nodes and controlled approximation bounds
- Reconstructing a source from noisy voltage measurements
- Which part of a sample changes a four-electrode impedance measurement?
- Designing a displacement bridge at its noise limit
- Least squares and orthogonal factorisation
- Singular values and minimum-norm solutions
- Removing unequal scales before an iteration
A measured curve and competing mechanisms
Fit material response, decay and resonant splitting. Design at least one new observation that can distinguish explanations left unresolved by the first experiment.
- Measure how quickly a dielectric follows an electric field
- Identify mobile charge with a transverse field
- Measure equilibrium field fluctuations with a capacitor
- Move the reference plane of a wave measurement
- Estimate a cavity linewidth from a finite, biased record
- Choose a frequency that identifies a coil's stored and dissipated energy
- Measuring magnetic core loss by a hysteresis loop and by calorimetry
- Optical trapping and Brownian calibration of a dielectric bead
- Coupled optical and mechanical resonances
- Scattering from a central potential and what angular data can recover
- Which part of a Bell correlation survives imperfect state preparation?
- Recover a transition frequency from two separated pulses
- Transport coefficients from equilibrium fluctuations
Applied study
Infer parameters from noisy observations and use sensitivity to design a more informative experiment.
From predictions to parameter estimates
A forward problem takes material properties and predicts a response. In an inverse problem the responses have been observed and one or more material properties are unknown. Suppose a model predicts \(g_i(p)\) at observation \(i\), where \(p\) is a vector of parameters. Write \(y_i\) for the measured value and \(s_i>0\) for its estimated standard deviation. With independent Gaussian measurement errors of known variance, the maximum-likelihood fit minimises
The weights put observations with different units or precision on a comparable scale. A small residual says that the chosen parameter fits the observations. To know whether it is the only plausible value, examine how the predictions change as the parameter moves.
Fit a spring and inspect the residuals
A spring in its elastic range has force \(F=kx\). For equally precise force measurements at accurately known extensions, minimising the sum of squares gives \(\sum_i x_i(kx_i-F_i)=0\), hence \(\hat k=\sum_i x_i F_i/\sum_i x_i^2\). At extensions of 1, 2 and 3 mm the measured forces are 1.1, 1.9 and 3.0 N. The fitted stiffness is
Plotting the signed residuals against extension can reveal curvature or a preload that this model omits.
If an unknown preload \(b\) is allowed, fit \(F=b+kx\). The columns of the design matrix are then \(1\) and \(x_i\). Measurements at a single extension can determine \(b+kx\) but cannot distinguish \(k\) from \(b\), however many times the measurement is repeated. Multiple extensions add independent information. For a general linear model a QR or singular-value decomposition solves this least-squares problem without squaring the condition number by explicitly forming the normal equations.
Design a measurement for a nonlinear model
For a nonlinear response, approximate the residual near a trial point by \(r(p+\Delta p)\simeq r(p)+J\Delta p\), with \(J_{ij}=\partial r_i/\partial p_j\). A Gauss–Newton step minimises the norm of this linear expression. A damped step can also penalise the size of \(\Delta p\) when the local linear model gives a poor prediction. Small singular values of the appropriately scaled Jacobian identify parameter combinations that the data barely constrain.
Consider first-order decay \(c(t,T)=c_0e^{-k(T)t}\) with an unknown reference rate \(k_r\) and activation energy \(E\). Write \(k(T)=k_r\exp[-(E/R)(1/T-1/T_r)]\). At \(T=T_r\) the factor multiplying \(E\) vanishes. A complete decay curve at that temperature can estimate \(k_r\), but carries no information about \(E\). Taking measurements on either side of \(T_r\) changes that sensitivity. For a locally linear, full-rank, well-scaled problem with unit-variance normalised errors, \((J^\mathsf{T}J)^{-1}\) approximates parameter covariance. The diagonal estimates uncertainty under the assumed model and noise law.
Problem class
Choose a second spring measurement
A force sensor has an unknown constant offset. Compare measurements at 2 and 2 mm with measurements at 1 and 3 mm. For the latter design, suppose the measured forces are 1.3 N and 3.1 N. Recover the slope and offset. What remains unknown if each extension is sampled only once?
Check rank before fitting the line
Two identical extensions give two identical rows \((1,2)\) and cannot separate slope and offset. At distinct extensions the difference gives \(k=(3.1-1.3)/(3-1)=0.9\) N/mm, then
Two observations exactly fit two unknowns. No residual degrees of freedom remain to estimate measurement noise or check linearity from those data alone.
Know when a sample is informative
At one fixed temperature, \(c=c_0e^{-kt}\). Assume the same absolute concentration uncertainty at every sampling time. At what time is a single concentration measurement most sensitive to \(k\)? Evaluate the result for \(k=10^{-3}\ \mathrm{s}^{-1}\).
Maximise the derivative with respect to the rate
The magnitude is \(c_0 t e^{-kt}\). Its time derivative is \(c_0e^{-kt}(1-kt)\), so it peaks at \(t=1/k=1000\) s. The slope is small at very early times because little decay has occurred. At very late times very little material remains. Relative rather than absolute measurement errors would give a different sampling criterion.
OneSimulation laboratory
Find out what a temperature series identifies
Compare recorded OneSimulation runs on this page. To test your own inputs, download the notebook and model files and run the model in an activated OneSimulation environment.
Fit \(k_r\) and \(E\) simultaneously to five simulated concentration histories with a fixed noise seed. The data-generating values are \(k_r=0.001\) s⁻¹ and \(E=115\) kJ/mol. Keep the same starting guess. Predict which change most increases the standard error of \(E\): doubling noise, or moving the five temperatures closer to their common reference of 323.15 K.
| Temperature range and noise (mol/m³) | Fitted E (kJ/mol) | Standard error (kJ/mol) |
|---|---|---|
| 313.15–333.15 K · noise 0.05 | 114.0367 | 0.3636 |
| 313.15–333.15 K · noise 0.10 | 113.0635 | 0.7228 |
| 321.15–325.15 K · noise 0.05 | 111.1489 | 1.4300 |

In the wide case the five temperatures are spaced by 5 K. In the narrow case they are spaced by 1 K. Use the same 12 sampling times per experiment. Try a different random seed after checking the table. Compare the fitted error bar with the scatter of estimates across several seeds. Increasing the number of repeats probes noise; changing the temperature range also changes parameter identifiability. Inspect the model, residuals and fitting procedure.
Download experiment files (ZIP) Extract the files together and open arrhenius_parameter_estimation.ipynb in a local OneSimulation environment.
Change parameters · Change the laboratory inputs
Change one input at a time and compare the recalculated curves with the argument above. The browser evaluates this small model locally; the accompanying numerical values state its assumptions and reference checks. Reset restores the reference inputs, and the data can be downloaded as CSV.
Problem sheet 3 · Choose between repeating and spreading measurements
Notation and assumptions
Read each defining equation with its assumptions and units, then follow the link to the argument that gives the equation its meaning.
Adjoint sensitivity
This operation maps a data-space vector back to parameter space. For a discretised physical model the chosen inner products determine the correct adjoint.
Forward operator
The operator maps parameters to predicted observations. The noise and discrepancy model must use the same physical units as the readout.
Posterior predictive
A distribution over parameters induces uncertainty in a new observation. Measurement noise and uncertainty of the prediction mean are distinct contributions.
Derivation · Predicting a new measurement when the fitted parameters are correlated
Resolution matrix
For a linear regularised inverse, a row describes how the estimated parameter mixes the actual components. A sharp-looking result may still have broad resolution kernels.
Derivation · A reconstruction audit from observations to a defensible claim
Tikhonov estimate
The regularisation operator selects which departures are costly. Compare values of alpha only after fixing how both terms are scaled.
Derivation · Regularisation, resolution and the price of stability
Whitened residual
For a known positive covariance this expresses mismatch in noise units and removes the modelled correlations between measurements.
Derivation · Weighted least squares and residual diagnostics
Further reading
Work with the companion test problems and regularisation tools. Inspect the data coefficients and singular values before selecting a truncation or Tikhonov parameter. Per Christian Hansen · Discrete Inverse Problems

