Linear algebra primer

Part 0, Processing Prerequisites

Learning objectives

  • Read a matrix as a linear function from vectors to vectors
  • Connect determinant, trace, eigenvalues, and singular values to geometric facts about the transformation
  • Set up and solve a least-squares problem with the normal equations and explain why regularization is usually needed
  • Recognize why migration, tomography, inversion, and FWI all reduce to some flavor of Ax=bAx = b

Beyond filtering, almost every processing step is linear algebra wearing a costume. Migration applies the adjoint of a modelling operator. Tomography is least squares. Inversion is a regularized solve. FWI is nonlinear optimization whose every step is linear algebra: an adjoint-state gradient and, in Gauss-Newton, an inner regularized solve. If you cannot read Ax=bAx = b as a picture, the algorithms will look like black magic.

1. A matrix is a function

Forget rows and columns for a moment. A 2×22\times 2 matrix M=[ v1   v2 ]M = [\,v_1\;\, v_2\,] is a rule that takes a vector x=(x1,x2)x = (x_1, x_2) and returns x1v1+x2v2x_1 v_1 + x_2 v_2. The matrix is its two columns; everything else is bookkeeping. In Figure 0.7 you set those two columns by hand and watch the whole plane follow, then run the matrix backwards to solve Mx=bMx = b for noisy data.

Matrix-vector multiplicationA (matrix)1000010000100001×1234=vector bLinear systems Ax = b underpin tomography, inversion, and statics

The two ringed arrows in (a) are Mı^M\hat\imath and Mȷ^M\hat\jmath, the images of ı^=(1,0)\hat\imath = (1, 0) and ȷ^=(0,1)\hat\jmath = (0, 1), and they are the columns of the matrix: Mı^=(m11,m21)M\hat\imath = (m_{11}, m_{21}) and Mȷ^=(m12,m22)M\hat\jmath = (m_{12}, m_{22}). Everything else in (a) follows from them. The pale grid is carried to the darker one, the dashed unit square to the shaded parallelogram, and the dashed unit circle to the solid ellipse. The figure opens on Mı^=(1.50,0.30)M\hat\imath = (1.50, 0.30) and Mȷ^=(1.00,0.80)M\hat\jmath = (1.00, 0.80).

2. Determinant

For M=(m11m12m21m22)M = \begin{pmatrix} m_{11} & m_{12} \\ m_{21} & m_{22} \end{pmatrix} the determinant det⁡M=m11m22−m12m21\det M = m_{11}m_{22} - m_{12}m_{21} is the signed area of the transformed unit square. For the starting matrix it is 1.50⋅0.80−1.00⋅0.30=0.901.50 \cdot 0.80 - 1.00 \cdot 0.30 = 0.90, the area of the shaded parallelogram in (a). Consequences:

  • ∣det⁡M∣|\det M| is how much the matrix scales areas (in 2D) or volumes (in 3D).
  • The sign of det⁡M\det M is positive if the matrix preserves orientation, negative if it reflects. The small arc at the origin in (a) turns from Mı^M\hat\imath to Mȷ^M\hat\jmath: anticlockwise while det⁡M>0\det M > 0, clockwise once the plane is flipped.
  • det⁡M=0\det M = 0 means the image collapses to a line (or point). The matrix is singular and cannot be inverted. Lower m22m_{22} to 0.20, or choose Singular, rank 1 under Start from: the columns line up and the ellipse in (a) flattens to a segment. Keep going to m22=−0.40m_{22} = -0.40 and the determinant comes back as −0.90-0.90, the same area with the plane flipped over.

3. Eigenvalues and eigenvectors

An eigenvector vv of MM is a nonzero direction that survives the transformation up to scaling: Mv=λvMv = \lambda v. The scalar λ\lambda is the eigenvalue. The eigenvectors are the directions along which the matrix is pure stretching; the eigenvalues tell you by how much (and a negative λ\lambda also flips the direction). In (a) the real eigen-directions are dotted: the starting matrix has λ=1.80\lambda = 1.80 and 0.500.50, and each dotted line is carried onto itself.

For a 2×22\times 2 matrix, the eigenvalues come from the characteristic polynomial:

λ2−(tr⁡M) λ+det⁡M  =  0\lambda^{2} - (\operatorname{tr} M)\,\lambda + \det M \;=\; 0

so λ=12(tr⁡M±(tr⁡M)2−4det⁡M)\lambda = \tfrac{1}{2}\bigl(\operatorname{tr} M \pm \sqrt{(\operatorname{tr} M)^{2} - 4\det M}\bigr). When the discriminant is negative the eigenvalues are a complex pair λ=re±iθ\lambda = r e^{\pm i\theta}: no real direction survives, and the matrix acts like a rotation by θ\theta combined with a scaling by r=det⁡Mr = \sqrt{\det M}, up to a change of basis. The rotation by 36.9 degrees under Start from has λ=0.80±0.60i\lambda = 0.80 \pm 0.60i, and no dotted line appears.

4. Singular values and conditioning

The singular values σ1≥σ2≥…\sigma_1 \ge \sigma_2 \ge \dots are the square roots of the eigenvalues of MTMM^{T}M. They are the semi-axis lengths of the ellipse the matrix makes from the unit circle: 1.94 and 0.46 for the starting matrix, the two solid half-axes in (a). They are not the eigenvalues unless MM is symmetric; choose the symmetric matrix under Start from and the dotted lines fall on the ellipse’s axes, with σi=∣λi∣\sigma_i = |\lambda_i| = 3 and 1. The condition number is

κ(M)  =  σmax⁡σmin⁡\kappa(M) \;=\; \frac{\sigma_{\max}}{\sigma_{\min}}

If κ\kappa is large, the inverse problem is ill-conditioned: the relative error in the solution xx can be up to κ\kappa times the relative error in the data bb. The absolute error is simpler to picture. Running MM backwards divides each component of a data error by its singular value, so an error of size ∣δb∣|\delta b| comes back up to ∣δb∣/σ2|\delta b|/\sigma_2 long. Plate (b) shows it: 48 noisy copies of bb in a disc of radius 0.20 come back as a needle-shaped ellipse whose longest radius is 2.2 times the disc’s, and which is κ=4.2\kappa = 4.2 times longer than it is wide. Lower m22m_{22} to 0.25 and the columns nearly line up: σ2\sigma_2 falls to 0.041, κ\kappa rises to 45 and the noise gain to 25 times. Every inversion we will meet later has a condition number, and regularization is the tool for taming it.

5. Systems of equations: Ax=bAx = b

Given a known mapping AA and an observation bb, find the unknown xx. Three cases:

  • Square, invertible. x=A−1bx = A^{-1} b. Rare in the real world; never invert explicitly, solve instead (LU in general, QR for stability, Cholesky when AA is symmetric positive definite).
  • Overdetermined (more equations than unknowns). No exact solution. Use least-squares: minimize ∥Ax−b∥22\|Ax - b\|_2^2. The solution is the normal equation ATA x=ATbA^{T}A\,x = A^{T}b. This is the basic form of tomography, residual statics, and inversion.
  • Underdetermined (fewer equations than unknowns). Infinitely many solutions; you must pick one by adding a penalty like ∥x∥22\|x\|_2^2 (Tikhonov) or ∥x∥1\|x\|_1 (sparsity). Least-squares migration is often underdetermined; conventional migration applies the adjoint ATA^{T} instead of an inverse, which acts as an implicit regularization.

6. The least-squares normal equations in one line

x^  =  (ATA)−1 ATb\hat x \;=\; (A^{T}A)^{-1}\,A^{T} b

That one equation sits underneath residual statics solves, surface-consistent amplitude and deconvolution decomposition, traveltime tomography, model-based inversion, and the inner loop of every iterative imaging algorithm. When ATAA^{T}A is nearly singular, you regularize:

x^reg  =  (ATA+ϵI)−1 ATb\hat x_{\text{reg}} \;=\; (A^{T}A + \epsilon I)^{-1}\,A^{T} b

The term ϵI\epsilon I adds ϵ\epsilon to every eigenvalue σi2\sigma_i^2 of ATAA^{T}A, lifting the small ones off the floor so the inverse exists. The regularized solve keeps the share fi=σi2/(σi2+ϵ)f_i = \sigma_i^2/(\sigma_i^2 + \epsilon) of the exact solution’s component along each direction, one half where ϵ=σi2\epsilon = \sigma_i^2, so it switches off the weak directions first: that is plate (c). Start from the near-singular matrix and raise ϵ\epsilon from 0.000001 to 0.01. The noise gain falls from 25 times to 3.5 times, but the solution moves 5.87 away from the exact one, toward the origin: less noise, more bias. Tuning ϵ\epsilon is the eternal art of inversion.

7. Why this is the workhorse for processing

  • Tomographic velocity inversion. AA is the ray-path matrix (entry AijA_{ij} is the length of ray ii in cell jj); xx is the slowness update; bb is the traveltime residuals. Least squares with smoothing regularization, solved iteratively (CGLS or LSQR) because AA is huge but sparse; ATAA^{T}A is never formed.
  • Post-stack inversion for impedance. AA is the wavelet-convolution matrix applied after a derivative, A=12WDA = \tfrac12 WD; xx is the log-impedance ln⁡Z\ln Z; bb is the observed seismic trace. Same equations, different names.
  • FWI. Each outer iteration linearizes the misfit: the adjoint-state method gets the gradient JTrJ^{T}r from one forward and one adjoint wave simulation, and a Gauss-Newton step solves (JTJ+ϵI) Δm=−JTr(J^{T}J + \epsilon I)\,\Delta m = -J^{T}r. Linear algebra is in the hot core; calculus on matrices is the outer shell.
  • Migration (LS-migration). Matching observed data to predicted data from a reflectivity model, least-squares on a linear forward operator.
The one sentence to remember

A matrix is a function on vectors; Ax=bAx = b with regularization is the universal template for every inverse problem in processing; the condition number tells you how much noise amplification to expect.

Where this goes next

Section 0.8 brings in the other piece of every inverse problem: a model of what the noise does. You cannot set the right ϵ\epsilon without a probabilistic framing, so random variables and noise statistics come next.

References

  • Strang, G. (2016). Introduction to Linear Algebra (5th ed.). Wellesley-Cambridge.
  • Claerbout, J. F. (1976). Fundamentals of Geophysical Data Processing. McGraw-Hill.
  • Yilmaz, Ö. (2001). Seismic Data Analysis (2 vols.). SEG.
  • Tarantola, A. (1984). Inversion of seismic reflection data in the acoustic approximation. Geophysics, 49, 1259.

This page is prerendered for SEO and accessibility. The interactive widgets above hydrate on JavaScript load.