QQuant, Built

Act II · The Mathematical Toolkit

Part 5 of 43

Stochastic Calculus

Master'sstarts at this level65 min of film 21 chaptersprerequisites: Part 4

Why does calculus need a new rule once the path is Brownian, and why does that rule make hedging possible?

Brownian motion is built from coin flips until its roughness is visible: the squared increments do not vanish, they add up to elapsed time. That one fact is Ito's correction, and the part proves the lemma from it. With the lemma come stochastic differential equations and how to simulate them, the bridge from paths to PDEs (Feynman-Kac), Girsanov's theorem as re-weighted paths, and the martingale representation theorem, which is the reason a hedge exists at all. Jumps, self-exciting jumps and rough paths show where the Brownian picture ends.

What you need. Multivariable calculus and Part 4's martingales.

What you will be able to do

Undergraduate

  • Explain quadratic variation with a picture, and why dW squared behaves like dt.
  • Apply Ito's lemma to a function of geometric Brownian motion.

Master's

  • Solve and simulate the standard SDEs (GBM, Ornstein-Uhlenbeck, CIR), and state the strong orders of Euler and Milstein.
  • Move between an SDE, its Fokker-Planck equation and a Feynman-Kac expectation, and change drift with Girsanov.

PhD

  • Prove the central limit theorem for realized variance and state what jumps and noise do to it; define local time, fractional Brownian motion and the signature of a path.

Industry

  • Choose a discretization and a variance budget for a production simulator, and test it against an exact case.

Contents

Each chapter has a home level. Choose a track to see what to read and watch: Undergraduate 14 min · Master's 48 min · PhD 65 min · Industry 17 min.

  1. 0A hedge that cannot lose, and doesUndergraduate2 min
  2. 1Building Brownian motionUndergraduate4 min
  3. 2Quadratic variation, accumulatingUndergraduate3 min
  4. 3Constructing the Itô integral, and Stratonovich'sMaster's3 min
  5. 4Itô's lemma, provedUndergraduate3 min
  6. 5SDEs: existence, and how to simulate themMaster's3 min
  7. 6Mean reversion: solved and fittedMaster's3 min
  8. 7From paths to PDEs: Fokker–Planck and Feynman–KacMaster's4 min
  9. 8Girsanov: re-weighting pathsMaster's3 min
  10. 9Girsanov at work, and what it cannot changeMaster's3 min
  11. 10Martingale representation: why a hedge existsMaster's3 min
  12. 11Local time and Tanaka: the paradox resolvedPhD3 min
  13. 12Jumps: from Poisson to Lévy–ItôMaster's3 min
  14. 13Jumps in data, and the hedge they breakMaster's3 min
  15. 14Hawkes: jumps that cause jumpsMaster's3 min
  16. 15Fractional Brownian motion: memory and roughnessPhD3 min
  17. 16Rough paths and signaturesPhD3 min
  18. 17Industry: how desks build, test and run SDE modelsIndustry3 min
  19. 18Frontier: learning stochastic dynamics from dataPhD3 min
  20. For the researcher: the error in realized variancePhD5 min
  21. Recap, desk questions, problemsAll tracks3 min

Also on this page: Lecture · Key results · Try it · Lab · Problems · Reading · 中文 · Build the film.

Lecture

The text of each chapter is the film's narration, as it is spoken, so you can read along or revise without the film. The pictures are in the film. A dashed box stands for a number the film computes when it is rendered (hover over it to see what is computed); the README's figures for each chapter, where it lists them, follow the chapter's text.

A hedge that cannot lose, and doesUndergraduate2 min

We build the constructions and proofs, check them by simulation, and start with a hedging puzzle.

You have sold a call struck at a hundred and want to hedge it as cheaply as possible. Here is a strategy that looks free. Own one share whenever the stock is above the strike, and none when it is below. The share position matches the call’s exposure at expiry, but its cash account must also be funded. In an ideal continuous rule every switch seems to occur at the strike, so the total hedge looks free. Simulate it on four thousand paths. Trade weekly, daily, four thousand times a year: its average shortfall is about dollars at every sampling frequency. Individual paths differ; trading more often does not remove the average shortfall. dollars is the price of the call itself. Where does the money go? The answer is a quantity ordinary calculus has no name for, and it is the subject of this part.

How we got here. Bachelier modelled markets with Brownian motion in 1900; Wiener constructed its path measure in 1923; Itô its integral in 1944. Girsanov changed finite-horizon drift by reweighting paths. Option pricing followed in 1973; Carr and Jarrow resolved this hedge in 1990, and Lyons developed rough paths in 1998. In April 2020, negative oil prices made CME switch its energy-option margin model to Bachelier. From thirteen to four thousand rebalancing intervals a year: does the average shortfall shrink? No. The next chapters explain why.

The plan: Brownian motion and its calculus. Stochastic equations and their PDEs. Measure changes, representation and local time. Jumps and clustering. Roughness, signatures and their practical limits. Then industry models, a neural-SDE experiment and realized variance’s central limit theorem.

In the House, this part builds the simulation library every pricing desk will use, each routine tested against theory. It sits with the data desk until the volatility desk opens in Part ten.

1Building Brownian motionUndergraduate4 min

This chapter builds Brownian motion two ways, and proves the first thing it does. The definition: it starts at zero, its increments are independent and Gaussian with variance equal to the elapsed time, and its paths are continuous. Does such a thing exist? The first construction is a limit: a random walk with independent, identically distributed mean-zero, variance-one steps, time shrunk by n and space by root n. Three walks from the same random numbers: a coin, a uniform step, a lopsided step. At sixteen steps they differ. At four thousand they look similarly rough, but they are different paths. Donsker proved convergence in distribution of the interpolated paths to Brownian motion, not equality of these coupled samples.

Paul Lévy's construction builds the path directly, coarse to fine. Draw the endpoint at time one, a single Gaussian, and join it to the origin with a straight chord. Now fill in the midpoint. Given the two ends, the midpoint of a Brownian path is Gaussian, centred on the chord, with a variance of a quarter of the interval's length: Gaussian conditioning, the Brownian bridge. Displace every midpoint, then every quarter point, then every eighth, each level with half the variance of the last. The path crystallises. At level k the largest displacement is about the square root of k times two to the minus k over two, so the corrections are summable and the series converges uniformly: the limit is continuous, with exactly the right increments. Our twenty thousand draws put the midpoint variance at . Monte Carlo libraries build paths this way, the largest moves first, which suits quasi-random numbers, as Part sixteen shows.

What does the path do first? Ask for the chance that it reaches a level a by time T. Here is a path that crosses one. At the moment it first touches the level, the future is a fresh Brownian motion, independent of the past: the strong Markov property. So the path and its mirror image after that moment are equally likely. Split on where the path ends. Paths that touched the level and end below it are matched, one for one, by their mirrors, which end above it. So the chance of touching is twice the chance of ending above: two times one minus Phi of a over root T, the reflection principle. Differentiate in T and you get the first-passage density, which falls like t to the minus three halves, so slowly that the expected first-passage time is infinite. Check it on twenty thousand paths. Theory says ; the simulation says , a little low, because a path watched on a grid can cross between two looks. Broadie, Glasserman and Kou gave an asymptotic approximation for discrete monitoring: shift the barrier by about point five eight standard deviations of one step, and the formula gives . Part fifteen prices barrier options with it.

A pause. In a fair game in continuous time, what fraction of the time has one player most likely been ahead? Intuition says about half. The histogram is a U: percent of the paths spend less than a tenth, or more than nine tenths, of the time above zero, and only percent are near the middle. Lévy's arcsine law: a lead, once taken, tends to last. Brownian paths are continuous, and rough everywhere. Next: how rough, measured by quadratic variation.

Chapter (module): Building Brownian motion (s11_construct); What is shown, built or computed: Donsker with three step laws from the same random numbers; Lévy's midpoint construction to level 10 (bridge variance 0.251 against ¼); the reflection principle derived; P(max ≥ 1) = 0.3038 on 20,000 paths of 1,000 steps against 2(1 − Φ(1)) = 0.3173 and the Broadie–Glasserman–Kou shifted barrier 0.3085; the arcsine law (41% of paths spend < 10% or > 90% of the time above zero, 13% between 40% and 60%).

2Quadratic variation, accumulatingUndergraduate3 min

Quadratic variation, watched as it accumulates, and then proved. Draw one Brownian path, on a grid of two hundred and fifty-six steps, and keep three running totals over its steps: the sizes of the moves, their squares, and their cubes. The length races off the chart. The cubes barely leave the floor. The squares climb along the diagonal, close to the elapsed time. Now refine the grid, from sixteen steps to four thousand. The length grows like the square root of the number of steps: a Brownian path is infinitely long on every interval. The cubes vanish. The squares hug the line y equals t. That is what d W squared equals d t means: not a rule of algebra, but a sum of many small squares that has become deterministic.

The proof takes two lines. The expected sum of squared increments is the sum of the steps: T. Its variance: each squared increment has variance twice its step squared, so the variance of the sum is at most two T times the largest step, which goes to zero. And the length is at least the sum of squares divided by the largest move, which goes to zero because the path is continuous. Thus total variation is infinite. The usual integration theory for a bounded-variation integrator does not apply; some particular pathwise integrals still exist. We need a different general construction. A pause: sample twice as fast, and by how much does the spread of the estimate shrink? By the square root of two; four thousand paths agree at every grid. One more line, for real prices: noise on each observed price adds n extra squares, and the estimate grows with n instead of settling.

Try it on Bitcoin in 2020. If the price were a Brownian motion with constant volatility, the sum of squared returns would give the same answer at every sampling interval. Squared daily returns give a volatility of percent; squared one-minute returns give . Independent observation noise would add such a rise. If we attribute the entire one-minute versus one-day variance gap to that noise, its implied standard deviation is about basis points per observed log price. This is an illustrative decomposition, not an identified noise estimate: finite sampling and changing volatility also matter. Practitioners often sample every five minutes or so, a compromise between noise and too few observations, or they subsample: average across starting offsets to reduce sampling-phase variability. Averaging alone does not remove the leading noise bias; two-scale and kernel estimators do more. Part seven builds volatility forecasts on these sums. That accumulating variance is exactly what breaks ordinary calculus on these paths. Next: the integral that works.

Chapter (module): Quadratic variation, accumulating (s02_brownian); What is shown, built or computed: Three running sums drawn live on one path and refined from 16 to 4,096 steps; the L² proof; the QV estimate's spread against √(2/n) on 4,000 paths; Bitcoin's 2020 signature plot (80% at one minute, 71% at one day) and the illustrative iid observation-noise standard deviation implied by attributing the entire gap to noise, 3.5 basis points per observed log price.

3Constructing the Itô integral, and Stratonovich'sMaster's3 min

A Brownian path has infinite total variation, so ordinary bounded-variation integration is not a general solution. Itô built a different one, easiest to see as a ledger of bets. On top, the price. In the middle, a position: here, as many units as the price itself, decided at the start of each period and held through it. Each period the price moves, the position earns position times move, and the gains drop into a running total at the bottom. That sum is the Itô integral of a simple integrand. Trade sixty-four times instead of eight, and the total converges to a half of W squared minus a half: not the half W squared of ordinary calculus.

Now the construction. Square the sum and take expectations. The squares give the position squared times the step. Each cross term pairs an earlier gain, H j times delta W j, with a later position H k, all of them known at the start of step k, times the later move, whose mean given everything known then is zero. So the cross terms vanish, and the mean square of the gain is the integrated squared position: the Itô isometry. That is how a hedger's risk is measured: by how much is held, for how long. An isometry preserves distance. Staircases that converge to an integrand give integrals that form a Cauchy sequence in mean square, and the limit is the Itô integral, for a predictable integrand whose integrated square has finite expectation. Each simple sum is a martingale, and conditional expectations survive mean-square limits, so the limit is a martingale too. Under these integrability conditions, predictable trading gains have mean zero. No-arbitrage pricing also needs a pricing measure and admissible strategies; Part nine supplies them.

On one path, evaluate the price at the left end of each step, Itô's choice, or at the midpoint, Stratonovich's. The left sums settle at , the midpoint sums at . The gap is half the quadratic variation: the midpoint peeks half a step ahead.

The rule connecting them: Stratonovich's integral is Itô's plus half the covariation. So a Stratonovich equation is an Itô equation with an extra drift, a half b times b prime. Which is right? A pause: start X at one, and smooth the noise in d X equals X d W. What is its mean at time one? For this smooth scalar equation and the usual piecewise-linear noise approximations, Wong and Zakai’s limit is the Stratonovich solution. On twenty thousand paths the smoothed equation gives , the square root of e, while Euler's Itô scheme gives . The appropriate convention comes from the model and its approximation. Self-financing financial positions use Itô’s predictable convention. With the integral in hand, we need its chain rule. Next: Itô's lemma.

Chapter (module): Constructing the Itô integral (s03_ito); What is shown, built or computed: The integral as a ledger of bets; the isometry and martingale property proved; completion; left against midpoint sums (−0.330 and +0.170); Stratonovich's conversion; Wong–Zakai on 20,000 paths: the smoothed ODE gives E X₁ = 1.674 ± 0.016 (e^½ = 1.649), Euler's Itô scheme 1.015 ± 0.010.

4Itô's lemma, provedUndergraduate3 min

Here is the lemma as a picture: a surface, x squared times a decaying exponential, and a Brownian path lifted onto it. At each step, ordinary calculus predicts the next height from the tangent plane: the time slope times the time step, plus the space slope times the move. The curvature in the price direction gives a positive leading correction. Time and mixed terms can have either sign on a finite step. Stack the residuals in the red column. For a smooth path they would be of the order of the step squared, and the column would stay empty. Here it fills, steadily, toward the white bar: half the integral of the second derivative. The misses are not noise. They add up to a drift, and that drift is Itô's extra term.

Flattened: the stacked misses end at , against ; the gap is the discretisation error of four hundred steps. With two Brownian motions correlated at minus point seven and the function x times y, the misses come from the cross term and pile up to the covariation: the product rule, seen happening.

Now the proof. On each step, expand the function to second order: the time slope times the time step, the space slope times the move, half the curvature times the move squared, and a remainder. Replace each squared move by its time step. The error is a sum of terms with mean zero, orthogonal because their past-measurable coefficients multiply conditionally centered squared increments, each with variance two times the curvature squared times the step squared: the same computation as for quadratic variation, so it vanishes in mean square. Localize to bounded paths. For a C-one-two function, uniform continuity of the derivatives makes the summed Taylor remainder vanish in probability; bounded third derivatives give the simpler cubic bound. What is left is Itô's lemma: the first-order terms, plus half the curvature times d t. With two processes, the same argument produces a cross term, the mixed derivative times the covariation, which for two Brownian motions is rho d t. And f equal to x times y gives the stochastic product rule, which solves the Ornstein-Uhlenbeck equation and proves Girsanov's theorem.

Consequences. The lemma solves geometric Brownian motion: its log grows at mu minus half sigma squared. On twenty thousand paths with ten percent drift and forty percent volatility, the mean log return is , the volatility drag, while the log of the mean return is . Paul Lévy's characterization: a continuous local martingale starting at zero, with quadratic variation t, is Brownian motion. Dambis, Dubins and Schwarz represent its increment from the initial value as Brownian motion on the quadratic-variation clock; stop that Brownian path at the clock’s terminal value, extending the space if necessary. A desk classic: the expected fourth power of W at time t? Three t squared, by the lemma; the simulation gives at t equals one. The lemma solves a few equations exactly. Most must be simulated. Next.

Chapter (module): Itô's lemma, proved (s12_lemma, 3D); What is shown, built or computed: A Brownian path lifted onto z = x²e^{−t/4}; the misses above the tangent plane stack to 0.928 against ½∫f_xx = 0.885; with ρ = −0.7 and f = xy they stack to −0.693 (the covariation, −0.7); the proof; the multivariate lemma and the product rule; GBM's drag (E log S₁ = 0.021 against μ − σ²/2 = 0.020); Lévy's characterization, Dambis–Dubins–Schwarz; E W₁⁴ = 3.013.

5SDEs: existence, and how to simulate themMaster's3 min

Stochastic differential equations: when they have solutions, and how to compute them. Does d X equals sine of X d t plus a half cosine of X d W have exactly one solution? Itô answered in 1951 with Picard iteration. Start with a constant guess. Plug it into the right-hand side, integrate along the one Brownian path we have, and repeat. The iterates snap together: the largest gap falls from to in four rounds, and to a millionth in nine. Doob's inequality and the isometry make the gaps shrink like a power over a factorial. Global spatial Lipschitz and linear-growth bounds, with square-integrable initial data, give a unique strong solution. The coefficients in this example satisfy those bounds. Tanaka’s equation, d X equals sign of X d W with X initially zero and sign of zero defined as one, has a weak solution but no strong solution driven by that Brownian motion.

To compute a solution, step it forward. Here is the House's code. Euler-Maruyama: the drift times the step, plus the volatility times the Brownian increment, exactly the left-point sum of chapter three. Milstein adds one line, in gold. Where does it come from? Inside a step the volatility itself moves. Expanded by the lemma, it changes by b prime times b times the Brownian move so far, and integrating that against d W gives chapter three's left-point integral: half the squared increment minus the step. Run both on geometric Brownian motion, where the exact solution is known path by path, with twenty thousand paths shared between the two schemes, so that their errors can be compared path by path.

The step shrinks from a quarter to one two-hundred-and-fifty-sixth, and each scheme's error at time one is plotted as it arrives. A pause: halve the step, and by how much does Euler's path error shrink? Only by the square root of two: strong order one half, measured at . The reason is the term Euler drops, half b b prime times the squared increment minus the step: it has size of order the step, but it is a martingale sum, so its errors add in quadrature to the square root of the step. Milstein keeps it, and buys strong order one: . For sufficiently smooth payoff expectations and regular coefficients, both schemes have weak order one. The dropped term’s zero mean is part of the explanation; nonsmooth payoffs need separate analysis. So choose by the question: prices need weak accuracy, hedging simulations strong. And strong order, a property of single paths, also sets the cost of averages: it decides how well multilevel Monte Carlo works, Part sixteen's subject. Next: two equations every desk simulates, the mean-reverting ones.

Chapter (module): SDEs: existence and simulation (s13_schemes); What is shown, built or computed: Picard iteration on one path (gaps 1.13 → 0.011 in four rounds, 1.7·10⁻⁶ in nine); Itô's 1951 theorem; strong against weak solutions; lab: euler_maruyama, milstein; Milstein's term derived; strong orders 0.50 and 0.93, weak 0.99 and 1.00. MLMC in one line (Part 16).

6Mean reversion: solved and fittedMaster's3 min

Mean reversion: the Ornstein-Uhlenbeck and Cox-Ingersoll-Ross processes, solved exactly and fitted to Treasury bills.

Interest rates are pulled back. Here is the three-month bill rate since 1954, and Oldřich Vasicek's 1977 model: the rate drifts toward theta at speed kappa, plus noise, the Ornstein-Uhlenbeck process. The House simulates it exactly: each month the gap to theta shrinks by e to the minus kappa d t, and a Gaussian of exactly the right variance is added. Two hundred paths from the 1954 rate, with parameters estimated from the entire 1954–2020 history. This is a retrospective model illustration, not a forecast available in 1954. The fan settles into a fixed Gaussian, mean percent, spread , as theory says, with percent below zero.

Why the recipe is exact. Multiply by e to the kappa t and apply the product rule; the factor is smooth, so there is no covariation term. Integrate: the long-run level, plus the starting gap decaying exponentially, plus a stochastic integral of a deterministic function. That integral is Gaussian, with variance from the isometry, settling at sigma squared over two kappa. A pause: a rate starts far above theta. When is it halfway back? At log two over kappa: about years with the fitted kappa.

Cox, Ingersoll and Ross removed the negative rates in 1985: let the noise shrink with the square root of the rate. Near zero the noise dies and the pull wins. This process can also be sampled exactly. Its transition law is a scaled non-central chi-square, because the square-root process is a squared Bessel process of dimension four kappa theta over sigma squared, run on a different clock and scaled; its long-run law is a Gamma distribution. Does it touch zero? William Feller's boundary test, from 1951, says zero is unattainable exactly when two kappa theta over sigma squared is at least one: equivalently, when the Bessel dimension is at least two, the dimension in which a Brownian motion never returns to the origin. A regression puts the ratio at , and the paths kiss the floor, as American bill rates did in 2009 and 2020. But a regression is not the likelihood.

Now use exact CIR transition densities. Our observations are monthly averages, floored at a small positive value, rather than exact monthly point observations. This is a transition-based pseudo-likelihood for that transformed series, and the House maximizes it by Nelder-Mead from five starts, one of them the regression estimate. On the right, the log-likelihood climbing, the starts as a band and the regression's value dashed. On the left, the fitted long-run Gamma density morphing over sixty-seven years of rates. The five starts reach essentially the same objective, evidence of numerical agreement rather than a proof of a global maximum, and the Feller ratio moves from to Part nineteen fits rate models to bond prices instead. A simulated path is one view of an SDE; a PDE is the other. Next: why they are the same thing.

Chapter (module): Mean reversion: solved and fitted (s04_meanrev); What is shown, built or computed: Lab: ou_exact, 200 paths from 1954's bill rate (terminal mean 4.09%, sd 3.18%, 10% below zero); OU solved by an integrating factor; CIR's non-central χ² law and Feller's test (regression: ν = 0.58); replay: exact-transition pseudo-likelihood on floored monthly DTB3 averages from five starts, log-likelihood 3,635.3 against 3,633.3 for the regression; ν = 0.99.

7From paths to PDEs: Fokker–Planck and Feynman–KacMaster's4 min

One path is random; its population distribution follows a deterministic equation. A finite simulated cloud still has sampling noise. Here are forty CIR paths on the floor, time running away from us, all starting at four percent. Above them, their density: a surface that rises from a spike and spreads as time passes. It obeys the Fokker-Planck equation, derived next. Look at the edge where the rate is zero. With the fitted parameters nu is below one, and probability piles up against the floor: a wall. Lower the volatility until nu equals two, and the same edge pinches to zero. The density near zero scales as the rate to the power nu minus one; zero is inaccessible already at nu at least one. Nu equal to two is a clear example on that inaccessible side, not the threshold. Looking down the time axis, each slice is the histogram of the paths stopped at that moment.

The derivation starts from the generator: for a smooth test function phi, the drift times its slope, plus half the squared volatility times its curvature. By Itô's lemma, phi of X changes by the generator times d t plus a Brownian term with mean zero, so the expected value of phi of X changes at the rate of the expected generator: Dynkin's formula in differential form. Write that expectation as an integral against the density p, and integrate by parts twice, once for the slope and twice for the curvature, to move every derivative from phi onto a times p and onto b squared times p. The boundary terms vanish because phi has compact support. The identity holds for every test function, so the density itself obeys the Fokker-Planck equation: the time derivative of p equals minus the slope of the drift flux plus half the curvature of the variance flux. It is carried forward by the adjoint of the generator.

Now backwards. Follow the discounted value of a function u along a path. Its drift is u's time derivative plus the generator minus the rate. If u solves that equation, with the payoff as final condition, with the regularity and integrability that make the stochastic integral a true martingale, today’s value is the expected discounted payoff: the Feynman-Kac formula, from 1949. For Vasicek, an exponential-affine guess turns it into two ordinary differential equations. Twenty thousand rate paths price a ten-year bond at ; the formula says : . But from December 2020's bill rate the model's ten-year yield is percent, against an actual 0.93: using historical parameters as pricing parameters amounts to an extra zero-risk-premium assumption, and this curve misses the observed yield. Part nineteen specifies the pricing measure and calibrates to the curve.

A pause: Brownian motion starts at zero. How long, on average, until it leaves the interval from minus one to two? First stop at the exit time or a fixed horizon, whichever comes first. Dynkin with f equal to x squared gives an expected stopped time bounded by four. Monotone convergence gives a finite expected exit time; bounded stopped positions then justify passing to the actual exit. The exit point is two with probability one third, so the time is a times b: two. Simulated: , the small excess being the overshoot of a discrete path. Expectations depend on the probabilities. Next: how to change them, by re-weighting paths.

Chapter (module): From paths to PDEs (s14_pde, 3D); What is shown, built or computed: The CIR density surface over a path fan (density wall at ν = 0.58, a pinch example at ν = 2; the accessibility threshold is ν = 1; L¹ 0.038 against 20,000 exact paths); Fokker–Planck derived; Feynman–Kac proved; Vasicek's bond ODEs; Monte Carlo 0.8717 ± 0.0012 against the closed form 0.8709; the model's 10-year yield 1.38% against the actual 0.93% (Dec. 2020); Dynkin: E τ = 2.013 ± 0.013 for (−1, 2).

8Girsanov: re-weighting pathsMaster's3 min

Here is the theorem as a picture. Three hundred Brownian paths with no drift, in amber, the colour of the real-world measure P; their endpoints form a histogram centred at zero. Now turn a dial theta from zero to one. The paths do not move. Instead each path's weight becomes Z, the exponential of theta times its endpoint minus half theta squared. Paths that ended high grow heavy and violet, the colour of the new measure Q; paths that ended low fade. The weighted histogram slides to a Gaussian centred at theta: over two hundred thousand paths, the weighted mean endpoint is . On the right, the honest way to get drift: every path moved up by theta t. Its histogram is the same. Re-weighting paths and moving them give the same distribution.

The proof starts from Part four's coin. On a grid, the likelihood ratio of drifting against driftless increments is a product of ratios of Gaussian densities; completing the square gives the exponential of theta times the increments minus a half theta squared times the steps. In the limit that is Z, which by the lemma solves d Z equals theta Z d W: a stochastic exponential, a martingale with mean one. Cameron and Martin had it in 1944 for deterministic shifts. Girsanov's step: subtract the drift from W, giving W tilde, and multiply by Z. By the product rule, the minus theta Z d t from W tilde cancels the plus theta Z d t from the covariation exactly. For a general predictable drift, localize the product, which is a local martingale under P. Bayes’s rule and localization transfer the local martingale property to Q: the Q-expectation of a later value, given the past, is the P-expectation of Z times that value, divided by Z now, whenever the conditional expectations are integrable. Thus W tilde is a local martingale under Q; its quadratic variation is still t; and by Lévy's characterization it is a Brownian motion. One condition: Z must have mean one. Novikov’s finite exponential-moment condition is sufficient, not necessary. If Z is a strict local martingale instead, its terminal density has mass less than one. Constant theta satisfies Novikov on every finite horizon.

When does it fail? A pause: under P, what is the expected value of Z? One, when Novikov's condition holds; two hundred thousand samples give . Now let the horizon grow, with theta a half. For large samples the effective fraction approaches the population moment ratio, e to the minus theta squared T. In this sample it is percent of them at T equals sixteen; at sixty-four, the population approximation would give less than one effective path, while the empirical formula gives about thirty-three. Its large-sample approximation has broken down. The measured weights average only . On an infinite horizon the two measures are singular: one infinitely long path reveals its drift. Girsanov works on finite horizons, which is all that pricing needs. Next: Girsanov at work.

Chapter (module): Girsanov: re-weighting paths (s05_girsanov); What is shown, built or computed: 300 paths re-weighted and recoloured by Z, against the same paths moved (weighted mean endpoint 0.998 for θ = 1); the proof from Part 4's coin through the product rule and Lévy; Novikov; effective sample size 0.78, 0.36, 0.025, 0.0003 at T = 1, 4, 16, 64 against e^{−θ²T}, and the weights' sampled mean falling to 0.75 despite a theoretical expectation of one at every finite horizon.

9Girsanov at work, and what it cannot changeMaster's3 min

Girsanov is also a computational tool. Price a digital option paying one dollar if a stock now at a hundred ends the year above a hundred and sixty. Almost no simulated path gets there. The House's version: shift every Gaussian draw so the typical path ends at the strike, and multiply each payoff by the likelihood ratio that undoes the shift, Girsanov's Z for one Gaussian. Run it with twenty thousand draws.

Watch the two estimates race, path by path, each with a band of two standard errors. The plain estimate sits at zero for the first few hundred paths, then jumps every time a rare path pays, and its band stays wide. The re-weighted one locks onto the exact price almost at once: half its paths now pay, each with a small weight. Both are unbiased, but the variance is times smaller: one re-weighted path is worth about plain ones. The shift was chosen by eye, to put the typical path at the strike; how to choose it optimally, and when re-weighting backfires, is Part sixteen's subject. Importance sampling is one common rare-event tool; its variance benefit depends on the event and the chosen change of measure.

Now the limit of the theorem: it changes drift, never volatility. In a noiseless constant-parameter geometric Brownian model, simulate a year of one-minute prices, twenty percent volatility and eight percent drift, and estimate both as the year unrolls. The volatility estimate, from squared returns, settles within days. The drift estimate wanders across tens of points all year. The volatility estimate's error shrinks with the number of observations, half a million of them. The drift estimate depends only on the first and last prices, so its error shrinks only with the length of history. Two hundred simulated years: for the drift, against hundredths of a point for the volatility. A pause: sample every second instead of every minute; which estimate improves? Only the volatility.

This asymmetry is the root of option pricing. Take two models that differ only in volatility, twenty and twenty-one percent. The quadratic variation of the log price is a property of one path: one model says it is four hundredths per year with certainty, the other says that is impossible. The measures are singular: no likelihood ratio connects them. Two models that differ only in drift are equivalent, and Girsanov's Z converts one into the other. In the complete, frictionless Black–Scholes model, replication removes the physical drift mu from a derivative’s no-arbitrage price. Measure equivalence alone does not prove that conclusion for an incomplete market. The risk-neutral measure of Parts nine and ten swaps the drift for the riskless rate and keeps sigma. If the price does not depend on the drift, the hedge must remove it. Next: why a hedge exists at all.

Chapter (module): Girsanov at work (s15_sampling); What is shown, built or computed: Lab: is_digital (0.00707 ± 0.00008 against exact 0.00714; plain 0.0074 ± 0.0006; variance ÷52), the two estimates racing; one year of one-minute GBM: σ̂ sd 0.0002, μ̂ sd 0.18 over 200 years; why complete Black–Scholes replication removes μ from prices.

10Martingale representation: why a hedge existsMaster's3 min

Why does a hedge exist at all? Take a payoff that depends on a Brownian path: here, W at time one, squared. Its conditional expectation given the path so far is a martingale: W squared plus the time remaining, because the future increment adds its variance and nothing else. Watch the path and that martingale unroll together. Now a trader who starts with the payoff's expected value, one, and holds two W units of the Brownian asset, rebalancing eight times. The green line marks the trader's wealth between rebalances. It wanders near the martingale but misses at the end, by the red gap. Rebalance five hundred and twelve times, and the wealth lies on top of the martingale; the gap all but vanishes. The payoff is a trading strategy. Every square-integrable payoff in the augmented natural Brownian filtration has such a representation. Turning it into a stock hedge also requires tradable assets spanning that Brownian risk.

The proof idea is short. Work in the augmented natural Brownian filtration. First, exponentials with deterministic step-function integrands are integrals: by the lemma, a stochastic exponential is one plus a stochastic integral. Second, they are rich enough: a variable orthogonal to all of them has zero Fourier transform at every finite set of times, so it is zero. Third, the isometry: limits of integrals are integrals. So every square-integrable payoff is its mean plus a stochastic integral, and every Brownian martingale a running integral: the martingale representation theorem. It says a hedge exists, not what it is. For Malliavin-differentiable square-integrable payoffs, Clark and Ocone gave the formula: the expected Malliavin derivative, the payoff's sensitivity to a bump in the path at time t. For a discounted stock payoff, converting this Brownian exposure into shares gives the delta hedge of Part ten. For W cubed it is three times the sum of W squared and the time remaining.

How fast does a discrete hedge converge? Five seeds of four thousand paths each, rebalanced from eight to two thousand times. For W squared, the hedge error is exactly the quadratic-variation error of chapter two: the payoff minus the hedge's final wealth is the sum of the squared increments minus T. So its spread is the square root of two over n, slope minus a half, and the bands sit on that line. A Black-Scholes call hedged with its delta converges at the same rate, minus a half: between rebalances the book earns half gamma times the squared move minus its theta, and those mismatches are again a quadratic-variation error, as Part eleven will explain. Now break the theorem's assumption. Let the payoff depend on a second, independent Brownian motion B, and hedge with W alone, using the best position in W. The error The market is incomplete, and Parts eleven and thirteen live there. A pause: four times as many trades. The spread halves. But one hedge refuses to converge: the one from the start of this part. Next, the paradox resolved.

Chapter (module): Martingale representation (s16_representation); What is shown, built or computed: E[W₁² ∣ 𝓕_t] and the hedge 2W at n = 8 and 512; the proof through exponentials; Clark–Ocone; hedge-error slopes −0.50 (W²), −0.49 (a call), −0.02 (a second noise: the market is incomplete).

11Local time and Tanaka: the paradox resolvedPhD3 min

Itô's lemma needs two derivatives, and the absolute value has a kink at zero. Hiroshi Tanaka's idea, in 1963, was to round it off. Inside a band of half-width epsilon, replace the kink by a parabola. Its second derivative is one over epsilon on the band: the red box, whose area is always two. Apply the lemma: the second-order term is one over two epsilon times the time spent in the band. Shrink epsilon. The band thins, the box grows taller, and the term converges: the local time at zero. The absolute value of W is the integral of its sign, plus local time. The same limit at every level gives an occupation density.

Watch it on one path. As it runs, the purple sandpile records the time spent at each level, growing sideways; local time at zero is the pile's height at the dashed line. It grows only while the path is near zero. On a fine path, the time-in-band estimates settle toward Tanaka's value, , as epsilon shrinks. A pause: what is the expected local time at zero by time one? Take expectations in Tanaka's formula: the expected absolute value of W, about ; twenty thousand paths agree. And Lévy showed that local time has the law of the running maximum.

Back to the opening puzzle, with zero rates, no dividends and the stock starting at the strike. A call's payoff has the same kink, at the strike, and Tanaka's formula, applied to the price, says what happens there. The payoff equals its starting value, plus the gains from holding one share whenever the stock is above the strike, which is exactly the stop-loss hedge, plus one more term. That term is half the local time at the strike: how long the path spent within a hair of K, measured in quadratic variation, and rescaled by the hair's width. For a smooth path it would be zero. After hitting the strike, a nondegenerate diffusion returns repeatedly; local time then accrues. It is zero at the instant of a first hit. Take expectations under the pricing measure. The gains term has mean zero, so the missing term is worth the call's price minus its intrinsic value: its time value. Peter Carr and Robert Jarrow published this resolution in 1990. The hedge is free only on paths that never come near the strike.

Across four thousand paths: the hedge's shortfall against half the local time at the strike. They line up, with a correlation of . Paths that never came near the strike cost nothing; paths that lingered there cost a lot. On average the shortfall is the call's whole time value, about dollars, at every frequency. Local time is real money: it is why options near the strike close to expiry are the hardest to hedge, and Dupire's local volatility, in Part twelve, uses the same term. Local time is what a continuous path costs a hedger. Real prices also jump. Next.

Chapter (module): Local time and Tanaka (s06_localtime); What is shown, built or computed: Tanaka derived by smoothing the kink (ε shrinking live); the occupation sandpile; E L₁⁰ = 0.792 (occupation) and 0.796 (Tanaka) against √(2/π) = 0.798; Carr–Jarrow; shortfall against ½L^K, correlation 0.97.

12Jumps: from Poisson to Lévy–ItôMaster's3 min

Brownian paths are continuous; prices are not always. News arrives in lumps. The simplest model of a lump is a Poisson clock, ringing at random times with independent exponential gaps. Each ring adds one to a counter, a staircase that climbs on average at rate lambda, so it is not a martingale. Subtract the average climb, lambda t, and it is: the compensated Poisson process, a sawtooth. Its quadratic variation is the counter itself, since a jump of one, squared, is still one. Attach a random size to each ring and you have a compound Poisson process; its characteristic function follows by conditioning on the count, and fifty thousand paths give a mean of and the predicted variance. A pause: at six jumps a year, the chance of a month with none? E to the minus a half: sixty-one percent.

A Lévy process has stationary independent increments, stochastic continuity and a right-continuous version with left limits. It is built from four layers. Here is one path of a tempered stable process, with infinitely many small jumps and big ones, taken apart. A drift. A Brownian part. The big jumps, a compound Poisson process. And, in this infinite-variation example, small jumps whose sum requires compensation. Other Lévy measures can have summable small jumps without that subtraction. Slide the cutoff epsilon toward zero: jumps become , the compensator grows, and the strip turns from sparse spikes into something almost Brownian. This is the Lévy-Itô decomposition. The layers are independent, so their characteristic functions multiply: the Lévy-Khintchine formula. For the finite-cutoff law, twenty thousand draws agree to , the sampling noise of twenty thousand draws.

Itô's lemma extends to jumps with one honest change. Between jumps the path is continuous, so the old lemma applies, with the quadratic variation of the continuous part. At a jump, the first-order term guesses the change linearly, f prime times the jump; replace that guess by the true change of f. For example, take f equal to e to the x: at a jump of size y the price is multiplied by e to the y, not by one plus y. Apply this to Merton's 1976 model, Brownian motion plus a compound Poisson process of Gaussian log-price jumps, or equivalently log-normal price multipliers. To keep the expected return at mu, the drift must pay back the average jump: lambda times k bar, where k bar is the mean of e to the y minus one. These are its paths: diffusion most of the time, and gaps now and then. The next chapter looks for such gaps in real prices, and shows what they do to a hedge.

Chapter (module): Jumps: Poisson to Lévy–Itô (s07_jumps); What is shown, built or computed: The Poisson clock and its compensator; compound Poisson checked on 50,000 paths; the Lévy–Itô layer cake of a tempered stable path (2 → 1,183 small jumps as ε goes from 0.3 to 0.005); Lévy–Khintchine checked (max error 0.011); Itô for jumps; Merton.

13Jumps in data, and the hedge they breakMaster's3 min

Do real prices jump? Quadratic variation sees diffusion and jumps alike: the sum of squared returns converges to the integrated variance plus the sum of the squared jumps, as the compensated Poisson process of the last chapter showed. Ole Barndorff-Nielsen and Neil Shephard found a sum that ignores the jumps: products of neighbouring absolute returns, scaled by pi over two, because the mean absolute value of a standard Gaussian is the square root of two over pi. A jump appears in only two products, each time beside a small diffusive return of order the square root of the step, so its contribution vanishes as the sampling gets finer. Under the relevant high-frequency assumptions their difference estimates jump variation. At hourly resolution, scaling by a past-week bipower estimate gives an outlier diagnostic, not a proof that a path is discontinuous.

Take Bitcoin's hourly returns for three years and divide each by the bipower volatility of the week before it, which a single jump barely moves. If these standardized returns were exactly standard Gaussian with a known scale, the histogram would follow the green curve, and you would expect hours beyond five standard deviations in three years. There were , about a year, spread evenly across the three years, and those hours alone carry percent of all the variance. These are flagged hours, not identified jumps. Continuous stochastic volatility, heavy tails and scale-estimation error can also create such outliers. Their squared-return share is not a separately estimated jump quadratic variation.

What do jumps do to a hedge? Sell a three-month at-the-money call and delta-hedge it with the Black-Scholes delta at the diffusion's volatility, rebalancing from thirteen to four thousand times a year, on ten thousand paths. Without jumps, the spread of the error falls like one over the square root of the number of trades, as in chapter ten. Add Merton's jumps, six a year with a mean log-jump of minus five percent, and the error : at four thousand rebalances it is times the jump-free error. The reason is one line of Itô's formula for jumps. At a jump of relative size J, the hedged book gains or loses half gamma times S squared times J squared, plus higher terms. A position in the stock is linear in J and cannot offset a quadratic, and no single delta is right for jumps of two different sizes: two unknowns, one instrument. The market is incomplete, and the risk-neutral measure is no longer unique: the Esscher transform is one choice among many. A pause: rebalance every second, and does the jump error vanish? No. A jump happens between two trades, however close they are. Part eleven hedges with options instead. And jumps in real markets cluster. Next: jumps that cause jumps.

Chapter (module): Jumps in data, and the hedge they break (s17_jumpdata); What is shown, built or computed: Bipower variation derived; Bitcoin 2018–2020: 204 hourly outliers beyond 5 estimated local sd against a standard-Gaussian benchmark of 0.015, accounting for 24% of squared returns; not identified jumps; a delta hedge on 10,000 Merton paths: no-jump error slope −0.49, the jump error stalls at 2.66 (24× the no-jump error at 4,000 rebalances).

14Hawkes: jumps that cause jumpsMaster's3 min

Large moves cluster: one makes another more likely soon after. Alan Hawkes wrote down a process with that property in 1971: its intensity jumps by alpha after every event and decays back toward a base rate mu at speed beta. Yosihiko Ogata's thinning, from 1981, simulates it in a dozen lines. Between events the intensity only decays, so its current value is an upper bound: draw a candidate from a Poisson clock at that bound. Accept it with probability true intensity over bound. The yellow dots are accepted and kick the red curve up; the grey ones fall through. Fifty runs over two thousand days give a mean count of , against the stationary large-horizon approximation of .

The same process can be seen as families. Immigrants arrive at the base rate mu, and every event, immigrant or not, has children: a Poisson number of them, with mean n equal to alpha over beta, the total mass of the kernel, called the branching ratio. Redraw the events as a family tree, generation by generation, each child hanging from its parent. Taking expectations, the long-run rate satisfies lambda bar equals mu plus n times lambda bar, so it is mu over one minus n, which exists only if n is below one: above one a family has positive probability of never dying out; at one it dies out almost surely but its expected size is infinite. A family's mean size is one plus n plus n squared and so on, one over one minus n, and here the simulated families average , against .

Now fit it to the hours since 2018 when Bitcoin moved more than four times its recent volatility. The log-likelihood is the sum of log intensities at the events minus the integrated intensity, computed in one pass by Ozaki's recursion. The House maximizes it from eight random starts: the log-likelihood climbs on the right, the Poisson clock's value dashed, and the fitted intensity takes shape on the left. All eight starts reach essentially the same fitted objective; this is a numerical check, not a global-optimum guarantee. The branching ratio is , and the excitement halves in about hours.

Is the fit any good? Run the clock at the fitted intensity: measure time by the integrated intensity instead of the calendar. Under a correct model the clustered events slide apart into an even rain, a unit-rate Poisson process: the point-process cousin of chapter four's Dambis-Dubins-Schwarz clock. Compare the rescaled gaps with exponential quantiles. These are in-sample diagnostics: parameters were fitted to these events and the event times are rounded to hours, so the nominal KS p-values are not calibrated model-validation tests. On the record, Hardiman, Bercot and Bouchaud, at Capital Fund Management, estimated a branching ratio near one for E-mini futures; heavy-tailed, nearly critical Hawkes scaling limits can produce rough volatility, in Part fourteen. A pause: with branching ratio , what long-run fraction is assigned to offspring by this fitted stationary Hawkes model? About percent. That is a latent model decomposition, not proof that one observed market move caused another. Nearly critical clustering leaves memory in volatility. Next: a process with memory built in.

Chapter (module): Hawkes: jumps that cause jumps (s18_hawkes); What is shown, built or computed: Lab: Ogata's thinning, candidates shown (mean count 1,312 against 1,333); the branching tree (mean family 3.43 against 3.33); replay: the Bitcoin fit from eight starts (n = 0.36, half-life 7.6 h; log-likelihood −506 against −588); time-rescaling: nominal in-sample KS p = 0.83 for Hawkes, 6·10⁻¹⁴ for Poisson; estimated parameters and hourly rounding prevent a calibrated acceptance test.

15Fractional Brownian motion: memory and roughnessPhD3 min

Brownian increments are independent. In 1968 Benoit Mandelbrot and John Van Ness generalised them: fractional Brownian motion, whose increments over a lag have variance equal to the lag to the power two H. Here is one path, built from the same random numbers at every H, as a dial turns H down from point nine five. At high H the increments are positively correlated and the path trends. At a half, highlighted, it is Brownian motion. Below a half, neighbouring increments are negatively correlated, and the path becomes a jagged scrawl.

Mandelbrot and Van Ness wrote it as a Brownian integral with a power-law memory kernel: every past shock still matters. The sum of squared increments on a grid of n steps is n to the power one minus two H. On two hundred paths it blows up for H point three and vanishes for point seven; only Brownian motion lands on one. For H below a half the quadratic variation diverges; above a half it is zero but total variation is infinite, also ruling out a semimartingale. Rogers’s arbitrage result concerns an ideal frictionless market with sufficiently flexible trading; costs and trading restrictions change the conclusion. Nothing forbids volatility from being rough. A pause: at H point one, is a rise more likely to be followed by a fall? Yes: the neighbouring correlation is .

How do you simulate it exactly? Increments of fractional Brownian motion are a stationary Gaussian sequence with a known covariance. Davies and Harte embedded that covariance in a circulant matrix, whose eigenvalues are a Fourier transform of its first row. Multiply complex Gaussian noise by the square roots of the eigenvalues, transform back, and the increments come out with exactly the right covariance, in n log n operations instead of the n cubed of a Cholesky factor. The House's test checks that the Hurst estimator recovers H from paths made this way.

How rough is volatility? Measure Bitcoin's volatility each day from five-minute returns, for days, and take logs. For fractional Brownian motion, the average q-th power of the changes grows with the lag at exponent q times H: a line through the origin. Bitcoin's points lie on such a line with slope about , far below a half. In 2018 Gatheral, Jaisson and Rosenbaum found H near a tenth for stock indices: "Volatility is rough".

Now the caveat, computed. Rama Cont and Purba Das argued in 2024 that measured volatility can look rough when the true volatility is not. Simulate five hundred days with an ordinary Ornstein-Uhlenbeck log volatility, with local Brownian regularity H equal to a half, mean-reverting in a week, a price every second and five basis points of noise, and measure it as we did Bitcoin. So a low H in data fits roughness, and also fast mean reversion seen through a coarse lens; Part fourteen takes up the debate with option prices. Fractional Brownian motion is not a semimartingale, so Itô's calculus fails on it. Next: a calculus for sufficiently enhanced paths of finite p-variation.

Chapter (module): Fractional Brownian motion (s08_rough); What is shown, built or computed: The H dial (one random vector, H from 0.95 to 0.05); Mandelbrot–Van Ness; p-variation; not a semimartingale (Rogers); lab: fbm (Davies–Harte); Bitcoin H ≈ 0.15; the Cont–Das caveat computed: an ordinary OU log-volatility with local Brownian regularity gives Ĥ = 0.26 from the true variance and 0.24 from noisy 5-minute RV.

16Rough paths and signaturesPhD3 min

Why does integration need more than the path? Terry Lyons's example: a path running in tiny fast circles, radius one over n, n squared radians a unit of time. Seen from above, it shrinks to a point as n grows. Feed it to a simple equation whose third coordinate integrates Y one d X two minus Y two d X one. Turn the camera to the side: the solutions are helices whose shadows shrink while their height still climbs to about one. The height is twice the Lévy area the path sweeps, and a small circle swept fast accrues area at a constant rate. Thus the solution map is not continuous in the uniform norm of the driving path alone. Rough-path continuity uses an enhanced path and its p-variation metric. For p between two and three, increments and area suffice; rougher signals require higher iterated integrals.

A pause. Right then up, or up then right: same start, same end, same increments. Which statistic tells them apart? The signed area to the chord: plus a half and minus a half. Kuo-Tsai Chen studied the iterated integrals that make up a path’s signature; level one is the increment, level two contains the area. Chen's identity: joining paths multiplies signatures, and a straight segment's signature is the tensor exponential of its increment. The levels shrink factorially. And products of linear functions of the signature are again linear, so Stone-Weierstrass gives uniform approximation on suitable compact sets where signatures separate paths. Include time and fix the starting point to remove ambiguities from reparametrization and tree-like pieces.

Here is the House's signature, exactly as the identity reads. Start with the signature of nothing: one, then zeros. For each straight segment, build its tensor exponential level by level, each level the previous one times the increment, divided by k, and multiply it into the running signature with Chen's product. Run it on the unit square traversed once: the increments are zero, and the area is one. A batched version computes it for twenty thousand paths at once, three hundred and sixty-three numbers per path at depth five, which the experiment needs.

Now learn with it: twenty thousand paths of two correlated assets plus time, and linear regressions on the truncated signature, scored on unseen simulated paths over five overlapping train-validation-test splits. Two checks: the average price is exactly linear in level two, and so is the area between the assets; at depth two both reach an R squared of , while a linear regression on both assets at all sixty-five timestamps explains percent of the area. Then an Asian call, a nonlinear function of the average. Scrub through the depths: the predictions tighten onto the diagonal. The raw path manages . Signatures are nonlinear features of the same raw paths, not extra observations. They return in the next two chapters, and in Parts fourteen, seventeen and forty-two. Next: how desks build, test and run these models.

Chapter (module): Rough paths and signatures (s19_signature, 3D); What is shown, built or computed: Lyons' helix (‖X‖ = 1/n → 0, Y³₁ → 1); Chen's identity, the shuffle product, universality; lab: signature; replay: ridge regression on signatures of 20,000 two-asset paths, depth 1–5: the average and the Lévy area exact at depth 2 (R² = 1.000; the raw path explains 0.4% of the area), the Asian call 0.618 → 0.980 at depth 4, 0.951 at depth 5 (worse test performance, consistent with excess complexity), against 0.795 for the raw path.

17Industry: how desks build, test and run SDE modelsIndustry3 min

How exchanges, brokers, clearing houses and banks actually use this calculus, from the public record.

The crisis file. On the twentieth of April 2020, with storage at Cushing, Oklahoma, filling up, the May oil future settled at minus thirty-seven dollars and sixty-three cents a barrel; the Cushing spot price on FRED reads . Geometric Brownian motion says that cannot happen: the log of a negative number does not exist. Bachelier's arithmetic Brownian motion crosses zero without noticing. CME Clearing moved options on WTI and related energy futures to the Bachelier model, effective the twenty-second of April, to allow negative prices and strikes, and moved back at the end of August. In a put, Black's formula stops at a zero futures price; Bachelier's carries on.

The firm file. In a settled order in September 2021, the Commodity Futures Trading Commission found that Interactive Brokers did not adequately prepare and configure its trading system to recognize negative prices, although it was on notice that they were possible. It imposed a penalty of one point seven five million dollars and restitution of eighty-two point five seven million, credited because the firm had already compensated customers. The firm reported a loss of about a hundred and four million. A state space is a modelling assumption, and here it was also a software assumption.

Clearing houses run this calculus every night. According to its filings with the Securities and Exchange Commission, the Options Clearing Corporation's margin system, STANS, calibrates a model for each risk factor, ties them together with a copula, and simulates ten thousand Monte Carlo scenarios per factor, then reprices every position in every scenario and uses the portfolio-loss distribution, together with stress and other adjustments, to set margin.

Itô's lemma is also a product. Apply it to the logarithm of the price. Rearranged, for a strictly positive continuous price with zero rates and dividends, quadratic variation of log price is twice the gain from holding one over S shares, minus twice the log return. And by Taylor's formula the log payoff is a forward plus puts and calls weighted by one over strike squared: the variance swap of Demeterfi, Derman, Kamal and Zou, and the idealized weights underlying Cboe’s VIX. Exact static replication assumes a full strike continuum and suitable integrability; quoted-strike and discrete-monitoring implementations introduce additional errors. On ten thousand Heston paths, the replication misses by ten-thousandths of variance with daily steps, and with ten times as many. Add jumps, and a bias appears, exactly chapter twelve's jump term: against a predicted .

Finally, who checks the models. American banks' model risk was supervised under SR 11-7, from 2011. On the seventeenth of April 2026 the Federal Reserve, the OCC and the FDIC replaced it with SR 26-2, which keeps effective challenge, conceptual soundness, ongoing monitoring, outcomes analysis and a model inventory, adds tailoring to materiality, is aimed mainly at banks above thirty billion dollars, and leaves generative and agentic AI outside its scope. The House's version is Rule 6: no simulator prices anything until it has reproduced a known answer. Here is this part's validation report. Last, the frontier.

Chapter (module): Industry (s20_industry); What is shown, built or computed: Crisis file: WTI, 20 April 2020; GBM against Bachelier; CME's switch; firm file: Interactive Brokers and the CFTC; OCC's STANS Monte Carlo margin; the variance swap as Itô's lemma (Heston replication sd 1.2 and 0.11 in 10⁻⁴; the jump bias −17.1 against −16.8 predicted); SR 11-7 → SR 26-2; the House's validation report.

18Frontier: learning stochastic dynamics from dataPhD3 min

Can a network learn the stochastic differential equation itself? Write the drift and the volatility of a two-dimensional hidden state as two small neural networks, and solve the equation by Euler, exactly as in chapter five: a neural SDE. Train it on thirty-two-day windows of Bitcoin's daily returns from 2018 and 2019, a thousand steps per seed, on one processor core. The loss compares distributions of paths, not single paths: the squared distance between the expected signatures, up to depth four, of real and generated windows. The signatures here include time, lead-lag cumulative returns and accumulated squared returns. They provide a training signal without a discriminator; matching these finite moments does not identify a unique data-generating SDE. Watch it learn, three seeds as a band. On the left, generated windows, violet, over real ones, grey: at the start they are almost flat; as training proceeds their spread and their wiggles grow toward the data's.

Then evaluate on 2020, which was excluded from gradient training. This is a chronological research split, not the series’ sealed post-2020 hold-out. The overlapping windows are dependent, and three seeds measure optimizer variation rather than a confidence interval. Three numbers: the signature distance to 2020's windows; the excess kurtosis of daily returns, the fat tails; and the correlation of absolute returns from one day to the next, the signature of volatility clustering. Two baselines at equal data: geometric Brownian motion fitted to the same two years, and a bootstrap that redraws past days at random, which keeps the tails but destroys any clustering. A small generator trained in minutes is not yet a market; the papers that follow train much larger ones. A pause: if a generator matches the expected signature up to depth four, does it match the distribution of the largest move in a window? Not necessarily: the expected signature pins down the law only with all its levels, and under growth conditions, as Chevyrev and Lyons showed.

Where the research is. Issa, Horvath, Lemercier and Salvi train neural SDEs with scoring rules built on the signature kernel, which compares all levels of the signature at once: our loss is its truncated, linear cousin, and their method needs no adversary. Cuchiero and coauthors write option prices as linear functions of the signature of a polynomial diffusion and calibrate to the S and P and the VIX at the same time, a problem classical models struggle with. Walker and coauthors put log-signatures and their Lie brackets inside sequence models. The roughness debate of chapter fifteen continues, with Cont and Das on one side, and Guyon and Lekeufack's finding that index volatility is mostly driven by past returns. Two open books cover signatures in finance. And in 2025 Degenne, Ledvinka, Marion and Pfaffelhuber formalized the construction of Brownian motion in the Lean theorem prover: chapter one's theorem, checked by a computer, with stochastic integrals announced as next.

Chapter (module): Frontier (s21_frontier); What is shown, built or computed: Replay: a neural SDE trained on Bitcoin by expected-signature matching, three seeds; scored on the 2020 research test against GBM and a bootstrap (see the numbers below); the 2023–2026 papers.

For the researcher: the error in realized variancePhD5 min

For the researcher: Chapter 2 measured quadratic variation from prices sampled finer and finer. How well, exactly? The answer is a central limit theorem, with an error bar from a single day's data.

The theorem. For a continuous Itô price with a continuous, locally bounded Itô-semimartingale volatility, observed without noise, sample log price n times a day and add up squared returns. Localize to meet the needed moment conditions. The error against the day's integrated variance shrinks like one over root n, and tends to a mixed normal: normal given the volatility path, with a variance of twice the integrated quarticity, the integral of sigma to the fourth. The quarticity is itself estimated from the fourth powers of the returns, and the studentized error converges to a standard normal. So a realized variance comes with a standard error, computed from the same day's data.

The proof is Part 5's machinery again. Write the error as a sum over intervals: each squared return, less the variance that accrued in it. By Itô's isometry each term has conditional mean zero, so the sum is a martingale. Over a short interval the return is close to normal, so its square, centred, has variance two sigma to the fourth over n squared. Add these up, scale by n, and the Riemann sum tends to twice the integrated quarticity. Freezing volatility on each small interval controls the remainder. Conditional Lindeberg and asymptotic orthogonality to the original driving martingales give the stable mixed-normal limit. Consistent quarticity estimation then permits studentization.

Check it on three thousand simulated days, each with clustering volatility and a U-shaped intraday pattern. At ten-minute sampling, thirty-nine returns a day, the ninety-five percent interval covers eighty-nine percent of days: the asymptotics have not quite arrived, and the studentized error is a little too wide. At five minutes it covers ninety-two; at one minute ninety-four; at ten seconds and at one second, ninety-five. And the error itself falls like one over root n, from twenty-seven percent of the day's variance at ten minutes to about one percent at one second.

At coarse sampling the raw statistic is skewed, and a simple transformation improves it without guaranteeing finite-sample coverage. Take logs. By the delta method the log of realized variance has the same limit, scaled by one over the integrated variance. Studentize it the same way. The raw statistic is skewed because its estimated quarticity rises and falls with the realized variance itself; in the log version that ratio is far steadier. On the same simulated days, the log interval covers ninety-two percent at ten minutes instead of eighty-nine, and the skewness falls from minus one point three to minus point four.

The theorem assumes two things real data break, and Part 7 takes both up on real prices. With independent, identically distributed mean-zero observation noise independent of the efficient price, expected realized variance gains two n times the noise variance and diverges as sampling gets finer. And jumps, whose squares it collects on top of the integrated variance. What the theorem guarantees is the baseline: under the stated regularity and noise-free assumptions, an asymptotically calibrated error bar from one day’s data. The coverage experiment shows why that is not a guarantee at coarse frequencies.

Three open questions. With noise the best possible rate is one over n to the quarter, and several estimators reach it, but when the noise is correlated with returns and trades arrive at irregular times, efficiency depends on the specified observation and noise model; results exist for important cases, with broader combinations still under study. If volatility is rough, as Part 14 will argue, its local paths can be rougher than the price path, and estimating the spot volatility itself converges very slowly. And telling a jump in the price from a jump in its volatility, or a jump shared by many assets, with finite data, is an active problem.

Pause and predict. A day's five-minute realized variance is four times ten to the minus four, and its realized quarticity two point four times ten to the minus seven. Give a ninety-five percent interval for the integrated variance, and for the day's volatility.

Use seventy-eight returns in a three-hundred-and-ninety-minute trading day. The estimated standard error is seven point eight times ten to the minus five. Add and subtract one point nine six standard errors: about two point five to five point five times ten to the minus four. Taking square roots gives daily volatility from one point six to two point four percent, around the two percent point estimate. This is an asymptotic interval, with the finite-sample limitations just measured.

Recap, desk questions, problemsAll tracks3 min

Part five in eleven lines. Iid centered finite-variance walks have a Brownian limit, and quadratic variation measures its roughness. Predictable square-integrable positions define the Itô integral; curvature gives its chain rule. Regularity conditions justify SDE solutions and simulation orders. Exact transition laws provide working models, with care about how rates are observed. Girsanov changes drift, while replication needs tradable risk spanning. Local time resolves the stop-loss puzzle. Jumps leave residual hedging risk; Hawkes describes clustering without identifying causation. Roughness estimates need caution, and enhanced paths and signatures record area and order. The research chapter adds asymptotic error bars, whose finite-sample coverage we measured.

Three desk questions, all classics. Brownian motion leaves an interval from minus a to b after an expected time a times b, by Dynkin's formula. The chance that Brownian motion hits plus one before minus two is two thirds, by optional stopping, exactly as for the walk in Part four. And a digital call in Black and Scholes is worth the discounted risk-neutral probability of finishing in the money: N of d two. Full solutions are in the notes.

And nine problems: the variations of Brownian motion, the two integrals of W against itself, Milstein's correction, the Vasicek distribution, a Hawkes process's long-run rate, the infinite mean of a first passage time, a Clark-Ocone integrand, and two at the level of a qualifying exam: realized variance's central limit theorem, and the bias that noise adds to it. Solutions, in English and Chinese, are in the notes.

Where this comes back. Girsanov and martingale representation are the step from the real world to the pricing world in Parts nine and ten. Local time and jumps explain hedging errors in eleven to thirteen. Mean reversion returns in the rates part, nineteen. Hawkes processes and rough volatility return in fourteen and thirty-six. And the simulation library, the schemes and signatures power the computing parts, fifteen to seventeen, and the machines of forty-two.

The textbook chapters this part covers, and the papers it draws on. Every number was computed by the series' own code: Bitcoin by the minute and by the hour from Binance, and Treasury bill yields and the oil price from the St. Louis Fed. One command rebuilds them all.

The House can now simulate almost anything, and its sixth rule stands: no desk prices with a simulator that has not first reproduced a known answer. The trial counter reads . Next, Part six: financial econometrics. How to estimate the parameters of these models from data that is short, noisy and overlapping, and how not to fool yourself while doing it.

Where it goes next. Ito and Girsanov derive Black-Scholes in Part 10; Hawkes processes return in the order book (Part 36); fractional Brownian motion returns as rough volatility (Part 14).

Key results

The part's results in one place, for revision.

Quadratic variation\[\sum_i (W_{t_{i+1}}-W_{t_i})^2\;\longrightarrow\;T\]
Ito's lemma\[df=\Bigl(f_t+\mu f_x+\tfrac12\sigma^2 f_{xx}\Bigr)dt+\sigma f_x\,dW\]
Girsanov\[\frac{d\mathbb Q}{d\mathbb P}=\exp\Bigl(-\int_0^T\theta_s\,dW_s-\tfrac12\int_0^T\theta_s^2\,ds\Bigr)\]
Feynman-Kac\[u(t,x)=\mathbb E\bigl[e^{-\int_t^T r\,ds}\,g(X_T)\mid X_t=x\bigr]\]

Try it

Lab 5 · Quadratic variation, and the order of a simulation scheme

Watch the sum of squared Brownian increments settle on T as the grid is refined, then measure the strong error of Euler and Milstein on geometric Brownian motion against the exact solution on the same path.

Figure produced by Lab 5: Quadratic variation, and the order of a simulation scheme
Produced by the lab below, seed 0, in 0.6 s. Simulated data.
python -m videos.quant.labs 5 needs numpy, scipy, matplotlib, numba · download lab05.py · source on GitHub
Quadratic variation, n = 8       0.974 +- 0.499 across paths
Quadratic variation, n = 16,384  0.999 +- 0.011   (theory: T = 1, sd sqrt(2/n) = 0.011)
Strong order, Euler              0.50   (theory 0.5)
Strong order, Milstein           0.93   (theory 1.0)

Milstein adds the (dW^2 - dt) term that Ito's lemma says cannot be dropped.
The code (47 lines; it asserts its own result)
"""Lab 5: quadratic variation piles up to T, and that is why Euler converges at one half and Milstein at one."""

import numpy as np

from videos.quant import labs
from explainer.quant.house import sim

TITLE = "Quadratic variation, and the order of a simulation scheme"
GOAL = ("Watch the sum of squared Brownian increments settle on T as the grid is refined, then measure the strong "
        "error of Euler and Milstein on geometric Brownian motion against the exact solution on the same path.")
TASKS = [
    "Compute the sum of |dW| (first variation) on the same grids. Where does it go?",
    "Run sim.scheme_orders with sigma = 0.8. Which scheme's constant suffers more?",
    "Simulate sim.fbm(H=0.1, ...) and repeat the quadratic-variation plot. What does it do, and why?",
]


def run(seed=0):
    T = 1.0
    dW, _ = sim.brownian(T, 2 ** 14, 200, seed=seed)
    levels = 2 ** np.arange(3, 15)
    qv = np.array([[np.sum(path.reshape(n, -1).sum(1) ** 2) for n in levels] for path in dW])
    orders = sim.scheme_orders(seed=seed)
    lab = labs.Lab()
    lab.row("Quadratic variation, n = 8", f"{qv[:, 0].mean():.3f} +- {qv[:, 0].std():.3f} across paths")
    lab.row("Quadratic variation, n = 16,384", f"{qv[:, -1].mean():.3f} +- {qv[:, -1].std():.3f}   (theory: T = 1, "
                                               f"sd sqrt(2/n) = {np.sqrt(2 / levels[-1]):.3f})")
    lab.row("Strong order, Euler", f"{orders['slope_strong_euler']:.2f}   (theory 0.5)")
    lab.row("Strong order, Milstein", f"{orders['slope_strong_milstein']:.2f}   (theory 1.0)")
    lab.note = "Milstein adds the (dW^2 - dt) term that Ito's lemma says cannot be dropped."
    assert abs(qv[:, -1].mean() - T) < 0.01 and abs(qv[:, -1].std() - np.sqrt(2 / levels[-1])) < 0.004
    assert abs(orders["slope_strong_euler"] - 0.5) < 0.1 and abs(orders["slope_strong_milstein"] - 1.0) < 0.1

    fig, ax = labs.figure(2, size=(11, 4.2))
    for row in qv[:40]:
        ax[0].plot(levels, row, color=labs.SPOT, lw=0.6, alpha=0.5)
    ax[0].axhline(T, color=labs.P, ls="--")
    ax[0].set_xscale("log", base=2)
    ax[0].set(title="Sum of squared increments, 40 paths", xlabel="number of steps n", ylabel="quadratic variation")
    ns = np.asarray(orders["n"])
    ax[1].loglog(T / ns, orders["strong_euler"], "o-", color=labs.LOSS, label=f"Euler, slope {orders['slope_strong_euler']:.2f}")
    ax[1].loglog(T / ns, orders["strong_milstein"], "o-", color=labs.GAIN,
                 label=f"Milstein, slope {orders['slope_strong_milstein']:.2f}")
    ax[1].set(title="Strong error E|X_T - S_T| on GBM", xlabel="step dt", ylabel="error")
    ax[1].legend()
    lab.fig = fig
    return lab

Now change it

  1. Compute the sum of |dW| (first variation) on the same grids. Where does it go?
  2. Run sim.scheme_orders with sigma = 0.8. Which scheme's constant suffers more?
  3. Simulate sim.fbm(H=0.1, ...) and repeat the quadratic-variation plot. What does it do, and why?

Problems, with solutions

Try each problem before opening its solution; the last two of each set are at qualifying-exam level.

Desk questions, with solutions

  1. Expected exit time from (−a, b). First apply Dynkin at τ∧t with f = x² (𝓛f = 1). Stopped positions are bounded, so E(τ∧t) ≤ max(a², b²). Monotone convergence gives Eτ < ∞; bounded convergence then yields E W_τ² = Eτ. The exit point is b with probability a/(a + b) and −a with probability b/(a + b), so E τ = b²·a/(a + b) + a²·b/(a + b) = ab. For (−1, 2): 2 (simulated 2.013 ± 0.013).
  2. Hit +1 before −2. W is a martingale, and stopped at the first exit from (−2, 1) it is bounded. By optional stopping, 1·p − 2(1 − p) = 0, so p = 2/3.
  3. A digital by Girsanov. The price is e^{−rT} E_Q[1{S_T > K}]. Under Q, by Girsanov, log S_T = log S₀ + (r − σ²/2)T + σW̃_T, so Q(S_T > K) = N(d₂) and the price is e^{−rT}N(d₂). Under P the same event has probability N(d₂ with μ in place of r): the drift changes, the volatility doesn't.

Problems, with worked solutions

  1. Variations. Show that \(\sum |\Delta W|\) over a grid of \(n\) steps on \([0, 1]\) has mean \(\sqrt{2n/\pi}\), and \(\sum (\Delta W)^2\) has mean 1 and variance \(2/n\).

    Solution

    Each ΔW is N(0, 1/n). Then E|ΔW| = √(2/(πn)), so E Σ|ΔW| = n√(2/(πn)) = √(2n/π) → ∞. Also E(ΔW)² = 1/n and Var((ΔW)²) = 2/n², so Σ(ΔW)² has mean 1 and variance 2/n → 0.

  2. ∫W dW. Compute \(\int_0^T W\,dW\) as a limit of left-point sums, and then of midpoint sums. Which one is a martingale in \(T\)?

    Solution

    Left points: Σ W_k ΔW_k = ½Σ(W²_{k+1} − W²_k) − ½Σ(ΔW_k)² → ½(W_T² − T). Midpoints in time: Σ W_{k+½}ΔW_k = ½(W_T² − T) + Σ(W_{k+½} − W_k)ΔW_k, and the last sum tends to ½T, giving ½W_T². Only the Itô integral ½(W_T² − T) is a martingale in T: its mean is zero for every T.

  3. Milstein. Derive Milstein's correction for \(dX = a\,dt + b(X)\,dW\) from It^o's lemma applied to \(b(X)\) over one step.

    Solution

    Over one step, X_{t+h} − X_t = ∫a ds + ∫b(X_s) dW_s, and b(X_s) ≈ b(X_t) + b'b(X_t)(W_s − W_t) by Itô to first order. So ∫_t^{t+h} b(X_s) dW_s ≈ b ΔW + b'b ∫(W_s − W_t)dW_s = b ΔW + ½ b'b (ΔW² − h).

  4. Vasicek. For Vasicek, show that \(r_T\) is Gaussian and find its mean and variance. What is the long-run probability of a negative rate with the fitted \(\kappa = 0.099\), \(\theta = 4.1\%\), \(\sigma = 1.4\%\)?

    Solution

    r_T = θ + (r₀ − θ)e^{−κT} + σ∫e^{−κ(T−s)}dW_s is Gaussian, with mean θ + (r₀ − θ)e^{−κT} and variance σ²(1 − e^{−2κT})/(2κ). In the long run it is N(θ, σ²/2κ): sd 0.014/√0.197 = 3.2%, so P(r < 0) = N(−4.1/3.2) ≈ 10%, as the lab's 200 paths show (10% below zero).

  5. Hawkes. A Hawkes process has \(\mu = 0.1\), \(\alpha = 0.8\), \(\beta = 2\) (per day). What is its long-run rate? What fraction of events are triggered by earlier ones?

    Solution

    In stationarity E[λ] = μ + (α/β)E[λ], so the rate is μ/(1 − α/β) = 0.1/(1 − 0.4) ≈ 0.167 a day. Each event triggers α/β = 0.4 children on average, so a fraction 0.4 of all events are triggered by earlier ones (the cluster size is 1/(1 − 0.4)).

  6. E τ_a = ∞. From the first-passage density \(f_{\tau_a}(t) = \frac{a}{\sqrt{2\pi t^3}}e^{-a^2/2t}\), show that \(\mathbb{E}\,\tau_a = \infty\) although \(P(\tau_a < \infty) = 1\).

    Solution

    P(τ_a < ∞) = lim_{T→∞} 2(1 − Φ(a/√T)) = 1. But f(t) = a(2πt³)^{−½}e^{−a²/2t} ~ a(2π)^{−½}t^{−3/2} for large t, so E τ_a = ∫ t f(t) dt diverges like ∫ t^{−1/2} dt.

  7. Clark–Ocone for W_T³. Compute the Clark–Ocone integrand of \(F = W_T^3\), and check it with It^o's lemma.

    Solution

    D_tW_T³ = 3W_T², so H_t = E[3W_T² ∣ 𝓕_t] = 3(W_t² + T − t). Check: by Itô, W_T³ = ∫3W²dW + ∫3W dt, and ∫_0^T W_t dt = ∫_0^T (T − t) dW_t (integration by parts), so W_T³ = ∫_0^T 3(W_t² + T − t) dW_t, with mean zero as it should be.

  8. (qual) Realized variance's CLT. (qual) For \(dX = \sigma_t dW\) with deterministic continuous bounded \(\sigma_t\) and positive integrated quarticity, prove \(\sqrt n(\mathrm{RV}_n - \int\sigma^2) \Rightarrow N(0, 2\int\sigma^4)\) by the Lindeberg CLT.

    Solution

    With deterministic continuous bounded \(\sigma\) and positive integrated quarticity, \(\Delta_iX \sim N(0, v_i)\) independently, \(v_i = \int_{(i-1)/n}^{i/n}\sigma^2\). Then \(\xi_i = (\Delta_iX)^2 - v_i\) are independent, mean zero, \(\operatorname{Var} \xi_i = 2v_i^2\), and \(n\sum 2v_i^2 \to 2\int\sigma^4\) (a Riemann sum, \(v_i \approx \sigma^2_{i/n}/n\)). Lyapunov's condition holds since \(E\xi_i^4 = 60v_i^4\), so \(\sum E\xi_i^4/(\sum 2v_i^2)^2 = O(1/n) \to 0\); hence \(\sqrt n(\mathrm{RV}_n - \mathrm{IV}) \Rightarrow N(0, 2\int\sigma^4)\).

  9. (qual) Noise. (qual) For a driftless efficient martingale price, add independent iid mean-zero noise \(\varepsilon\) of variance \(\omega^2\), show \(\mathbb E\,\mathrm{RV}_n(Y) = \mathbb E\,\mathrm{IV} + 2n\omega^2\) and \(\mathrm{RV}_n(Y)/2n \to \omega^2\).

    Solution

    For a driftless square-integrable efficient-price martingale and iid mean-zero noise independent of that price, \(\mathrm{RV}_n(Y) = \mathrm{RV}_n(X) + 2\sum\Delta_iX\,\Delta_i\varepsilon + \sum(\Delta_i\varepsilon)^2\). The middle term has mean zero (independence), and \(E\sum(\varepsilon_i - \varepsilon_{i-1})^2 = 2n\omega^2\), so \(E\,\mathrm{RV}_n(Y) = E\,\mathrm{IV} + 2n\omega^2\). Dividing by \(2n\), the first two terms vanish and the last is an average of a 1-dependent stationary sequence with mean \(2\omega^2\), so the law of large numbers gives \(\mathrm{RV}_n(Y)/2n \to \omega^2\): the noise variance is estimable from the finest data, which TSRV uses.

The pause question of the research chapter. \(\operatorname{se} = \sqrt{2\,\mathrm{RQ}/n} = \sqrt{2 \times 2.4 \times 10^{-7}/78} = 7.8 \times 10^{-5}\), so IV \(\in [2.5, 5.5] \times 10^{-4}\), a daily volatility between 1.6% and 2.4% (point estimate 2.0%).

Reading and notes

The part's papers

from READING.md

  • Wiener, N. (1923). "Differential space." Journal of Mathematics and Physics.
  • Itô, K. (1944). "Stochastic integral." Proc. Imperial Academy Tokyo; (1951) "On stochastic differential equations." Memoirs of the AMS.
  • Cameron, R., Martin, W. (1944). "Transformations of Wiener integrals under translations." Annals of Mathematics.
  • Kac, M. (1949). "On distributions of certain Wiener functionals." Transactions of the AMS.
  • Girsanov, I. V. (1960). "On transforming a certain class of stochastic processes by absolutely continuous substitution of measures." Theory of Probability and Its Applications.
  • Stratonovich, R. L. (1966). "A new representation for stochastic integrals and equations." SIAM J. Control.
  • Mandelbrot, B., Van Ness, J. (1968). "Fractional Brownian motions, fractional noises and applications." SIAM Review.
  • Hawkes, A. G. (1971). "Spectra of some self-exciting and mutually exciting point processes." Biometrika.
  • Ogata, Y. (1981). "On Lewis' simulation method for point processes." IEEE Trans. Information Theory.
  • Carr, P., Jarrow, R. (1990). "The stop-loss start-gain paradox and option valuation." RFS.
  • Chen, K.-T. (1957). "Integration of paths, geometric invariants and a generalized Baker–Hausdorff formula." Annals of Mathematics.
  • Lyons, T. (1998). "Differential equations driven by rough signals." Revista Matemática Iberoamericana.
  • Chevyrev, I., Kormilitzin, A. (2016). "A primer on the signature method in machine learning." arXiv.
  • Bachelier, L. (1900). Théorie de la spéculation. Annales scientifiques de l'École normale supérieure.
  • Lévy, P. (1948). Processus stochastiques et mouvement brownien. Gauthier-Villars.
  • Donsker, M. (1951). "An invariance principle for certain probability limit theorems." Memoirs of the AMS 6.
  • Feller, W. (1951). "Two singular diffusion problems." Annals of Mathematics.
  • Tanaka, H. (1963). "Note on continuous additive functionals of the 1-dimensional Brownian path." Z. Wahrscheinlichkeitstheorie.
  • Wong, E., Zakai, M. (1965). "On the convergence of ordinary integrals to stochastic integrals." Annals of Mathematical Statistics.
  • Dambis, K. E. (1965); Dubins, L., Schwarz, G. (1965). Continuous martingales as time-changed Brownian motions.
  • Clark, J. M. C. (1970). "The representation of functionals of Brownian motion by stochastic integrals." Annals of Mathematical Statistics.
  • Novikov, A. A. (1972). "On an identity for stochastic integrals." Theory of Probability and Its Applications.
  • Milstein, G. N. (1974). "Approximate integration of stochastic differential equations." Theory of Probability and Its Applications.
  • Merton, R. C. (1976). "Option pricing when underlying stock returns are discontinuous." Journal of Financial Economics.
  • Vasicek, O. (1977). "An equilibrium characterization of the term structure." Journal of Financial Economics.
  • Ocone, D. (1984). "Malliavin's calculus and stochastic integral representations of functionals of diffusion processes." Stochastics.
  • Cox, J., Ingersoll, J., Ross, S. (1985). "A theory of the term structure of interest rates." Econometrica.
  • Broadie, M., Glasserman, P., Kou, S. (1997). "A continuity correction for discrete barrier options." Mathematical Finance.
  • Rogers, L. C. G. (1997). "Arbitrage with fractional Brownian motion." Mathematical Finance.
  • Demeterfi, K., Derman, E., Kamal, M., Zou, J. (1999). "A guide to volatility and variance swaps." Journal of Derivatives.
  • Barndorff-Nielsen, O., Shephard, N. (2004). "Power and bipower variation with stochastic volatility and jumps." Journal of Financial Econometrics.
  • Filimonov, V., Sornette, D. (2012). "Quantifying reflexivity in financial markets: toward a prediction of flash crashes." Physical Review E.
  • Hardiman, S., Bercot, N., Bouchaud, J.-P. (2013). "Critical reflexivity in financial markets: a Hawkes process analysis." European Physical Journal B; arXiv 1302.1405.
  • Jaisson, T., Rosenbaum, M. (2016). "Rough fractional diffusions as scaling limits of nearly unstable heavy tailed Hawkes processes." Annals of Applied Probability.
  • Gatheral, J., Jaisson, T., Rosenbaum, M. (2018). "Volatility is rough." Quantitative Finance.
  • Frontier (2023–2026): Issa, Z., Horvath, B., Lemercier, M., Salvi, C. (2023). "Non-adversarial training of neural SDEs with signature kernel scores." NeurIPS, arXiv 2305.16274. Cuchiero, C., Gazzani, G., Möller, J., Svaluto-Ferro, S. (2025). "Joint calibration to SPX and VIX options with signature-based models." Mathematical Finance 35(1), arXiv 2301.13235. Walker, B., McLeod, A. D., Qin, T., Cheng, Y., Li, H., Lyons, T. (2024). "Log neural controlled differential equations: the Lie brackets make a difference." ICML, arXiv 2402.18512. Cont, R., Das, P. (2024). "Rough volatility: fact or artefact?" Sankhyā B 86, arXiv 2203.13820. Guyon, J., Lekeufack, J. (2023). "Volatility is (mostly) path-dependent." Quantitative Finance 23(9). Bayer, C., Friz, P., Fukasawa, M., Gatheral, J., Jacquier, A., Rosenbaum, M. (2023). Rough Volatility. SIAM. Bayer, C., dos Reis, G., Horvath, B., Oberhauser, H. (eds.) Signature Methods in Finance. Springer Finance (open access). Cass, T., Salvi, C. (2024). "Lecture notes on rough paths and applications to machine learning." arXiv 2404.06583. Degenne, R., Ledvinka, D., Marion, E., Pfaffelhuber, P. (2025). "Formalization of Brownian motion in Lean." arXiv 2511.20118. Earlier: Gierjatowicz, P., Sabate-Vidales, M., Šiška, D., Szpruch, L., Žurič, Ž. "Robust pricing and hedging via neural SDEs." J. Computational Finance, arXiv 2007.04154; Kidger, P. et al. (2021). "Neural SDEs as infinite-dimensional GANs." ICML.
  • Industry and regulation: CFTC press release 8432-21 (28 September 2021), Interactive Brokers; CME Clearing Advisories 20-152, 20-171 and 20-320 (2020), the Bachelier switch and its reversal; SEC Release No. 34-90763 (2020) on OCC's STANS margin methodology; Interactive Brokers press release (21 April 2020) and Form 10-Q for Q2 2020; Federal Reserve SR 11-7 (2011) and SR 26-2 (Fed, OCC and FDIC, 17 April 2026), "Revised Guidance on Model Risk Management".

Papers and sources

Papers

Every paper on Part 5's list in READING.md appears on screen: Wiener (1923, hook); Itô (1944, ch. 3; 1951, ch. 5); Cameron–Martin (1944, ch. 8); Kac (1949, ch. 7); Girsanov (1960, hook and ch. 8); Stratonovich (1966, ch. 3); Mandelbrot–Van Ness (1968, ch. 15); Hawkes (1971, ch. 14); Ogata (1981, ch. 14 lab); Carr–Jarrow (1990, ch. 11); Chen (1957, ch. 16); Lyons (1998, ch. 16); Chevyrev–Kormilitzin (2016, the reference card; the reading guide: the gentlest introduction to signature features). Added this pass, all on screen: Bachelier (1900), Lévy (1948), Donsker (1951), Feller (1951), Tanaka (1963), Wong–Zakai (1965), Dambis–Dubins–Schwarz (1965), Clark (1970), Novikov (1972), Merton (1976), Vasicek (1977), Ocone (1984), Cox–Ingersoll–Ross (1985), Broadie–Glasserman–Kou (1997), Rogers (1997), Demeterfi–Derman–Kamal–Zou (1999), Barndorff-Nielsen–Shephard (2004), Hardiman–Bercot–Bouchaud (2013), Gatheral–Jaisson–Rosenbaum (2018); the frontier (Issa et al. 2023; Cuchiero et al. 2025; Walker et al. 2024; Cont–Das 2024; Guyon–Lekeufack 2023; Rough Volatility, SIAM 2023; Signature Methods in Finance; Cass–Salvi 2024; Degenne et al. 2025; Gierjatowicz et al.; Kidger et al. 2021).

Industry sources, checked against the primary documents: CFTC press release 8432-21 (28 September 2021: $1.75 million penalty, $82.57 million restitution credited, the May WTI contract's −$37.63 settlement); Interactive Brokers' press release of 21 April 2020 (provisional loss ≈ $88 million) and Form 10-Q for Q2 2020 (≈ $104 million); CME Clearing Advisories 20-152, 20-171 (Bachelier from the 22 April 2020 margin cycle, for negative prices and strikes) and 20-320 (back to Black-76/Whaley from 31 August 2020); SEC Release No. 34-90763 (2020) on OCC's STANS ("large-scale Monte Carlo simulations", 10,000 scenarios per risk factor); FRED DCOILWTICO (−36.98 on 20 April 2020); SR 11-7 (2011) and SR 26-2 (Fed, OCC and FDIC, 17 April 2026; its attachment, footnote 3, excludes generative and agentic AI from scope). Adjoint Greeks (Giles–Glasserman 2006, Danske Bank) and STAC-A2 belong to Part 16, MLMC and the optimal importance-sampling shift too.

For the researcher

  • The theorems. Jacod (1994) and Barndorff-Nielsen and Shephard (2002) for the CLT, stable convergence (Jacod and Shiryaev, ch. IX); Barndorff-Nielsen and Shephard (2004) for bipower variation; Huang and Tauchen (2005); Zhang, Mykland and Aït-Sahalia (2005) for TSRV; Barndorff-Nielsen, Hansen, Lunde and Shephard (2008) for realized kernels; Jacod, Li, Mykland, Podolskij and Vetter (2009) for pre-averaging; Aït-Sahalia and Jacod, High-Frequency Financial Econometrics (2014).
  • Simplifications. The proof sketch assumes no drift (it is negligible at the \(\sqrt n\) scale) and continuous paths; the jump test's false-alarm rate here is inflated by the intraday volatility pattern, which robust versions correct.
  • Open problems. Efficient estimation under endogenous, autocorrelated noise and irregular times; spot volatility when volatility is rough; volatility jumps and co-jumps.
Textbook audit
Book · section Where
Shreve II 3.2–3.4 (scaled walks, BM, QV, volatility of GBM) ch. 1, 2
Shreve II 3.5–3.7 (Markov, first passage, reflection) ch. 1 (reflection, first passage), ch. 7 (Markov through the generator)
Shreve II 4.2–4.3 (Itô integral) ch. 3
Shreve II 4.4, 4.6 (Itô–Doeblin, multivariable, Lévy's characterization) ch. 4
Shreve II 4.5 (BSM) Part 10
Shreve II 4.7 (Brownian bridge) ch. 1 (Lévy's construction is the bridge)
Shreve II 5.2–5.3 (Girsanov, martingale representation) ch. 8, 9, 10
Shreve II 5.4–5.6 (fundamental theorems, dividends, forwards) Part 9
Shreve II 6.2–6.5 (SDEs, Markov, interest-rate models, multidimensional FK) ch. 5, 6, 7; rate models → Part 19
Shreve II 7–10 (exotics, American, numéraire, term structure) Parts 15, 8/10/16, 9/19/22, 19
Shreve II 11.2–11.5 (Poisson, compound Poisson, jump integrals, Itô for jumps) ch. 12
Shreve II 11.6–11.7 (change of measure for jumps; a call with jumps) ch. 13 (Esscher, incompleteness); Part 13
Øksendal 2 (construction, Kolmogorov extension and continuity) ch. 1 (Lévy's construction; Kolmogorov–Chentsov named)
Øksendal 3 (Itô integral, Stratonovich) ch. 3
Øksendal 4 (Itô formula, martingale representation) ch. 4, 10
Øksendal 5 (existence and uniqueness; weak and strong) ch. 5
Øksendal 6 (filtering) Part 7 (state-space models)
Øksendal 7 (diffusions, generator, Dynkin) ch. 7
Øksendal 8 (Kolmogorov backward, Feynman–Kac, time change, Girsanov) ch. 7, 4 (Dambis–Dubins–Schwarz), 8
Øksendal 9 (Dirichlet problems) the gentle stochastic video; Dynkin in ch. 7
Øksendal 10–12 (optimal stopping, control, finance) Parts 8, 9–10
Karatzas–Shreve 1 (martingales, Doob–Meyer) Part 4
Karatzas–Shreve 2 (BM: construction, strong Markov, reflection, arcsine) ch. 1
Karatzas–Shreve 3.1–3.4 (integration, change of variables, representation, time change) ch. 3, 4, 10
Karatzas–Shreve 3.5 (Girsanov, Novikov) ch. 8
Karatzas–Shreve 3.6–3.7 (local time, Tanaka, Lévy's identity) ch. 11
Karatzas–Shreve 4 (BM and PDEs, FK) ch. 7
Karatzas–Shreve 5 (strong and weak solutions, Feller's test, linear SDEs) ch. 5, 6
Karatzas–Shreve 6 (Lévy's theory of local time, excursions) ch. 11 (Lévy's identity); excursion theory is not core to finance and is left to the book
Cont–Tankov 2–3 (Poisson, compound Poisson, Poisson random measures, Lévy–Itô, Lévy–Khintchine) ch. 12
Cont–Tankov 4–5 (building Lévy processes, multidimensional) Part 13
Cont–Tankov 6 (simulation) ch. 12 (compound Poisson, series truncation); Part 16
Cont–Tankov 7 (Lévy processes and returns) ch. 13
Cont–Tankov 8 (stochastic calculus for jumps, Esscher) ch. 12, 13
Cont–Tankov 9–10 (pricing, incompleteness, quadratic hedging) ch. 13 (incompleteness, computed); Parts 11, 13
Björk 4–5 (stochastic integrals, SDEs, generator, Kolmogorov, FK) ch. 3, 4, 5, 7
Friz–Hairer 1–3 (rough paths, BM as a rough path) ch. 16; deeper in Part 14
Friz–Hairer 8+ (RDEs, regularity structures) beyond the series
Data, scope and reproducibilityData and reproducibility
  • Binance BTCUSDT one-minute candles for 2019–2020 (and 2020 for the signature plot) and one-hour candles for 2018–2020, each monthly file checked against Binance's SHA-256; Bitcoin's daily returns for the neural SDE are the hourly closes at 00:00 UTC.
  • FRED DTB3 (3-month bill), 1954–2020; DGS10 read for one date; DCOILWTICO (Cushing WTI spot), March–May 2020: one new entry in videos/quant/data/manifest.json, fetched and checksummed by explainer/quant/data.py.
  • Registered with the trial counter: the Hawkes fit, the rough-volatility Hurst estimate, the CIR exact MLE and the neural SDE (its 2020 hold-out is inside the research window).
  • Compute: about 40 CPU-minutes in all (the neural SDE, three seeds of 1,000 steps, is most of it; it resumes from its partial file if killed).

Data, scope and reproducibilityInterpretation and reproducibility boundaries
  • The trading examples use idealized, frictionless models. A fixed position still produces changing marked wealth between rebalances; the fine-grid replay preserves every saved rebalance value. The stop-loss illustration has zero rates and dividends; its approximately eight-dollar shortfall is a mean across paths, not a fixed loss on every path. The table counts rebalancing intervals, not realized position changes. Tanaka's occupation formula for a general price uses quadratic variation rather than calendar time.
  • Donsker gives convergence in distribution for iid centered finite-variance steps, not equality of coupled sample paths. Itô's isometry and the true-martingale conclusion require finite expected integrated squared positions. Martingale representation uses the augmented natural Brownian filtration and square-integrable claims; a stock hedge also needs tradable risk spanning. Clark–Ocone requires Malliavin regularity. Simulation orders need their regularity assumptions, including smooth payoffs for the stated weak order.
  • DTB3 inputs are monthly averages, floored at 1e-5 for the CIR fit. Exact transition densities therefore give a pseudo-likelihood for this transformed series, not an exact observation likelihood for monthly averages. Parameters estimated over 1954–2020 generate retrospective illustrations. The Feller accessibility threshold is nu = 1; nu = 2 is a density-shape example. The transition-density histogram retains mass outside the plotted window: its displayed mass is 0.9945 versus 0.994566 analytically, with L1 discrepancy about 0.038. The registry's original CIR computation is preserved.
  • Girsanov's density must be a true mean-one martingale; Novikov is sufficient, not necessary. Constant drift satisfies it on every finite horizon even when Monte Carlo weights are poorly sampled. At T=64, the empirical ESS is about 33 of 100,000 paths; the population-moment approximation would be below one and is unreliable at this sample size. Changing drift does not by itself establish drift-independent option prices in incomplete markets.
  • Bitcoin's hourly threshold flags are outliers, not identified discontinuous jumps. Gaussian counts assume a known correct scale. Signature-plot noise estimates assume a decomposition; offset averaging alone does not remove the leading observation-noise bias. Hawkes branching fractions are latent model assignments, not identified market causation. The fitted-model KS p-values are nominal in-sample diagnostics affected by parameter estimation and hourly timestamps.
  • The illustrative Lévy–Itô path uses a seed selected to show three large jumps; it is not an unbiased random-path exhibit. Its independent 20,000-draw characteristic-function check validates the finite-cutoff law at epsilon=0.005, not the untruncated process.
  • The Mandelbrot–Van Ness constant is chosen so Var(B_1^H)=1, with a two-sided Brownian driver. OU volatility has local Brownian regularity, not differentiably smooth paths. Small estimated H over finite lags does not identify local path regularity. Rough-path integration requires finite p-variation and an enhancement, with higher levels needed for rougher drivers. Signature approximation requires compactness and separation; time augmentation and a fixed start resolve the relevant path ambiguities. The helix's centered area satisfies 2A_t = t - sin(n²t)/n², approaching t, rather than equaling it at finite n.
  • Signature-regression scatterplots show the first split, bands span the minimum and maximum over five overlapping splits, and reported scores are split means. Depth selection from the test curve is exploratory; an untouched test would be needed to evaluate that selection.
  • The neural SDE uses 2018–2019 training statistics and a 2020 chronological research test. It is not the sealed 2021+ hold-out; no post-2020 envelope is opened here. Overlapping windows are dependent and three-seed ranges are not confidence intervals. Mini-batch training loss is squared signature distance; evaluation reports its norm. Losses are recorded before updates 0–999, with the final displayed fan after 1,000 updates. Finite signature matching does not identify unique drift and diffusion functions.
  • The realized-variance CLT is asymptotic under the stated continuous-volatility regularity. The measured coarse-sampling undercoverage is part of the lesson; log transformation improves it without guaranteeing 95% finite-sample coverage. Independent iid mean-zero observation noise yields E RV(Y) = E IV + 2n omega² for the driftless efficient martingale model. The worked 5-minute exercise assumes a 390-minute trading day (n=78), not a 24-hour crypto day.

All four previously registered Part 5 function sources and every prior registration, seal and opening are unchanged. The cumulative Part 5 trial count is 236, including Part 4's separately recorded corrective trial. No additional trial or hold-out opening is introduced by these display and interpretation corrections.

Chapter notesChapters (narration estimate: 64.9 minutes)
# Chapter (module) What is shown, built or computed
— A hedge that cannot lose, and does (s01_hook) The stop-loss start-gain hedge of a call (K = 100, σ = 20%, 1 year) has mean shortfalls 7.90, 8.10, 7.98, 8.00, 7.94 over 4,000 paths at 13…4,000 rebalancing intervals: the call's price, 7.97. How we got here (Bachelier 1900 → negative oil 2020); objectives; the House.
1 Building Brownian motion (s11_construct) Donsker with three step laws from the same random numbers; Lévy's midpoint construction to level 10 (bridge variance 0.251 against ¼); the reflection principle derived; P(max ≥ 1) = 0.3038 on 20,000 paths of 1,000 steps against 2(1 − Φ(1)) = 0.3173 and the Broadie–Glasserman–Kou shifted barrier 0.3085; the arcsine law (41% of paths spend < 10% or > 90% of the time above zero, 13% between 40% and 60%).
2 Quadratic variation, accumulating (s02_brownian) Three running sums drawn live on one path and refined from 16 to 4,096 steps; the L² proof; the QV estimate's spread against √(2/n) on 4,000 paths; Bitcoin's 2020 signature plot (80% at one minute, 71% at one day) and the illustrative iid observation-noise standard deviation implied by attributing the entire gap to noise, 3.5 basis points per observed log price.
3 Constructing the Itô integral (s03_ito) The integral as a ledger of bets; the isometry and martingale property proved; completion; left against midpoint sums (−0.330 and +0.170); Stratonovich's conversion; Wong–Zakai on 20,000 paths: the smoothed ODE gives E X₁ = 1.674 ± 0.016 (e^½ = 1.649), Euler's Itô scheme 1.015 ± 0.010.
4 Itô's lemma, proved (s12_lemma, 3D) A Brownian path lifted onto z = x²e^{−t/4}; the misses above the tangent plane stack to 0.928 against ½∫f_xx = 0.885; with ρ = −0.7 and f = xy they stack to −0.693 (the covariation, −0.7); the proof; the multivariate lemma and the product rule; GBM's drag (E log S₁ = 0.021 against μ − σ²/2 = 0.020); Lévy's characterization, Dambis–Dubins–Schwarz; E W₁⁴ = 3.013.
5 SDEs: existence and simulation (s13_schemes) Picard iteration on one path (gaps 1.13 → 0.011 in four rounds, 1.7·10⁻⁶ in nine); Itô's 1951 theorem; strong against weak solutions; lab: euler_maruyama, milstein; Milstein's term derived; strong orders 0.50 and 0.93, weak 0.99 and 1.00. MLMC in one line (Part 16).
6 Mean reversion: solved and fitted (s04_meanrev) Lab: ou_exact, 200 paths from 1954's bill rate (terminal mean 4.09%, sd 3.18%, 10% below zero); OU solved by an integrating factor; CIR's non-central χ² law and Feller's test (regression: ν = 0.58); replay: exact-transition pseudo-likelihood on floored monthly DTB3 averages from five starts, log-likelihood 3,635.3 against 3,633.3 for the regression; ν = 0.99.
7 From paths to PDEs (s14_pde, 3D) The CIR density surface over a path fan (density wall at ν = 0.58, a pinch example at ν = 2; the accessibility threshold is ν = 1; L¹ 0.038 against 20,000 exact paths); Fokker–Planck derived; Feynman–Kac proved; Vasicek's bond ODEs; Monte Carlo 0.8717 ± 0.0012 against the closed form 0.8709; the model's 10-year yield 1.38% against the actual 0.93% (Dec. 2020); Dynkin: E τ = 2.013 ± 0.013 for (−1, 2).
8 Girsanov: re-weighting paths (s05_girsanov) 300 paths re-weighted and recoloured by Z, against the same paths moved (weighted mean endpoint 0.998 for θ = 1); the proof from Part 4's coin through the product rule and Lévy; Novikov; effective sample size 0.78, 0.36, 0.025, 0.0003 at T = 1, 4, 16, 64 against e^{−θ²T}, and the weights' sampled mean falling to 0.75 despite a theoretical expectation of one at every finite horizon.
9 Girsanov at work (s15_sampling) Lab: is_digital (0.00707 ± 0.00008 against exact 0.00714; plain 0.0074 ± 0.0006; variance ÷52), the two estimates racing; one year of one-minute GBM: σ̂ sd 0.0002, μ̂ sd 0.18 over 200 years; why complete Black–Scholes replication removes μ from prices.
10 Martingale representation (s16_representation) E[W₁² ∣ 𝓕_t] and the hedge 2W at n = 8 and 512; the proof through exponentials; Clark–Ocone; hedge-error slopes −0.50 (W²), −0.49 (a call), −0.02 (a second noise: the market is incomplete).
11 Local time and Tanaka (s06_localtime) Tanaka derived by smoothing the kink (ε shrinking live); the occupation sandpile; E L₁⁰ = 0.792 (occupation) and 0.796 (Tanaka) against √(2/π) = 0.798; Carr–Jarrow; shortfall against ½L^K, correlation 0.97.
12 Jumps: Poisson to Lévy–Itô (s07_jumps) The Poisson clock and its compensator; compound Poisson checked on 50,000 paths; the Lévy–Itô layer cake of a tempered stable path (2 → 1,183 small jumps as ε goes from 0.3 to 0.005); Lévy–Khintchine checked (max error 0.011); Itô for jumps; Merton.
13 Jumps in data, and the hedge they break (s17_jumpdata) Bipower variation derived; Bitcoin 2018–2020: 204 hourly outliers beyond 5 estimated local sd against a standard-Gaussian benchmark of 0.015, accounting for 24% of squared returns; not identified jumps; a delta hedge on 10,000 Merton paths: no-jump error slope −0.49, the jump error stalls at 2.66 (24× the no-jump error at 4,000 rebalances).
14 Hawkes: jumps that cause jumps (s18_hawkes) Lab: Ogata's thinning, candidates shown (mean count 1,312 against 1,333); the branching tree (mean family 3.43 against 3.33); replay: the Bitcoin fit from eight starts (n = 0.36, half-life 7.6 h; log-likelihood −506 against −588); time-rescaling: nominal in-sample KS p = 0.83 for Hawkes, 6·10⁻¹⁴ for Poisson; estimated parameters and hourly rounding prevent a calibrated acceptance test.
15 Fractional Brownian motion (s08_rough) The H dial (one random vector, H from 0.95 to 0.05); Mandelbrot–Van Ness; p-variation; not a semimartingale (Rogers); lab: fbm (Davies–Harte); Bitcoin H ≈ 0.15; the Cont–Das caveat computed: an ordinary OU log-volatility with local Brownian regularity gives Ĥ = 0.26 from the true variance and 0.24 from noisy 5-minute RV.
16 Rough paths and signatures (s19_signature, 3D) Lyons' helix (‖X‖ = 1/n → 0, Y³₁ → 1); Chen's identity, the shuffle product, universality; lab: signature; replay: ridge regression on signatures of 20,000 two-asset paths, depth 1–5: the average and the Lévy area exact at depth 2 (R² = 1.000; the raw path explains 0.4% of the area), the Asian call 0.618 → 0.980 at depth 4, 0.951 at depth 5 (worse test performance, consistent with excess complexity), against 0.795 for the raw path.
17 Industry (s20_industry) Crisis file: WTI, 20 April 2020; GBM against Bachelier; CME's switch; firm file: Interactive Brokers and the CFTC; OCC's STANS Monte Carlo margin; the variance swap as Itô's lemma (Heston replication sd 1.2 and 0.11 in 10⁻⁴; the jump bias −17.1 against −16.8 predicted); SR 11-7 → SR 26-2; the House's validation report.
18 Frontier (s21_frontier) Replay: a neural SDE trained on Bitcoin by expected-signature matching, three seeds; scored on the 2020 research test against GBM and a bootstrap (see the numbers below); the 2023–2026 papers.
R For the researcher (s22_research) The CLT for realized variance (Jacod; Barndorff-Nielsen–Shephard), proved by the martingale CLT; on 3,000 simulated stochastic-volatility days the studentized 95% interval covers 89% at 10-minute sampling, 92% at 5, 94% at 1 minute and 95% at 10 and 1 seconds; the error falls from 27% to 1.1%. The log statistic (Barndorff-Nielsen–Shephard 2005) covers 92% at 10 minutes, skewness −1.32 → −0.40. Noise and jumps, pointed to Part 7. Three open problems.
— Outro (s10_outro) Recap, three desk questions, nine problems (two at qualifying-exam level), where it comes back, references, the House.

Hands-on: six labs (euler_maruyama/milstein, ou_exact, is_digital, hawkes_thinning, fbm, signature), four replays (CIR MLE, Hawkes MLE, signature regression, the neural SDE), three 3D scenes (the lemma's tangent planes, the Fokker–Planck surface, Lyons' helix).

Companion films in this repository

中文讲义

本讲的中文说明、交易台问题与习题解答(与英文版对应)。

导言量化金融,从零搭建 — 第5部分:随机微积分

本部分以系列入门篇《随机微积分可视化》为前提,并走得更远:研究生随机微积分课程中的构造、证明与实用工具,每一样都用模拟检验,所有数字都由 compute.py和我们公司的sim函数库算出。约65分钟:18个核心章节、一章研究内容、开场与回顾。

讲的是方法,不构成投资建议。

Chapter notes各章内容(旁白估计64.9分钟)
  • 开场:一个不会亏、却亏了的对冲。 止损–启动对冲在四千条路径上的平均缺口约为8美元,恰好是看涨期权的价格7.97;历史脉络;本部分目标。
  • 1. 构造布朗运动。 三种步长分布的唐斯克极限;列维中点构造(布朗桥方差0.251对¼);反射原理的推导与检验(0.3038对0.3173,平移障碍0.3085);反正弦定律。
  • 2. 二次变差的累积。 三个累计和在一条路径上实时画出;L²证明;比特币2020年的波动率签名图与反推出的微观结构噪声(把全部差额归为独立同分布噪声时,每个对数价格观测约3.5个基点,并非已识别的噪声估计)。
  • 3. 构造伊藤积分。 下注账本;等距性与鞅性质的证明;左端点与中点之和;斯特拉托诺维奇转换;王–扎凯定理(平滑方程1.674,伊藤格式1.015)。
  • 4. 伊藤引理的证明(三维)。 切平面之上的偏差累积成½∫f_xx;多元引理与乘积法则;波动率拖累;列维刻画;E W₁⁴ = 3.013。
  • 5. 随机微分方程。 皮卡迭代;强解与弱解;实验:欧拉–丸山与米尔斯坦;强阶0.50与0.93。
  • 6. 均值回复。 实验:精确的OU模拟;积分因子求解;CIR与费勒检验;训练回放:月平均利率正值截断后的CIR精确转移伪似然(五个起点,费勒比率0.99)。
  • 7. 从路径到偏微分方程(三维)。 福克–普朗克曲面与费勒墙;福克–普朗克推导;费曼–卡茨证明与蒙特卡洛检验(0.8717对0.8709);戴金公式(2.013)。
  • 8. 吉尔萨诺夫:给路径重新加权。 路径不动、权重变;证明;诺维科夫条件;有效样本量随期限崩塌。
  • 9. 吉尔萨诺夫的应用。 实验:重要性抽样的数字期权(方差缩小52倍);波动率可观测而漂移不可观测。
  • 10. 鞅表示。 对冲财富追踪鞅;通过指数函数的证明;克拉克–奥科内公式;第二个噪声下对冲误差不再缩小(斜率−0.02)。
  • 11. 局部时与田中公式。 磨圆尖角的推导;占位沙堆;E L₁⁰ = 0.79;卡尔–贾罗悖论的化解(相关系数0.97)。
  • 12. 跳跃。 泊松时钟与补偿子;列维–伊藤分层;列维–辛钦公式的检验;跳跃的伊藤公式;默顿模型。
  • 13. 数据中的跳跃。 双幂次变差;比特币204个超过5倍估计局部标准差的异常小时,不能直接识别为跳跃;跳跃使delta对冲误差停在一个下限。
  • 14. 霍克斯过程。 实验:小形稀疏法;家谱;训练回放:比特币拟合(分支比0.36);时间重标检验(名义样本内p值:霍克斯0.83;参数拟合与小时取整使其不能作为校准后的接受检验)。
  • 15. 分数布朗运动。 H旋钮;曼德布罗特–范内斯表示;不是半鞅;实验:戴维斯–哈特;比特币H ≈ 0.15;孔特–达斯的保留意见(具有布朗局部正则性的普通OU也给出0.26)。
  • 16. 粗糙路径与签名(三维)。 莱昂斯螺旋;陈恒等式;实验:签名函数;训练回放:签名回归(亚式期权R²在深度4达到0.980)。
  • 17. 业界。 2020年4月的负油价与巴舍利耶模型;盈透证券与美国商品期货交易委员会;期权清算公司的蒙特卡洛保证金;作为伊藤引理的方差互换;SR 11-7到SR 26-2。
  • 18. 前沿。 训练回放:用期望签名训练的神经随机微分方程,在2020年样本外与几何布朗运动和自助重抽样比较;2023–2026年的论文。
Desk questions, with solutions交易台问题与解答
  1. 离开(−a, b)的期望时间。 先在τ∧t处使用戴金公式,取f = x²(𝓛f = 1)。停止后位置有界,故E(τ∧t) ≤ max(a²,b²);单调收敛给出Eτ有限,再由有界收敛得到E W_τ² = Eτ。离开点以a/(a + b)的概率为b、以b/(a + b)的概率为−a, 所以E τ = b²·a/(a + b) + a²·b/(a + b) = ab。对(−1, 2)为2(模拟2.013 ± 0.013)。
  2. 先碰到+1再碰到−2的概率。 W是鞅,在首次离开(−2, 1)时停止后有界;由可选停止,1·p − 2(1 − p) = 0,p = 2/3。
  3. 用吉尔萨诺夫为数字期权定价。 价格为e^{−rT} E_Q[1{S_T > K}]。在Q下log S_T = log S₀ + (r − σ²/2)T + σW̃_T,所以Q(S_T > K) = N(d₂), 价格为e^{−rT}N(d₂)。在P下同一事件的概率是把r换成μ的N(d₂):漂移变了,波动率不变。
Problems, with worked solutions习题与解答
  1. 变差。 证明在\([0, 1]\)上\(n\)步网格的\(\sum |\Delta W|\)均值为\(\sqrt{2n/\pi}\),\(\sum (\Delta W)^2\)均值为1、方差为\(2/n\)。

    解答

    每个ΔW服从N(0, 1/n):E|ΔW| = √(2/(πn)),所以E Σ|ΔW| = √(2n/π) → ∞;E(ΔW)² = 1/n、Var((ΔW)²) = 2/n², 所以Σ(ΔW)²的均值为1、方差为2/n → 0。

  2. ∫W dW。 分别用左端点和与中点和的极限计算\(\int_0^T W\,dW\)。哪一个关于\(T\)是鞅?

    解答

    左端点:Σ W_k ΔW_k = ½Σ(W²_{k+1} − W²_k) − ½Σ(ΔW_k)² → ½(W_T² − T)。时间中点:额外的和Σ(W_{k+½} − W_k)ΔW_k趋于½T, 结果为½W_T²。只有伊藤积分½(W_T² − T)关于T是鞅:它对每个T的均值都是零。

  3. 米尔斯坦修正。 对\(b(X)\)在一步内应用伊藤引理,推导\(dX = a\,dt + b(X)\,dW\)的米尔斯坦修正。

    解答

    一步之内,b(X_s) ≈ b(X_t) + b'b(X_t)(W_s − W_t),所以∫b(X_s)dW_s ≈ bΔW + b'b∫(W_s − W_t)dW_s = bΔW + ½b'b(ΔW² − h)。

  4. 瓦西切克。 对瓦西切克模型,证明\(r_T\)服从高斯分布并求其均值与方差。用拟合的\(\kappa = 0.099\)、\(\theta = 4.1\%\)、\(\sigma = 1.4\%\),长期出现负利率的概率是多少?

    解答

    r_T是高斯的,均值θ + (r₀ − θ)e^{−κT},方差σ²(1 − e^{−2κT})/(2κ)。长期分布为N(θ, σ²/2κ):标准差0.014/√0.197 = 3.2%, P(r < 0) = N(−4.1/3.2) ≈ 10%,与实验中两百条路径的10%一致。

  5. 霍克斯过程。 一个霍克斯过程的\(\mu = 0.1\)、\(\alpha = 0.8\)、\(\beta = 2\)(每天)。它的长期速率是多少?多大比例的事件由先前的事件触发?

    解答

    平稳时E[λ] = μ + (α/β)E[λ],所以长期速率为μ/(1 − α/β) = 0.1/0.6 ≈ 每天0.167次;每个事件平均触发α/β = 0.4个子事件, 所以40%的事件由先前的事件触发。

  6. E τ_a = ∞。 由首达密度 \(f_{\tau_a}(t) = \frac{a}{\sqrt{2\pi t^3}}e^{-a^2/2t}\),证明尽管 \(P(\tau_a < \infty) = 1\),却有 \(\mathbb{E}\,\tau_a = \infty\)。

    解答

    P(τ_a < ∞) = lim 2(1 − Φ(a/√T)) = 1。但t很大时f(t) ~ a(2π)^{−½}t^{−3/2},所以E τ_a = ∫ t f(t) dt像∫ t^{−1/2} dt一样发散。

  7. W_T³的克拉克–奥科内被积函数。 计算 \(F = W_T^3\) 的Clark–Ocone被积函数,并用伊藤引理检验。

    解答

    D_tW_T³ = 3W_T²,所以H_t = E[3W_T² ∣ 𝓕_t] = 3(W_t² + T − t)。检验:由伊藤,W_T³ = ∫3W²dW + ∫3W dt, 而∫_0^T W_t dt = ∫_0^T (T − t) dW_t(分部积分),所以W_T³ = ∫_0^T 3(W_t² + T − t) dW_t,均值为零,正如应有的那样。

  8. (资格考试)已实现方差的中心极限定理。 (资格考试)对\(dX=\sigma_t dW\),假设\(\sigma_t\)确定、连续、有界且积分四次变差为正,用林德伯格中心极限定理证明\(\sqrt n(\mathrm{RV}_n-\int\sigma^2)\Rightarrow N(0,2\int\sigma^4)\)。

    解答

    σ为确定、连续、有界且积分四次变差为正时\(\Delta_iX \sim N(0, v_i)\)相互独立;\(\xi_i = (\Delta_iX)^2 - v_i\)独立、 均值为零、方差为\(2v_i^2\),\(n\sum 2v_i^2 \to 2\int\sigma^4\);李雅普诺夫条件成立,故\(\sqrt n(\mathrm{RV}_n - \mathrm{IV}) \Rightarrow N(0, 2\int\sigma^4)\)。

  9. (资格考试)噪声。 (资格考试)有效价格是无漂移鞅,加入与其独立的独立同分布零均值噪声\(\varepsilon\),方差为\(\omega^2\)。证明\(\mathbb E\,\mathrm{RV}_n(Y)=\mathbb E\,\mathrm{IV}+2n\omega^2\)及\(\mathrm{RV}_n(Y)/2n\to\omega^2\)。

    解答

    假设有效价格是无漂移平方可积鞅,噪声独立同分布、均值为零且与有效价格独立,则\(\mathrm{RV}_n(Y) = \mathrm{RV}_n(X) + 2\sum\Delta_iX\,\Delta_i\varepsilon + \sum(\Delta_i\varepsilon)^2\), 期望为\(E\,\mathrm{IV} + 2n\omega^2\);除以\(2n\)后由大数定律得\(\mathrm{RV}_n(Y)/2n \to \omega^2\)。

For the researcher写给研究者

中心极限定理(Jacod 1994;Barndorff-Nielsen与Shephard 2002),双幂变差(2004),黄–陶臣检验(2005),双尺度估计量(Zhang、Mykland与 Aït-Sahalia 2005),已实现核与预平均。开放问题:内生、自相关噪声与不规则时间下的有效估计;粗糙波动率下的即期波动率;波动率跳跃与共同跳跃。

Data, scope and reproducibility解释边界与可复现性
  • 固定持仓在调仓之间也产生随价格变化的财富;细网格回放保留所有缓存的调仓时点财富。止损对冲例子假设无摩擦、零利率与无股息;约8美元是跨路径的平均缺口,并非每条路径都损失同一数额。表格计调仓区间,而非实际持仓切换次数。一般价格过程的占位公式按二次变差计量,而不是日历时间。
  • 唐斯克定理给出独立同分布、中心化且方差有限步长的路径分布极限,不是耦合样本相等。伊藤等距和真鞅结论要求持仓平方积分的期望有限。鞅表示需要通常增广的自然布朗滤过及平方可积支付;股票对冲还要求可交易资产张成风险。克拉克–奥科内与模拟阶数也各有正则性条件。
  • CIR使用设置1e-5正值下限的DTB3月平均利率;精确转移密度在此形成转移伪似然,并不是月平均观测模型的精确似然。1954—2020年全样本参数只用于回顾性演示。费勒可达性临界值是nu=1,nu=2只是密度形状示例。密度图保留窗外质量,窗口内模拟质量为0.9945,解析值0.994566,L1差约0.038。
  • 诺维科夫条件充分而非必要。常数漂移在所有有限期限上仍给出均值为1的真鞅,即使模拟未能抽到极端权重。T=64时经验有效样本约33条,而非不到1条;不到1条的是在此样本量下不可靠的总体矩近似。测度等价本身不保证不完全市场中的价格与物理漂移无关。
  • 小时异常收益不能直接识别为跳跃,已估计尺度也不使高斯异常计数成为校准检验。签名图噪声值依赖分解假设,跨起点平均并不消除主要噪声偏差。霍克斯后代比例是模型内的潜在归属,不是市场因果识别;拟合后的KS值只是受参数估计和小时取整影响的名义样本内诊断。
  • Lévy–Itô演示路径特意选择了包含三次大跳跃的种子,不能当作无偏随机路径展示;独立的两万次特征函数校验针对epsilon=0.005的有限截断分布。
  • Mandelbrot–Van Ness常数按Var(B_1^H)=1归一化,并使用双边布朗运动。普通OU具有局部布朗正则性,并非可微的光滑路径。有限滞后上的低H不能单独识别局部粗糙度。粗糙路径需要有限p变差与适当增强;通用签名逼近需要紧性和分离条件。螺旋的中心化面积为2A_t=t-sin(n²t)/n²,仅在极限趋于t。
  • 签名回归散点图展示首个划分,带状区域是五个重叠划分的最小与最大值,报告分数为各划分均值。用测试曲线挑选深度只属探索;评价选择后的性能需要未使用的新测试集。
  • 神经随机微分方程使用2018—2019年的训练统计量,并在2020年进行按时间划分的研究测试;这不是封存的2021年之后留出集。重叠窗口并不独立,三个种子的范围也不是置信区间。训练损失是签名距离的平方,评估报告其范数;记录的是更新前0—999次损失,最终路径群来自完成1000次更新后。有限签名匹配不能识别唯一的漂移与扩散。
  • 已实现方差中心极限定理是渐近结论,粗采样覆盖不足必须明确报告。对数变换会改善结果,但不保证有限样本95%覆盖。独立同分布且与有效价格独立的零均值噪声,在无漂移有效价格鞅模型中给出E RV(Y)=E IV+2n omega²。五分钟例题使用390分钟交易日的78个收益,并非加密资产的全天交易日。

四个既有注册函数的源代码,以及所有既有注册、封存与开启记录均保持不变。第5部分累计试验数为236,包含第4部分单独记录的纠正试验;本部分的展示与解释修改不增加试验,也不打开留出集。

Primary frontier sources: Issa et al., NeurIPS 2023, Cuchiero et al., joint SPX/VIX calibration, and Degenne et al., Brownian motion in Lean.

Polish verification: scope, checks and limitations and compact evidence. Full production-voice listening remains pending.

Build the film

python -m videos.quant.quant5.compute      # the part's numbers, into .cache/quant5
python tools/make.py quant5                # the narrated film, English and Chinese
EXPLAINER_TTS=silent python tools/qa_scene.py quant5 Hook   # one chapter, silent, with a contact sheet

Scenes: videos/quant/quant5. Setup: see the course page. Source of these notes: the part's README and the scenes' narration.