Augustin Grudet

The Brownian specimen: geometric Brownian motion

The Black-Scholes price model, simulated exactly on a log scale, then dozens of paths blended into a density field.

This post was machine-translated from the original version.

Contents

Under the finance tag, the specimen is a bundle of simulated price paths. This post’s specimen carries the label specimen 0x4914 · brownian · μ=0.063 σ=0.323 n=38: an average return of 6.3% a year, a volatility of 32.3%, and 38 overlaid paths. It is the model the Black-Scholes formula rests on.

specimen 0xa0d3 · brownian · μ=-0.076 σ=0.243 n=20
A bundle of geometric Brownian motion paths on a log scale. The sliders set μ, σ and the number of paths.

From Brownian to geometric Brownian

In 1900, Bachelier modelled the price of a government bond as Brownian motion: price changes are sums of small independent shocks, hence Gaussian. The model has an obvious flaw: the price can go negative. In 1959, Osborne proposed applying it not to the price but to its logarithm, which amounts to assuming that returns, rather than absolute changes, are stationary. This is geometric Brownian motion, the solution of the stochastic differential equation

dSt=μ St dt+σ St dWt,\mathrm{d}S_t = \mu\, S_t\, \mathrm{d}t + \sigma\, S_t\, \mathrm{d}W_t,

where WW is a standard Brownian motion. Both parameters have a direct meaning:

  • μ\mu, the drift, is the mean instantaneous return: E[St]=S0 eμt\mathbb{E}[S_t] = S_0\, e^{\mu t};
  • σ\sigma, the volatility, measures the size of the shocks: the standard deviation of the log return over a time tt is σt\sigma \sqrt{t}.

An exact solution

Itô’s lemma applied to ln⁡St\ln S_t brings out a correction:

dln⁡St=(μ−12σ2)dt+σ dWt⟹St=S0exp⁡ ⁣((μ−12σ2)t+σWt).\mathrm{d}\ln S_t = \left(\mu - \tfrac{1}{2}\sigma^2\right) \mathrm{d}t + \sigma\, \mathrm{d}W_t \quad\Longrightarrow\quad S_t = S_0 \exp\!\left( \left(\mu - \tfrac{1}{2}\sigma^2\right) t + \sigma W_t \right).

The log price is a Brownian motion with drift, and StS_t follows a log-normal distribution. Since the increments of WW over disjoint intervals are independent and Gaussian with variance Δt\Delta t, the process can be simulated with no discretisation error at all:

ln⁡St+Δt=ln⁡St+(μ−12σ2)Δt+σΔt Z,Z∼N(0,1).\ln S_{t + \Delta t} = \ln S_t + \left(\mu - \tfrac{1}{2}\sigma^2\right) \Delta t + \sigma \sqrt{\Delta t}\, Z, \qquad Z \sim \mathcal{N}(0, 1).

An Euler scheme applied directly to SS would introduce a bias that only vanishes as Δt→0\Delta t \to 0; here, the values at the grid times have exactly the right joint distribution, whatever the step. It is the textbook case of exact simulation (Glasserman, chapter 3).

The −12σ2-\tfrac12 \sigma^2 term has a visible consequence: the median of StS_t is S0 e(μ−σ2/2)tS_0\, e^{(\mu - \sigma^2/2) t}, below the mean. A typical path grows more slowly than the average, which a few exceptional paths pull upwards. For this post’s specimen, μ−σ2/2=0.063−0.052≈0.011\mu - \sigma^2/2 = 0.063 - 0.052 \approx 0.011: the core of the bundle is almost flat despite a 6.3% drift.

  • path 1
  • path 2
  • path 3
  • path 4
  • median
  • mean
80100Price00.10.20.30.40.50.60.70.80.91Time (years)80100Price00.20.40.60.81Time (years)
Four geometric Brownian motion paths (S₀ = 100, μ = 8%, σ = 30%, 252 steps over a year), with the median and the mean. On a log scale, both are straight lines.

Black and Scholes assume precisely that the underlying follows this process. By building a riskless portfolio out of the option and the stock, they show that the price of a European call with strike KK and maturity TT does not depend on μ\mu:

C=S0 N(d1)−Ke−rTN(d2),d1,2=ln⁡(S0/K)+(r±12σ2)TσT,C = S_0\, N(d_1) - K e^{-rT} N(d_2), \qquad d_{1,2} = \frac{\ln(S_0 / K) + \left(r \pm \tfrac12 \sigma^2\right) T}{\sigma \sqrt{T}},

where NN is the normal cumulative distribution function and rr the risk-free rate. Everything happens as if the stock earned rr instead of μ\mu: this is risk-neutral valuation. The log-normal distribution of STS_T is therefore the centrepiece of the formula. CC can also be recovered by Monte Carlo, averaging e−rTmax⁡(ST−K,0)e^{-rT} \max(S_T - K, 0) over a large number of paths like those of the specimen, with μ=r\mu = r.

  • simulation (20,000 draws)
  • log-normal density
00.0020.0040.0060.0080.010.0120.014Density406080100120140160180200220240Price after one year00.0020.0040.0060.0080.010.0120.014Density100200Price after one year
Histogram of 20,000 one-year prices simulated in one exact step, against the theoretical log-normal density (S₀ = 100, μ = 8%, σ = 30%). Bins of width 5 between 30 and 250.

The model remains an idealisation. Real returns have fatter tails than the normal distribution and a volatility that changes over time; for a drawing these flaws do not matter, but they do when measuring risk.

From paths to a density field

The seed sets the specimen’s identity: μ\mu uniform in [−0.08,0.30][-0.08, 0.30], σ\sigma in [0.18,0.50][0.18, 0.50] and a horizon of 0.75 to 2.5 years. The secondary tags set the number of paths, between 12 and 40, the symmetry and the character ramp. All paths start from S0=1S_0 = 1; time runs along the horizontal axis and the log price up the vertical one, the usual scale for a long horizon. On the large full-screen frames, such as the home page’s, the engine first simulates 60% more time before the left edge (the burn variable below): the paths come in already spread out, and the bundle covers the whole width instead of starting from a point.

Each character column covers six simulation steps, so 720 steps for a 120-column banner. The heart of the loop is the exact discretisation above:

for (let k = 0; k < SUB; k++) {
  const t = burn + c * SUB + k;
  if (!mirror) z![t] = normal(rng);
  s += drift + vol * (mirror ? -z![t] : z![t]);
  if (s < a) a = s;
  if (s > b) b = s;
}

For each path and each column, the engine keeps the lowest and highest log price reached, which gives a vertical segment, thickened by 0.35 row on each side so that a flat path stays visible. Each row it crosses gets an amount of ink equal to the share of its height that is covered. The vertical scale runs from the 1st to the 99th percentile of all values, plus a 6% margin, so that one extreme path does not flatten the others; strips under 8 rows zoom in on the central part, from the 30th to the 70th percentile. Finally, as for the attractors, the ink goes through a logarithm:

value=min⁡ ⁣(1,ln⁡(1+ink)ln⁡(1+max⁡(2, n/3))),\text{value} = \min\!\left(1, \frac{\ln(1 + \text{ink})}{\ln(1 + \max(2,\ n/3))}\right),

calibrated so that a lone path gives a light stroke and a third of the bundle gives the densest tone (the denominator is raised for narrow strips).

Antithetic variates

With probability 0.3, the paths come in pairs: the second gets the shocks −Z-Z of the first. On a log scale, the two are vertical mirror images on either side of the line (μ−σ2/2) t(\mu - \sigma^2/2)\,t: the bundle folds onto that slanted axis. This is the method of antithetic variates, a classic variance reduction technique in Monte Carlo, borrowed here for its visual effect.

Sources

  1. L. Bachelier, Théorie de la spéculation, Annales scientifiques de l'École normale supérieure 17 (1900) 21-86 (Nov 25, 2026)
  2. M. F. M. Osborne, Brownian Motion in the Stock Market, Operations Research 7 (1959) 145-173 (Nov 25, 2026)
  3. F. Black, M. Scholes, The Pricing of Options and Corporate Liabilities, Journal of Political Economy 81 (1973) 637-654 (Nov 25, 2026)
  4. P. Glasserman, Monte Carlo Methods in Financial Engineering, Springer, 2003 (Nov 25, 2026)
  5. bryc, Pseudorandom number generators in JavaScript (sfc32) (Nov 25, 2026)