Skip to content
AI360Xpert
Beta

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.

A path with drift 1.0 climbs steadily while Brownian noise of size 0.5 spreads its positions with variance 0.25 per unit time
A path with drift 1.0 climbs steadily while Brownian noise of size 0.5 spreads its positions with variance 0.25 per unit time

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 ∫H dW\int H\,dW against noise, chain rules with correction terms and equations dX=μ dt+σ dWdX = \mu\,dt + \sigma\,dW with drift μ\mu and volatility σ\sigma.

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 WtW_t with W0=0W_0 = 0, independent Gaussian increments of variance tt 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 dXt=μ(Xt,t) dt+σ(Xt,t) dWtdX_t = \mu(X_t,t)\,dt + \sigma(X_t,t)\,dW_t says change equals drift times dtdt plus volatility times Brownian increment dWtdW_t. The Ito integral ∫0THt dWt\int_0^T H_t\,dW_t for adapted HH (depending only on the past) has mean zero and variance E[∫0THt2 dt]E[\int_0^T H_t^2\,dt] (Ito isometry). Ito's lemma corrects the chain rule: df=f′ dX+12f′′σ2 dtdf = f'\,dX + \frac{1}{2}f''\sigma^2\,dt for dX=μ dt+σ dWdX = \mu\,dt + \sigma\,dW.

Worked example

Take dXt=1.0 dt+0.5 dWtdX_t = 1.0\,dt + 0.5\,dW_t starting X0=0X_0 = 0. After T=4T = 4, the mean is 1.0×4=4.01.0 \times 4 = 4.0 and the variance is 0.52×4=0.25×4=1.00.5^2 \times 4 = 0.25 \times 4 = 1.0, so standard deviation 1.01.0. A typical path ends in [3.0,5.0][3.0, 5.0] with chance about 0.680.68. The drift contributes 4.04.0 to position but 00 to variance; the noise contributes 00 to mean but 1.01.0 to variance. Forgetting the 1/21/2 correction on X2X^2 would misstate E[XT2]E[X_T^2] as 1616 instead of 16+1=1716 + 1 = 17.

Watch Out For

Applying the ordinary chain rule to Brownian functions

Differentiating Wt2W_t^2 as 2Wt dWt2W_t\,dW_t drops the dtdt term and claims a martingale with mean zero, but E[WT2]=TE[W_T^2] = T. Every downstream expectation, sampler stationary check and score identity inherits the missing TT.

Fix: always add 12f′′σ2 dt\frac{1}{2}f''\sigma^2\,dt. When σ=0\sigma = 0 it vanishes and ordinary rules return.

Integrating a peeking integrand against dW

Ito's integral needs adapted integrands. Using the endpoint WTW_T as HtH_t inside [0,T][0, T] 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 dtdt plus volatility dWtdW_t; 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 12f′′σ2dt\frac{1}{2}f''\sigma^2 dt to every chain rule; ordinary calculus is the σ=0\sigma = 0 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.