Quant Memo
Core

The Jacobian and Change of Variables

When you swap one set of variables for another — prices for log-returns, cash for risk-neutral units — the Jacobian is the local exchange rate that keeps areas, volumes, and probabilities honest.

Prerequisites: Gradients and Directional Derivatives, Determinants

Suppose you know the probability density of a stock's price and you want the density of its log-return instead. You can't just relabel the axis — squeezing or stretching the variable also squeezes or stretches how "spread out" the probability is at each point, so the density's height has to adjust to compensate. In one dimension, a plain derivative handles this. In several dimensions at once — say, converting a joint distribution of price and volatility into a joint distribution of moneyness and log-vol — you need the Jacobian, the multivariable generalization of "how much does this transformation stretch or shrink space, right here."

The analogy: a rubber sheet map

Imagine a map printed on a rubber sheet. Stretch the sheet unevenly, and a square inch in one spot might cover two square inches after stretching, while a square inch somewhere else barely changes. The Jacobian determinant is the local "stretch factor" at each point of the sheet — it tells you exactly how much a tiny patch of area (or volume, in higher dimensions) grows or shrinks under the transformation, point by point, even when the stretching isn't uniform across the whole sheet.

The mechanics, one symbol at a time

For a transformation from variables (x1,,xn)(x_1,\dots,x_n) to new variables (y1,,yn)=g(x1,,xn)(y_1,\dots,y_n) = g(x_1,\dots,x_n), the Jacobian matrix collects every partial derivative of every output with respect to every input:

J=(y1x1y1xnynx1ynxn).J = \begin{pmatrix} \dfrac{\partial y_1}{\partial x_1} & \cdots & \dfrac{\partial y_1}{\partial x_n} \\ \vdots & \ddots & \vdots \\ \dfrac{\partial y_n}{\partial x_1} & \cdots & \dfrac{\partial y_n}{\partial x_n} \end{pmatrix}.

In words: row ii tells you how output yiy_i responds to a small nudge in each of the inputs simultaneously — the Jacobian is just "the gradient" generalized from one output to many.

The determinant of this matrix, detJ|\det J|, is the local stretch factor for volume. When changing variables inside an integral (which is exactly what happens when converting one probability density into another), you must multiply by this factor to keep total probability equal to one:

fY(y)=fX(x)detJ1,where x=g1(y).f_Y(y) = f_X(x)\,\left| \det J^{-1} \right|, \quad \text{where } x = g^{-1}(y).

In plain English: the new density isn't just the old density relabeled — it's rescaled by exactly how much the transformation locally compresses or expands space, so that probability mass is conserved rather than created or destroyed by the relabeling.

Worked example 1: price to log-return, one dimension

Let SS be a stock price with density fS(s)f_S(s), and define the log-return-like variable y=lnsy = \ln s, so s=eys = e^y. The one-dimensional Jacobian is dsdy=ey\frac{ds}{dy} = e^y. If fS(s)f_S(s) is (say) lognormal, then the correct density in yy is

fY(y)=fS(ey)ey.f_Y(y) = f_S(e^y)\cdot e^y.

Concretely, if at s=100s=100 the price density is fS(100)=0.004f_S(100)=0.004, then at y=ln(100)4.605y=\ln(100)\approx 4.605: fY(4.605)=0.004×100=0.4f_Y(4.605) = 0.004 \times 100 = 0.4. Forgetting the factor of ey=100e^y=100 here — just plugging s=eys=e^y into fSf_S without rescaling — would understate the log-return density by a factor of 100 at this point, and the resulting "density" wouldn't integrate to one.

Worked example 2: a two-variable rotation

Suppose (x1,x2)(x_1,x_2) are transformed to (y1,y2)(y_1,y_2) by y1=2x1+x2y_1 = 2x_1 + x_2, y2=x1+3x2y_2 = x_1 + 3x_2 — a linear stretch used, for instance, to decorrelate two risk factors. The Jacobian is constant:

J=(2113),detJ=2×31×1=5.J = \begin{pmatrix} 2 & 1 \\ 1 & 3 \end{pmatrix}, \qquad \det J = 2\times3 - 1\times1 = 5.

Every unit of area in (x1,x2)(x_1,x_2)-space becomes exactly 5 units of area in (y1,y2)(y_1,y_2)-space. So a joint density that integrated to 1 over xx-space must be divided by 5 when re-expressed in yy-space, everywhere, to still integrate to 1 — a single global correction here because the transformation is linear and the stretch factor doesn't vary from point to point.

Matrix explorer
dashed = before · solid = after
det 1.25trace 2.50λ 1.81, 0.69area scales by 1.25×

Set the matrix entries to (2, 1, 1, 3) as above and watch the unit square map to a parallelogram of area 5 — the determinant on screen is exactly the Jacobian determinant from the worked example.

x-space (uniform grid) g(x) y-space (unevenly stretched)
The same small square patch covers different amounts of area after transformation depending on where it sits — the Jacobian determinant is that local scaling factor, patch by patch.

What this means in practice

Jacobians are unavoidable anywhere a quant re-expresses a distribution or a model in different coordinates: converting a price distribution to a return distribution, changing probability measure (risk-neutral to real-world) via the Radon–Nikodym derivative, or transforming correlated risk factors into an uncorrelated basis for simulation. In numerical work, the Jacobian of a system of equations is also the engine behind Newton's method for solving several equations at once.

Changing variables rescales more than the labels — the Jacobian determinant tells you exactly how much a transformation locally stretches or shrinks volume, and any density or integral expressed in the new variables must be multiplied by this factor to stay consistent.

The classic mistake is substituting a new variable into a density formula and stopping there, forgetting the Jacobian factor entirely — treating fY(y)=fX(g1(y))f_Y(y) = f_X(g^{-1}(y)) as if that alone were the answer. Without the detJ1|\det J^{-1}| correction the result no longer integrates to one and silently misprices anything built on it, from a re-parameterized option payoff to a converted risk-factor simulation.

Related concepts

Practice in interviews

Further reading

  • Shreve, Stochastic Calculus for Finance II, ch. 1
  • Strang, Calculus, ch. 14
ShareTwitterLinkedIn