Backporch
Pillars · deep dive
← The pillars

Change of basis & variable

The deepest move in mathematics and inference is also the quietest: re-express the same object in coordinates that make the question easy. The reality doesn't move — the frame does. Here's the law that makes it rigorous, a catalog of the standard moves, the derivations of and from that fall out of symmetry (with a live forge), Fourier series as the canonical change of basis (with a live builder), and the real question — how do you know which leap to make?

0 · Logarithms — the inverse, the integral, the equation

Before any change of coordinates, the one that turns multiplication into addition. A logarithm is three things at once: the inverse of , the running area under , and the unique continuous function with . That last equation is the quiet engine of this whole deep dive — and of the cumulants a few pillars over. Drag both panels.

area =
1x
= +1.001 (area past 1)
x = 2.72
1aab
· 0.69 + 1.10 = 1.79

The reciprocal is the rate; its running area from 1 is — positive past 1, negative before it, exactly at 1. And because area concatenates, ln a and ln b add to ln(ab): multiplication becomes addition. That one equation is the engine three floors up — it's why cumulants add (log of a product of MGFs), why log-scale turns exponential growth into a straight line, and why the cleanest change of basis is often just the move to additive coordinates.

1 · One move, two flavors

A change of basis rewrites a vector or operator in new coordinates; a change of variable does the same for a function or an integral, . Same idea: leave the object alone, choose a frame that simplifies the question. This deep dive extends the change-of-basis pillar — and reuses the whitening and eigenbasis machinery from the L² deep dive.

2 · The law that keeps it honest — the Jacobian

When you push a density through a map, probability mass must be conserved, so you pay the local volume change — the Jacobian. For an invertible :

In one dimension that determinant is just . Forget the Jacobian and your new density won't integrate to one — the single most common change-of-variable mistake.

3 · A catalog of moves

The standard repertoire — reach for the row whose "when" matches your problem.

MoveWhenGainCostExample
Eigenbasis / diagonalizationa linear map acts repeatedlydecouples into per-axis scalingneeds diagonalizability; axes may be complexAⁿ, Markov stationarity, PCA
Whitening / standardizationcorrelated, differently-scaled featuresuncorrelated, unit-variance coordsloses units; needs ΣMahalanobis, pre-ridge scaling
PCA (truncated eigenbasis)high-dimensional, redundant datakeep variance, drop noise axeslinear; axes can be uninterpretablecompression, denoising
Fourier / frequencyshift-invariant operators, convolutionconvolution → product; ∂ₓ → ×(in)global basis, poor for local features; Gibbssignal processing, PDEs, char. functions
Generating function / MGFsequences; sums of independentsconvolution → product; moments by ∂may not converge; needs inversionsums of RVs, combinatorics
Log / Box–Coxmultiplicative or skewed datamultiplicative → additive; stabilizes varianceundefined at ≤ 0; remeans the datalognormal, growth, GLMs
Polar / sphericalrotational symmetryintegrals separate; tidy Jacobianonly when the symmetry is thereGaussian integral, radial PDEs
u-substitution / pushforwardan integral with hidden structurereduces to a standard formmust track Jacobian & limitschange of variables in densities
Change of measurethe convenient law isn't the targetreweight to the targetneeds the likelihood ratio; variance can blow upimportance sampling, Girsanov

Three of these, up close.

Diagonalization is the purest linear change of basis: in the eigenbasis a matrix is nothing but per-axis stretching, so and a hard repeated action becomes scalar powers. It is the same fact behind Markov stationarity (a left eigenvector with eigenvalue 1) and PCA (the eigenbasis of ).

Fourier earns its place because it diagonalizes every shift-invariant operator at once: differentiation becomes multiplication by , and convolution becomes a plain product, . That is why filtering, PDEs, and the characteristic function all live in the frequency frame.

Polar coordinates are the textbook "leap": the Gaussian integral is intractable in, but squaring it exposes a rotational symmetry, and in polar coordinates it collapses:

4 · Deriving t and F from χ² — symmetry does the work

Start from , a sum of squared standard normals. The joint density of i.i.d. normals is — it depends only on the length, so it is invariant under any rotation. That single symmetry is the engine.

Rotate to an orthonormal basis whose first axis is the all-ones direction . The first new coordinate carries the sample mean; the remaining carry the sample variance — and because rotation preserves independence of i.i.d. normals, with (Cochran's theorem). From there the two workhorse distributions are just ratios:

The forge below builds exactly these by hand — draw the normals, square and sum them into a, form the ratio — and overlays the density the change-of-variables proof predicts. Push the degrees of freedom and watch approach the normal as.

df

Sampling Z ~ N(0,1) and V ~ χ²(10), then T = Z / √(V/10). 30,000 draws (bars) against the exact t(10) density (line).

5 · Fourier series — the canonical change of basis

The functions form an orthonormal basis of , so any square-integrable function is a sum of projections onto them:

This is the same inner-product geometry as the L² deep dive, now with a basis chosen to diagonalize shifts. Parseval's identity says the change of basis preserves energy:Build a wave from its harmonics below; near a jump the partial sums overshoot by a fixed ~9% no matter how many terms you add — the Gibbs phenomenon, the price of a global basis describing a local discontinuity.

Square wave (grey) rebuilt from 5 odd harmonics (gold). The overshoot at each jump settles in height but never disappears — the Gibbs phenomenon.

6 · How do we know to leap?

The choice of frame isn't magic — it's a short list of tells:

The meta-move is one sentence: choose the representation that turns your question into one you can already answer — and stay honest that the choice was yours, not the world's. That last clause is the QBist reading of a basis, and it's where this thread rejoins the perimeter of pillars.

Study these — derivation cards

Reconstruct before you flip. The matching spaced-repetition deck lives in the Obsidian vault.

Prompt 1 · tap to reveal
State the change-of-variables law for a density, both 1-D and multivariate.
1 / 10