Linear algebra primer

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 2times22\\times 2 matrix M = \[\\,v\_1\\;\\, v\_2\\,\] is a rule that takes a vector x=(x_1,x_2)x = (x\_1, x\_2) and returns x_1v_1+x_2v_2x\_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 MhatimathM\\hat\\imath and MhatjmathM\\hat\\jmath, the images of hatimath=(1,0)\\hat\\imath = (1, 0) and hatjmath=(0,1)\\hat\\jmath = (0, 1), and they are the columns of the matrix: Mhatimath=(m_11,m_21)M\\hat\\imath = (m\_{11}, m\_{21}) and Mhatjmath=(m_12,m_22)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 Mhatimath=(1.50,0.30)M\\hat\\imath = (1.50, 0.30) and Mhatjmath=(1.00,0.80)M\\hat\\jmath = (1.00, 0.80).

2. Determinant

For M = \\begin{pmatrix} m\_{11} & m\_{12} \\\\ m\_{21} & m\_{22} \\end{pmatrix} the determinant detM=m_11m_22−m_12m_21\\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.50cdot0.80−1.00cdot0.30=0.901.50 \\cdot 0.80 - 1.00 \\cdot 0.30 = 0.90, the area of the shaded parallelogram in (a). Consequences:

  • ∣detM∣|\\det M| is how much the matrix scales areas (in 2D) or volumes (in 3D).
  • The sign of detM\\det M is positive if the matrix preserves orientation, negative if it reflects. The small arc at the origin in (a) turns from MhatimathM\\hat\\imath to MhatjmathM\\hat\\jmath: anticlockwise while detM>0\\det M > 0, clockwise once the plane is flipped.
  • detM=0\\det M = 0 means the image collapses to a line (or point). The matrix is singular and cannot be inverted. Lower m_22m\_{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 m_22=−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=lambdavMv = \\lambda v. The scalar lambda\\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\\lambda also flips the direction). In (a) the real eigen-directions are dotted: the starting matrix has lambda=1.80\\lambda = 1.80 and 0.500.50, and each dotted line is carried onto itself.

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

lambda2−(operatornametrM),lambda+detM;=;0\\lambda^{2} - (\\operatorname{tr} M)\\,\\lambda + \\det M \\;=\\; 0

so lambda=tfrac12bigl(operatornametrMpmsqrt(operatornametrM)2−4detMbigr)\\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 lambda=repmitheta\\lambda = r e^{\\pm i\\theta}: no real direction survives, and the matrix acts like a rotation by theta\\theta combined with a scaling by r=sqrtdetMr = \\sqrt{\\det M}, up to a change of basis. The rotation by 36.9 degrees under Start from has lambda=0.80pm0.60i\\lambda = 0.80 \\pm 0.60i, and no dotted line appears.

4. Singular values and conditioning

The singular values sigma_1gesigma_2gedots\\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 sigma_i=∣lambda_i∣\\sigma\_i = |\\lambda\_i| = 3 and 1. The condition number is

kappa(M);=;fracsigma_maxsigma_min\\kappa(M) \\;=\\; \\frac{\\sigma\_{\\max}}{\\sigma\_{\\min}}

If kappa\\kappa is large, the inverse problem is ill-conditioned: the relative error in the solution xx can be up to kappa\\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 ∣deltab∣|\\delta b| comes back up to ∣deltab∣/sigma_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 kappa=4.2\\kappa = 4.2 times longer than it is wide. Lower m_22m\_{22} to 0.25 and the columns nearly line up: sigma_2\\sigma\_2 falls to 0.041, kappa\\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:

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

The term epsilonI\\epsilon I adds epsilon\\epsilon to every eigenvalue sigma_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 f_i=sigma_i2/(sigma_i2+epsilon)f\_i = \\sigma\_i^2/(\\sigma\_i^2 + \\epsilon) of the exact solution’s component along each direction, one half where epsilon=sigma_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\\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\\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 A_ijA\_{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=tfrac12WDA = \\tfrac12 WD; xx is the log-impedance lnZ\\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+epsilonI),Deltam=−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\\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.