Stochastic Calculus and SDEs
Calculus for jittery paths. Brownian motion is too rough for ordinary rules, so stochastic integrals and SDEs give it a consistent language that diffusion models run on.
Why Does This Exist?
Ordinary calculus differentiates smooth paths, but Brownian motion is nowhere differentiable: zoom in and it stays jagged, with quadratic variation accumulating like clockwork. Diffusion models, Langevin samplers and noisy gradient flows all run on such paths, so they need integrals against noise, chain rules with correction terms and equations with drift and volatility .
Stochastic calculus is that toolkit. This page maps it: the Ito integral for non-anticipating integrands, Ito's lemma as the corrected chain rule, SDEs for dynamics and Fokker-Planck for densities. Follow-ups prove each: Ito integral, Itos lemma, diffusion processes and reverse-time SDEs.
Prerequisite in one paragraph. You need Brownian motion with , independent Gaussian increments of variance and continuous jagged paths. Drift is deterministic trend, diffusion scales the noise. Background is in Brownian motion and probability theory.
Think of It Like This
Walking uphill in an earthquake
Your route has two parts: a steady uphill climb (drift) and earthquake jolts (diffusion). Ordinary odometers track only the climb and misread every jolt as extra distance. A stochastic odometer separates them: it accumulates climb linearly with time and jolt energy quadratically, because jolts average to zero but their squares do not.
Ito's correction is the jolt-energy term. Skip it and your position estimate drifts; include it and the books balance. Reverse-time SDEs replay the whole walk backwards from the summit log, which is how generative diffusion works.
Where the analogy stops: earthquakes pause, Brownian jolts never do at any scale. The mathematics also forbids looking ahead: integrands must not peek at future jolts, which hikers constantly do.
How It Actually Works
An SDE says change equals drift times plus volatility times Brownian increment . The Ito integral for adapted (depending only on the past) has mean zero and variance (Ito isometry). Ito's lemma corrects the chain rule: for .
Worked example
Take starting . After , the mean is and the variance is , so standard deviation . A typical path ends in with chance about . The drift contributes to position but to variance; the noise contributes to mean but to variance. Forgetting the correction on would misstate as instead of .
Watch Out For
Applying the ordinary chain rule to Brownian functions
Differentiating as drops the term and claims a martingale with mean zero, but . Every downstream expectation, sampler stationary check and score identity inherits the missing .
Fix: always add . When it vanishes and ordinary rules return.
Integrating a peeking integrand against dW
Ito's integral needs adapted integrands. Using the endpoint as inside peeks at the future: the isometry fails and the integral gains a spurious mean. Backtests with lookahead bias are this mistake in trading clothes.
Fix: left-point, past-only integrands for Ito. Peeking payoffs need the Skorokhod extension, not the Ito table.
The Quick Version
- SDEs split change into drift plus volatility ; drift moves the mean, noise the variance.
- With drift 1.0 and noise 0.5 over 4 units, mean 4.0 and variance 1.0.
- Ito's lemma adds to every chain rule; ordinary calculus is the case.
- Integrands must use only the past; peeking breaks the isometry.
- This page maps the toolkit; follow-ups prove the integral, lemma, densities and reversals.