ES98A · Course contents

Week 8: Regression and inverse problems: pseudoinverses + regularisation as optimisation

Return to the two stress measurements that opened the course. A least-squares optimum solved the disagreement, but did not tell us whether small observation errors could produce large changes in stiffness. The SVD in Week 2 exposed that sensitivity; compact operators in Week 5 showed why infinitely many weak directions make it unavoidable.

We now choose to leave some information unrecovered. Regularisation trades a controlled bias for reduced noise amplification. The central question is no longer “can we invert every mode?” but “which modes does the data justify recovering?”

Route through this chapter

Simply put, an inverse problem means fitting/learning unknown parameters in a mathematical model to best explain some data/observation about the system being modelled. (Sometimes we distinguish between parameter estimation and state estimation for dynamical systems.)

Classic example: According to Hooke's law, for a linear elastic material, the force FF applied to stretch a material and the resulting dimensionless strain ε\varepsilon are proportional. Writing σ:=F/A\sigma:=F/A, AA being the cross-sectional area of the material, σ=Eε\sigma=E\varepsilon, with σ\sigma being the stress, ε\varepsilon the strain, and EE the Young's modulus for the material. We can apply known forces and measure extension to get a data set (εj,σj)j=1J(\varepsilon_j,\sigma_j)_{j=1}^J and find an EE that "best" explains the data. A classic choice for "best" is an EE that minimises the sum of squared residuals

Φ(E):=∑j=1J∣σj−Eεj∣2.\Phi(E):=\sum_{j=1}^J|\sigma_j-E\varepsilon_j|^2.

With noisy data, an overdetermined system will generally have positive minimum misfit, although exact consistency is possible. Overdetermined does not by itself mean inconsistent.

This is a simple example of linear regression: given a set of JJ input-output pairs (xj,yj)(x_j,y_j), find a constant θ∈R\theta\in\mathbb{R} such that

Φ(θ):=12∑j=1J∣θxj−yj∣2=12∥xθ−y∥22\Phi(\theta):=\frac{1}{2}\sum_{j=1}^J|\theta x_j-y_j|^2=\frac{1}{2}\|x\theta-y\|_2^2

is minimised. (Here x=(x1,…,xJ)x=(x_1,\ldots,x_J) and y=(y1,…,yJ)y=(y_1,\ldots,y_J).)

As a mild generalisation, we can do linear regression with an intercept that does not have to be zero: we seek θ=(θ0,θ1)T∈R2\theta=(\theta_0,\theta_1)^T\in\mathbb{R}^2, using the model yj=θ0+θ1xjy^j=\theta_0+\theta_1 x_j, to minimise

Φ(θ):=12∑j=1J∣θ0+θ1xj−yj∣2=12∥θ0(1,…,1)T+θ1x−y∥22,\Phi(\theta):=\frac{1}{2}\sum_{j=1}^J|\theta_0+\theta_1 x_j-y_j|^2=\frac{1}{2}\|\theta_0(1,\ldots,1)^T+\theta_1 x-y\|_2^2, =12∥(1x1⋮⋮1xJ)(θ0θ1)−(y1⋮yJ)∥22.=\frac{1}{2}\left\|\begin{pmatrix}1&x_1\\ \vdots&\vdots\\ 1&x_J\end{pmatrix}\begin{pmatrix}\theta_0\\ \theta_1\end{pmatrix}-\begin{pmatrix}y_1\\ \vdots\\ y_J\end{pmatrix}\right\|_2^2.

(In the form that numpy.linalg.lstsq expects.)

We can take this a bit further and fit models linear in their parameters of the form

y=∑k=0Kθkfk(x),y=\sum_{k=0}^K \theta_k f_k(x),

where the parameters θ0,…,θK∈R\theta_0,\ldots,\theta_K\in\mathbb{R} appear linearly, and the f0,…,fK:R→Rf_0,\ldots,f_K:\mathbb{R}\to\mathbb{R} are possibly nonlinear feature functions. A Fourier expansion is an example, with fk(x)=eikxf_k(x)=e^{ikx}.

The misfit function Φ:RK+1→R≥0\Phi:\mathbb{R}^{K+1}\to\mathbb{R}_{\ge 0} that needs to be minimised here is again a sum of squared residuals

Φ(θ)=12∑j=1J∣∑k=0Kθkfk(xj)−yj∣2=12∥(f0(x1)f1(x1)⋯fK(x1)⋮⋮⋱⋮f0(xJ)f1(xJ)⋯fK(xJ))(θ0θ1⋮θK)−(y1⋮yJ)∥22.\Phi(\theta)=\frac{1}{2}\sum_{j=1}^J\left|\sum_{k=0}^K \theta_k f_k(x_j)-y_j\right|^2=\frac{1}{2}\left\|\begin{pmatrix} f_0(x_1) & f_1(x_1) & \cdots & f_K(x_1)\\ \vdots & \vdots & \ddots & \vdots\\ f_0(x_J) & f_1(x_J) & \cdots & f_K(x_J) \end{pmatrix} \begin{pmatrix}\theta_0\\ \theta_1\\ \vdots\\ \theta_K\end{pmatrix} - \begin{pmatrix}y_1\\ \vdots\\ y_J\end{pmatrix} \right\|_2^2.

The matrix above is the feature matrix or design matrix (or "Vandermonde matrix" if the fkf_k are polynomials).

All of the above is motivation for, and special cases of, the following:

(We call AA the forward operator.)

Mathematical forward problems are usually well posed: Hadamard called a problem well posed if

  1. For each problem setup, a solution exists
  2. That solution is unique
  3. This unique solution depends "nicely"/stably (e.g. continuously or differentiably) on the problem setup.

However, inverse problems are typically ill posed and violate one or more of Hadamard's criteria. Just think of over- and under-determined linear systems to see why the eqn Au=yAu=y cannot typically be solved for uu in a stable way. (Even the minimisation problem is a relaxation of the original goal of solving an equation exactly.)

Generalised inverses for compact linear inverse problems

We'd like to solve the equation Au=yAu=y for u∈H1u\in H_1 given a compact linear op. A:H1→H2A:H_1\to H_2 and y∈H2y\in H_2. This may be impossible, e.g. if y∉ran(A)y\notin\mathrm{ran}(A), cf. Hadamard (1). If AA is not injective, i.e. if ker⁡(A)≠{0}\ker(A)\ne\{0\}, then solutions are not unique, cf. Hadamard (2). And what about (3)?

The situation is not hopeless: we relax the problem and seek uu to minimise

12∥Au−y∥H22=:Φ(u).\frac{1}{2}\|Au-y\|_{H_2}^2=: \Phi(u).

As we have seen, minimisers of Φ\Phi are exactly solutions of ∇Φ(u)=0\nabla\Phi(u)=0, i.e. solutions of the normal equations

A∗Au=A∗y.A^*Au=A^*y.

If we have the SVD

A=∑n∈Nσn ϕn⊗ψn,A=\sum_{n\in\mathbb{N}} \sigma_n\,\phi_n\otimes\psi_n,

then, whenever the following series converges, the minimum-norm least-squares solution is given by

u=A†y=∑n∈N1σn⟨ψn,y⟩H2 ϕn(∗),u=A^\dagger y=\sum_{n\in\mathbb{N}}\frac{1}{\sigma_n}\langle \psi_n,y\rangle_{H_2}\,\phi_n\quad (*),

where

A†=∑n∈N1σn ψn⊗ϕn.A^\dagger=\sum_{n\in\mathbb{N}}\frac{1}{\sigma_n}\,\psi_n\otimes\phi_n.

(Moore–Penrose pseudoinverse / generalised inverse of AA)

Two issues present themselves:

  1. The expansion (*) for uu only converges in H1H_1 if the data y∈H2y\in H_2 satisfies the Picard condition
∥A†y∥H12=∑n∈N∣⟨ψn,y⟩H2∣2σn2<∞.\|A^\dagger y\|_{H_1}^2=\sum_{n\in\mathbb{N}}\frac{|\langle \psi_n,y\rangle_{H_2}|^2}{\sigma_n^2}<\infty.

(Parseval)

So A†A^\dagger is not a globally-defined operator H2→H1H_2\to H_1; it is only defined on a domain dom(A†)⊆H2\mathrm{dom}(A^\dagger)\subseteq H_2 on which the Picard condition holds.

  1. A†:dom(A†)⊆H2→H1A^\dagger:\mathrm{dom}(A^\dagger)\subseteq H_2\to H_1 is an unbounded operator: there is no finite constant CC s.t.
∥A†y−A†(y+δy)∥≤C∥δy∥.\|A^\dagger y-A^\dagger(y+\delta y)\|\le C\|\delta y\|.

(The only way this can hold is the "boring" case that AA has finite rank rr, in which case C=∥A†∥op=σr−1C=\|A^\dagger\|_{\mathrm{op}}=\sigma_r^{-1}; otherwise ∥A†∥op=(min⁡nσn)−1=σ−1=∞\|A^\dagger\|_{\mathrm{op}}=(\min_n \sigma_n)^{-1}=\sigma^{-1}=\infty.) Thus A†yA^\dagger y is highly sensitive to small perturbations of the data yy, cf. Hadamard (3).

Despite these issues, A†A^\dagger does have many nice properties, e.g.

AA†A=A,A†AA†=A†,A A^\dagger A=A,\qquad A^\dagger A A^\dagger=A^\dagger, A†A=P(ker⁡A)⊥,AA†=Pran A‾∣dom A†.A^\dagger A=P_{(\ker A)^\perp},\qquad A A^\dagger=P_{\overline{\mathrm{ran}\,A}}\big|_{\mathrm{dom}\,A^\dagger}.

Furthermore, for y∈dom(A†)y\in\mathrm{dom}(A^\dagger), if we set u+:=A†yu^+:=A^\dagger y, then

arg⁡min⁡Φ={u∈H1:∥Au−y∥H22 is minimised}=u++ker⁡A,\arg\min \Phi=\{u\in H_1:\|Au-y\|_{H_2}^2\text{ is minimised}\}=u^+ + \ker A,

and u+u^+ minimises ∥u∥H1\|u\|_{H_1} in this set. That is, among all solutions to the least squares problem, A†yA^\dagger y is the "smallest", the closest to the origin in H1H_1.

Regularisation

This all leads to the idea of regularisation: we approximate the partially-defined unbounded op. A†:dom(A†)⊆H2→H1A^\dagger:\mathrm{dom}(A^\dagger)\subseteq H_2\to H_1 by a family of bounded operators Gα:H2→H1G_\alpha:H_2\to H_1, with α>0\alpha>0 being a regularisation parameter. Note that ∥Gα∥op→+∞=∥A†∥op\|G_\alpha\|_{\mathrm{op}}\to +\infty=\|A^\dagger\|_{\mathrm{op}} as α→0\alpha\to 0. We ask only that

Gαy→A†yas α→0G_\alpha y \to A^\dagger y\quad\text{as }\alpha\to 0

for all y∈dom(A†)y\in\mathrm{dom}(A^\dagger).

There's clearly a lot of flexibility here. An accessible example is Tikhonov regularisation / ridge regression.

Tikhonov regularisation

Although there are many ways to regularise inverse problems, an accessible first approach to consider is Tikhonov regularisation.

Instead of minimising the misfit functional

Φ(u):=12∥Au−y∥H22\Phi(u):=\frac{1}{2}\|Au-y\|_{H_2}^2

w.r.t. u∈H1u\in H_1, we minimise

Φα(u):=12∥Au−y∥H22+α2∥u∥H12,\Phi_\alpha(u):=\frac{1}{2}\|Au-y\|_{H_2}^2+\frac{\alpha}{2}\|u\|_{H_1}^2,

with α>0\alpha>0 a regularisation parameter. Small α\alpha promotes fidelity to the data, with a risk of overfitting; large α\alpha promotes a stable, small solution regardless of the data.

We can derive Tikhonov-regularised normal equations:

uα minimises Φα  ⟺  ∇Φα(uα)=0  ⟺  A∗Auα−A∗y+αuα=0  ⟺  (A∗A+αI)uα=A∗y  ⟺  uα=(A∗A+αI)−1A∗y.u_\alpha\text{ minimises }\Phi_\alpha \iff \nabla\Phi_\alpha(u_\alpha)=0 \iff A^*A u_\alpha - A^*y + \alpha u_\alpha = 0 \iff (A^*A+\alpha I)u_\alpha=A^*y \iff u_\alpha=(A^*A+\alpha I)^{-1}A^*y.

The reason this inverse is bounded is the uniform coercivity bound ⟨u,(A∗A+αI)u⟩≥α∥u∥2\langle u,(A^*A+\alpha I)u\rangle\ge\alpha\|u\|^2, rather than strict positivity alone. Indeed, the operator

Gα:=(A∗A+αI)−1A∗G_\alpha:=(A^*A+\alpha I)^{-1}A^*

is a regularisation of A†A^\dagger in the sense introduced above:

In terms of an SVD A=∑n∈Nσn ϕn⊗ψnA=\sum_{n\in\mathbb{N}}\sigma_n\,\phi_n\otimes\psi_n with σn→0\sigma_n\to 0, ϕn\phi_n orthonormal in H1H_1, and ψn\psi_n orthonormal in H2H_2, A†A^\dagger is given by

A†=∑n∈Nσn−1 ψn⊗ϕn,i.e. A†y=∑n∈N⟨ψn,y⟩σn ϕn.A^\dagger=\sum_{n\in\mathbb{N}}\sigma_n^{-1}\,\psi_n\otimes\phi_n,\quad\text{i.e. }A^\dagger y=\sum_{n\in\mathbb{N}}\frac{\langle \psi_n,y\rangle}{\sigma_n}\,\phi_n.

On the other hand,

uα=Gαy=∑n∈Nσnσn2+α⟨ψn,y⟩ ϕn=∑n∈Ngα(σn)⟨ψn,y⟩ ϕn,u_\alpha=G_\alpha y=\sum_{n\in\mathbb{N}}\frac{\sigma_n}{\sigma_n^2+\alpha}\langle \psi_n,y\rangle\,\phi_n=\sum_{n\in\mathbb{N}} g_\alpha(\sigma_n)\langle \psi_n,y\rangle\,\phi_n,

where gα:[0,∞)→[0,∞)g_\alpha:[0,\infty)\to[0,\infty) is the regularisation function or filter function.

This is an example of spectral regularisation, replacing the "ideal" filter function

g0(σ):={1/σσ>00σ=0g_0(\sigma):=\begin{cases}1/\sigma & \sigma>0\\ 0 & \sigma=0\end{cases}

by something smoother and bounded.

Other classic examples of filter functions and spectral regularisation include

Clearly, the choice of α\alpha plays an important role. Often, α\alpha is chosen to depend upon the quality/amount of data available.

The choice of α\alpha as a function of δ\delta or nn is called a regularisation schedule. When coupled with source conditions of the form

∑n∈N∣⟨ϕn,u⟩∣2σn2s<∞,\sum_{n\in\mathbb{N}} \frac{|\langle \phi_n,u\rangle|^2}{\sigma_n^{2s}}<\infty,

we can bound the reconstruction error Gαy−uG_\alpha y-u and show that ∥Gα(δ)y−u∥→0\|G_{\alpha(\delta)}y-u\|\to 0 as δ→0\delta\to 0 for an appropriate schedule. See handout!

On a fixed noisy data vector, reduce the penalty weight and watch the reconstructed coefficients. Strong modes settle first. Eventually the weak directions begin to explain the noise as if it were signal.

Trust the modes the observations can support

Recover the coefficients

18-0.401.1singular mode nunknown coefficient

Inverse amplification

0.11010singular value σfilter gα(σ)

α=1.00e+0, reconstruction error=0.549

Dashed truth stays fixed. The marked singular values sample the filter; weak modes receive more amplification as alpha decreases.

Play once, pause, or scrub to inspect an intermediate state.

Ready to explore.
Eight-mode diagonal forward map σₙ=1/n, truth uₙ=1/n², fixed signed noise of norm 0.04. Solid coefficient curves are compared with the dashed truth. Tikhonov multiplies noisy data by σₙ/(σₙ²+α); reducing α restores signal and eventually amplifies weak-mode noise. ↗

Sparsity and edge preserving regularisation

We can consider more general penalties/regularisations: find uRu_R to minimise

Φ(u)+R(u)\Phi(u)+R(u)

with R:H1→[0,∞]R:H_1\to[0,\infty] some regularisation function.

In some situations, we have a prior belief that u=∑nunψnu=\sum_n u_n\psi_n should be "simple" or "sparse", i.e. most un=0u_n=0. It turns out that a choice of RR that promotes sparsity in the minimiser is the ℓ1\ell^1-norm or Manhattan norm of uu

∥u∥1:=∑n∈N∣un∣,\|u\|_1:=\sum_{n\in\mathbb{N}}|u_n|, R(u)=α∑n∣un∣.R(u)=\alpha\sum_n |u_n|.

This is known as sparse regularisation, ℓ1\ell^1 regularisation, or the LASSO.

Source conditions and why they matter for convergence of regularised reconstructions

Consider the inverse problem of recovering u∈Hu\in H from y∈Yy\in Y, given the linear model

y=Au+η,A:H→Y compact.y=Au+\eta,\qquad A:H\to Y\ \text{compact}.

We will use a regularised reconstruction:

AA has SVD

A=∑n∈Nσn ϕn⊗ψn,A=\sum_{n\in\mathbb{N}}\sigma_n\,\phi_n\otimes\psi_n,

and

u≈uα:=gα(A)y=∑n∈Ngα(σn) ψn⊗ϕn y=∑n∈Ngα(σn) ⟨ψn,y⟩Y ϕn.u\approx u_\alpha:=g_\alpha(A)y=\sum_{n\in\mathbb{N}} g_\alpha(\sigma_n)\,\psi_n\otimes\phi_n\,y=\sum_{n\in\mathbb{N}} g_\alpha(\sigma_n)\,\langle \psi_n,y\rangle_Y\,\phi_n.

Assume that ∥η∥Y≤δ\|\eta\|_Y\le \delta. How should we send α→0\alpha\to 0 as δ→0\delta\to 0 to ensure that uα(δ)→uu_{\alpha(\delta)}\to u? Do we need any assumptions on uu?

We will focus on Tikhonov regularisation,

gα(σ):=σσ2+α.g_\alpha(\sigma):=\frac{\sigma}{\sigma^2+\alpha}.

Many generalisations are possible.

Assume u⊥ker⁡Au\perp\ker A; an invisible kernel component cannot be recovered by any spectral inverse. Write un=⟨ϕn,u⟩u_n=\langle\phi_n,u\rangle and ηn=⟨ψn,η⟩\eta_n=\langle\psi_n,\eta\rangle. The error splits into a deterministic bias and propagated observation noise:

uα−u=(GαA−I)u+Gαη,u_\alpha-u=(G_\alpha A-I)u+G_\alpha\eta, ∥uα−u∥2≤2∑n(ασn2+α)2∣un∣2+2∑nσn2(σn2+α)2∣ηn∣2.\|u_\alpha-u\|^2\le 2\sum_n\left(\frac{\alpha}{\sigma_n^2+\alpha}\right)^2|u_n|^2 +2\sum_n\frac{\sigma_n^2}{(\sigma_n^2+\alpha)^2}|\eta_n|^2.

The first term decreases as more modes are trusted; the second can increase. For a scalar singular value t≥0t\ge0,

(t−α)2≥0⟹tt2+α≤12α.(t-\sqrt\alpha)^2\ge0 \quad\Longrightarrow\quad \frac{t}{t^2+\alpha}\le\frac1{2\sqrt\alpha}.

Therefore the noise term is at most δ2/(2α)\delta^2/(2\alpha). Equality in the scalar bound occurs at t=αt=\sqrt\alpha; the actual operator norm can be smaller if no singular value lies there.

What exactly does regularisation refuse to invert? Compare the filters and the two competing error bounds.

Filter, α = 0.04Filter, α = 0.04singular value tdata amplification0.11010solid: t/(t² + α)dashed: inverse 1/t
Error bound, δ = 0.02Error bound, δ = 0.02parameter αnorm bound0.0010.200.35solid: bias bound α (s = 2)dashed: noise δ/(2√α)
Left: Tikhonov caps amplification at 2.5 for α=0.04. Right: source radius M₂=1 and noise bound δ=0.02; curves are norm-error bounds, not realised errors. ↗

The smallest singular values are suppressed rather than accurately inverted. Increasing α lowers noise amplification but raises bias; the derivation below quantifies a schedule that sends both to zero.

Follow the bias and noise vectors separately for those same data. Their norms compete as alpha changes, but the final error is the norm of their vector sum. This distinction explains why an upper bound need not trace the realised error exactly.

Follow bias and noise separately

Actual error components

-4000.65log₁₀ alphacoefficient-vector norm

Error vectors add before norms

18-0.600.3singular mode ncoefficient error

bias=0.553, noise=0.011, total=0.549

Teal bias shrinks while amber propagated noise grows. Their vectors add; the dashed total norm shows the realised compromise for this fixed noise.

Play once, pause, or scrub to inspect an intermediate state.

Ready to explore.
The same fixed eight-mode problem as the spectral-filter animation. Left shows actual bias norm, propagated-noise norm and total error on a logarithmic α axis. Right compares coefficient error vectors. Total error is not the sum of the two norms; cancellation is possible. ↗

Convergence without a rate, then a source condition

For a fixed recoverable uu, each bias factor tends to zero and is bounded by one. Dominated convergence for the summable series ∑n∣un∣2\sum_n|u_n|^2 gives bias convergence without an extra smoothness assumption. Thus

α(δ)→0,δ/α(δ)→0⟹uα(δ)→u.\alpha(\delta)\to0,\qquad \delta/\sqrt{\alpha(\delta)}\to0 \quad\Longrightarrow\quad u_{\alpha(\delta)}\to u.

A source condition gives a quantitative rate uniformly over a smoother class. Define

Ms2:=∑n∣un∣2σn2s<∞,s>0.M_s^2:=\sum_n\frac{|u_n|^2}{\sigma_n^{2s}}<\infty,\qquad s>0.

For 0<s≤20<s\le2, put t=αrt=\sqrt\alpha r. Then

αtst2+α=αs/2rs1+r2≤αs/2,\frac{\alpha t^s}{t^2+\alpha} =\alpha^{s/2}\frac{r^s}{1+r^2}\le\alpha^{s/2},

because rs≤1+r2r^s\le1+r^2. Consequently,

∥uα−u∥2≤2αsMs2+δ22α.\|u_\alpha-u\|^2\le2\alpha^s M_s^2+\frac{\delta^2}{2\alpha}.

Balancing the two terms gives α≍δ2/(s+1)\alpha\asymp\delta^{2/(s+1)} and norm error O(δs/(s+1))O(\delta^{s/(s+1)}), with fixed source bound. For s>2s>2, use t≤∥A∥t\le\|A\| to obtain

αtst2+α≤α∥A∥s−2.\frac{\alpha t^s}{t^2+\alpha}\le\alpha\|A\|^{s-2}.

The bias bound saturates at order α\alpha for ordinary Tikhonov; the source's supremum over all t>0t>0 was infinite for s>2s>2. This restriction is not a technicality: a smoother truth does not remove the filter's limited qualification.

Exercise. Let σn=1/n\sigma_n=1/n and put noise of size δ\delta in a single output mode. Compare the unregularised error δn\delta n with the regularised error δn/(1+αn2)\delta n/(1+\alpha n^2). Which mode is most amplified? Week 9 turns this balance into parameter-choice rules and then a distribution over reconstructions.