Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Linear algebra as the language of change

Two source parameters can move two measured channels at the same time. Treat vectors as perturbations, then ask which combinations the data see, which they miss, and how numerical coordinates alter that diagnosis. A matrix is a coordinate representation of the map after choosing a basis; the map and its visible directions are the scientific objects.

Vectors, coordinates, and linear maps

A vector can represent a position, but it can also represent a small change in model parameters, a residual spectrum, a velocity, or a direction through parameter space. A map AA is linear when it preserves addition and scaling:

A(au+bv)=aA(u)+bA(v).A(a\,u+b\,v)=a\,A(u)+b\,A(v).

A basis supplies coordinates for a vector. In a basis whose vectors are the columns of BB, the same abstract vector has coordinates [v]B[v]_B through

v=B[v]B.v = B[v]_B.

Changing basis changes coordinates and the matrix representing a map, not the underlying vector or map. Units and scaling remain part of the scientific meaning of those coordinates: a parameter measured in kelvin and one measured in dex should not be treated as interchangeable numerical axes simply because both appear in one array.

Geometry: dot products, norms, and projection

The Euclidean dot product and norm are

u,v=uTv,v2=vTv.\langle u, v \rangle = u^{\mathsf{T}}v, \qquad \lVert v \rVert_2 = \sqrt{v^{\mathsf{T}}v}.

They define the angle through

cosϕ=u,vu2v2.\cos\phi = \frac{\langle u,v\rangle} {\lVert u\rVert_2\lVert v\rVert_2}.

If the columns of QQ are an orthonormal basis for a subspace S\mathcal{S}, its Euclidean projection is

PS=QQT,PSvS.P_{\mathcal{S}} = QQ^{\mathsf{T}}, \qquad P_{\mathcal{S}}v \in \mathcal{S}.

This geometry is a choice. When a residual rr has covariance CC that is known, symmetric, and positive-definite, its covariance-weighted squared norm is

rC12=rTC1r.\lVert r\rVert_{C^{-1}}^2 = r^{\mathsf{T}}C^{-1}r.

It gives less influence to uncertain directions and accounts for correlated errors. It is warranted only when CC represents the measurement model; it is not a generic way to make a fit look better.

Projection, residuals, and least squares

Suppose a linearized prediction is XβX\beta for observations yy. Weighted least squares chooses a parameter change by

β^=argminβ  XβyW2,rW2=rTWr.\widehat\beta = \underset{\beta}{\arg\min}\; \lVert X\beta-y\rVert_W^2, \qquad \lVert r\rVert_W^2 = r^{\mathsf{T}}Wr.

At an interior optimum with appropriate differentiability, the fitted residual r^=Xβ^y\widehat r=X\widehat\beta-y is orthogonal to the model’s visible directions:

XTWr^=0.X^{\mathsf{T}}W\widehat r = 0.

This is the geometric content of the normal equations. Do not form the inverse of XTWXX^{\mathsf{T}}WX merely because it appears in an algebraic derivation: QR or SVD reveals rank loss and is usually the more stable computational representation. The method page explains the supported numerical routes.

Directions a map reveals or hides

For a square map, an eigenpair satisfies

Av=λv.Av=\lambda v.

Eigenvectors describe directions preserved up to scaling. For any rectangular map, the singular-value decomposition is more broadly useful:

A=UΣVT.A = U\Sigma V^{\mathsf{T}}.

The right singular vectors in VV are input directions; the diagonal entries of Σ\Sigma say how strongly AA transmits them; UU gives the corresponding output directions. A null space contains changes vv for which Av=0Av=0. In inference, it can represent a parameter combination that leaves predictions unchanged to first order.

The number of meaningfully nonzero singular values is the numerical rank. It depends on an explicitly stated rank tolerance, data precision, and the units/scaling of the representation, not a magic count returned by a library.

Conditioning is a scientific question about scale

For a full-rank matrix in the Euclidean norm, the spectral condition number is

κ2(A)=σmax(A)σmin(A).\kappa_2(A) = \frac{\sigma_{\max}(A)}{\sigma_{\min}(A)}.

A large value warns that small perturbations in data or arithmetic can produce large changes in a solution. Rescaling coordinates replaces AA by, for example, AD1AD^{-1}; it can improve arithmetic but it also changes the metric in which parameter steps are described. Report the scaling and condition number together. A well-conditioned representation does not remove a physical degeneracy; it can only make the numerical consequences easier to see.

Jacobians, covariance, and curvature

A Jacobian is the local linear map from parameter perturbations to prediction perturbations:

δyJδθ+ε.\delta y \approx J\,\delta\theta + \varepsilon.

Under a local linear model with a fixed covariance for the parameter changes and errors, covariance propagation gives

CyJCθJT+Cε.C_y \approx J C_\theta J^{\mathsf{T}} + C_\varepsilon.

This is a local statement. It does not establish that a nonlinear posterior is Gaussian, that errors are independent, or that the parameters are globally identifiable.

A quadratic form vTAvv^{\mathsf{T}}Av assigns a direction-dependent magnitude. For a scalar objective ff, a Hessian HH gives the leading curvature term near a reference point:

f(θ+δθ)f(θ)+f(θ)Tδθ+12δθTHδθ.f(\theta+\delta\theta) \approx f(\theta) + \nabla f(\theta)^{\mathsf{T}}\delta\theta + \tfrac12\delta\theta^{\mathsf{T}}H\delta\theta.

Curvature can diagnose a locally weak direction, but it is not global identifiability. Read Sensitivity, conditioning, and identifiability for the distinction.

Read a small measurement problem geometrically

Imagine two measured features responding to two parameters. At a reference model, the Jacobian JJ maps a proposed parameter shift into a predicted change in those features. Before computing a solve, ask: are its two columns nearly parallel? If so, two physically distinct parameter changes create nearly the same observable change. The smaller singular value will be small, and the corresponding right singular vector names the locally confounded combination.

The useful response is not automatically to add a numerical regularizer. First decide whether a new observable, a justified prior, a reparameterization, or a more restricted scientific claim resolves the actual ambiguity.

Try the running case

For the two-channel measurement, suppose two parameter changes have the local map

J=[1111.01].J = \begin{bmatrix} 1 & 1 \\ 1 & 1.01 \end{bmatrix}.

Before solving for a parameter update, predict which combination is weakly visible: the common change in both parameters or their difference.

Worked audit

The columns of JJ are nearly parallel, so their difference is weakly visible: one nearly null right-singular direction trades one parameter against the other. Solving the square system can still produce a finite answer. The useful audit is its singular values and the physical meaning of that weak direction, not whether a generic inverse exists.

Two nearly parallel Jacobian columns map a weak difference direction in parameter space into a long uncertainty region, showing that the two measurements barely distinguish that parameter combination.

Figure 1:The long axis is not a solver failure. It identifies the combination that the specified measurements leave weakly constrained.

Predict

Before solving, identify the map’s units, rank, visible directions, null directions, and the scaling choices that may control its condition number.

Compute

Use matrix-vector products where possible, QR for stable least squares, SVD when rank and null directions matter, and covariance-aware weights only when the measurement model warrants them.

Audit

Check residuals, reconstruction identities, rank assumptions, singular values, and sensitivity to rescaling. Compare a structured computation with a small explicit dense case.

Continue to What is a derivative?. For Jaxstro’s numerical helpers, see Linear algebra helpers.