Quantitative Methods · Methods
2Brownian Motion
A trader buys a stock with an annual volatility of 30% and places a stop-loss 2% below the entry price, then asks the risk desk how likely the stop is to be touched within a month. The chance that the stock merely ends the month below the stop is 41%; the chance that it touches the stop at some moment of the month is exactly twice that, 82%. If the stop is checked only at each day’s close, the answer is 72%, and a simulation that watches the closes and forgets what happens between them reports 72% for a contract that is really triggered 82% of the time. The three numbers come from one object, the Brownian motion, and from three of its properties: its law at a fixed time, the reflection principle for its running minimum, and the Brownian bridge that describes it between two observations. This chapter builds the object, proves the properties the series uses, and ends with the quadratic variation, the property that makes stochastic calculus different from the ordinary kind.
2.1 From random walks to Brownian motion
Definition 2.1 (Brownian motion, Gaussian process)
A Gaussian process is a process whose finite-dimensional laws are all multivariate normal; its law is fixed by its mean and covariance . A (standard) Brownian motion is an adapted process with , continuous paths, and increments independent of and distributed for .
Equivalently, is the centred Gaussian process with continuous paths and covariance : for , . Existence is not obvious, since the definition asks for continuity of uncountably many random variables at once. Wiener gave the first construction in 1923; the one that serves simulation builds the path coarse to fine (Section 2.5). The reason Brownian motion appears everywhere is a central limit theorem for paths.
Theorem 2.2 (Donsker’s invariance principle)
Let be independent and identically distributed with mean zero and variance one, , and the linearly interpolated, rescaled walk. Then as random elements of : for every bounded continuous functional of the path.
Proof. Admitted here. ∎
Donsker’s theorem is what licenses the use of Brownian motion for prices built from many small, independent trades, whatever their individual law: the maximum of the path, the time spent below a level, the average price, all continuous functionals, converge together. It does not license it for prices driven by a few large jumps (chapter 6).
Proposition 2.3 (Invariances)
If is a Brownian motion, so are ; for every (scaling); for fixed ; and (with value 0 at ).
Proof. Each is a centred Gaussian process with covariance ; for scaling, ; for inversion, . Continuity at 0 of follows from the strong law . ∎
Scaling is the square-root-of-time rule a trader uses without thinking: a stock with 30% annual volatility has a one-day standard deviation of and a one-month one of . Figure 2.1 shows six paths inside the envelope .
2.2 Path properties and the Markov property
Brownian paths are continuous and nowhere smooth. Almost surely they are Hölder continuous of every order and of no order , and differentiable at no point; they cross any level they touch infinitely often immediately afterwards. None of this is pathology for its own sake: it is the reason a hedge rebalanced continuously in time still accumulates a nonzero cost (chapter 3), and the reason a barrier touched once is touched many times.
Definition 2.4 (Markov process, strong Markov property)
An adapted process is a Markov process if for all and bounded measurable , : given the present, the past adds nothing. It has the strong Markov property if the same holds with replaced by any finite stopping time .
Theorem 2.5 (Brownian motion is strong Markov)
For every stopping time with , the process is a Brownian motion independent of .
Proof. Admitted here. ∎
The proof approximates from above by stopping times with countably many values, for which the statement is the simple Markov property applied on each value (Karatzas and Shreve, 1991, §2.6). The strong Markov property is what makes the next section work: after the first time a path reaches a level, what it does next is a fresh Brownian motion, as likely to go up as down.
2.3 The reflection principle and first-passage times
Definition 2.6 (First-passage time)
For a level , the first-passage time (or hitting time) of a continuous process is ; it is a stopping time.
Theorem 2.7 (Reflection principle)
For and , let . Then
and more precisely for .
Proof. On define the reflected path for and afterwards (Figure 2.2). By Theorem 2.5, is a Brownian motion independent of , and so is its negative; hence is a Brownian motion. The event for is the event for (the paths reach at the same time), which has the probability of . With : . ∎
Differentiating in gives the law of the first-passage time: has density , finite almost surely but with infinite mean, since the density decays like . A driftless price reaches any level eventually, and one should not wait for it. The stop of the hook is the reflection principle applied to the log price.
Definition 2.8 (Brownian motion with drift)
A Brownian motion with drift and volatility is .
Proposition 2.9 (First passage with drift)
For and ,
Proof. Admitted here. ∎
The proof changes the measure to remove the drift and applies the reflection principle (an exercise of chapter 5 derives it). For the hook, and : without drift the stop is touched with probability ; with the drift that makes the price itself a martingale, 82.4%.
Proposition 2.10 (Discrete monitoring: the Broadie–Glasserman–Kou shift)
If is observed only at times , the probability that an observation falls at or below is, to first order in , the continuous probability for the shifted level , with .
Proof. Admitted here. ∎
The shift is the mean overshoot of the path beyond the level at the first observation below it (Broadie, Glasserman and Kou, 1997). With daily closes, : the 2% stop behaves like a 3.1% stop watched continuously, and is touched with probability 71.9%, against 72.0% in a simulation of 200 000 months of daily closes. Figure 2.3 shows the three curves over stop distances from 1% to 10%. The error of discrete monitoring shrinks only like : refining a daily simulation to four, sixteen and sixty-four observations a day gives 77.1%, 79.1% and 80.5% against the continuous 81.6%, the gap roughly halving each time the step is divided by four. A simulation that wants the continuous answer should not refine the grid; it should use the bridge of Section 2.5.
2.4 Quadratic variation
Definition 2.11 (Quadratic variation)
The quadratic variation of a process on is the limit in probability over partitions whose mesh tends to zero, when it exists.
Theorem 2.12 (Quadratic variation of Brownian motion)
: the sums converge to in , and almost surely along dyadic partitions. Consequently the total variation tends to infinity.
Proof. With , , and by independence . For dyadic partitions the variances are summable and Borel–Cantelli gives almost sure convergence. If the total variation stayed bounded by along a sequence, then by uniform continuity, a contradiction. ∎
For a smooth function the sum of squared increments vanishes; for a Brownian path it is the elapsed time, deterministically, whichever path occurs. For it is , so one path observed ever more finely reveals its volatility exactly, while its drift stays unobservable over any fixed period: the reason realised volatility (One Quant Book 1, chapter 25) is estimated so much better than an expected return, and the reason the microstructure noise of chapter 21 matters so much. Figure 2.4 samples one path at to points.
2.5 The Brownian bridge
Definition 2.13 (Brownian bridge)
A Brownian bridge from to on is a Brownian motion conditioned on and ; from to on it can be written , a centred Gaussian process with covariance for .
Proposition 2.14 (What happens between two observations)
Given and , with : (i) for is normal with mean and variance , in particular at the midpoint; (ii) for and a level below both and ,
Proof. (i) is Gaussian conditioning of the vector . For (ii) take , , and level with ; by the reflection principle , so the conditional probability is the ratio of the two normal densities, , which is the formula with and . ∎
Method 2.15 (Two uses of the bridge in simulation)
(i) Building paths coarse to fine: draw , then the midpoint of each interval from part (i), halving the intervals until the grid is fine enough. The path has the right law, and the first normals fix its large-scale shape, which chapter 26 exploits with low-discrepancy points. (ii) Monitoring a barrier between grid points: simulate the path at the observation dates only, and for each interval multiply the probabilities of not crossing, with from part (ii). One minus the product is an unbiased estimate of the continuous crossing probability, with no grid refinement.
Two closes each 1% above the stop, one day apart at 30% volatility, leave a 57% chance that the stop was touched in between: . The simulation of Figure 2.3 that adds these probabilities to daily closes recovers the continuous answer, 81.6%, with no finer grid.
2.6 Tutorial: stops, reflections and quadratic variation
Goal. Simulate Brownian paths two ways, check the reflection principle and the quadratic variation, and price the hook’s stop-loss by continuous and discrete monitoring. End state: Figures 2.1, 2.2, 2.3 and 2.4 and the probabilities 81.6% and 72.0%.
Paths, by increments and by the bridge construction of Method 2.15(i).
return np.concatenate([np.zeros((n_paths, 1, d)), np.cumsum(dw, axis=1)], axis=1) def bridge_paths(n_paths: int, levels: int, T: float, seed: int) -> np.ndarray: """Brownian paths on 2**levels steps built coarse to fine: W_T first, then the midpoints of each interval from the Brownian-bridge law N((W_l + W_r)/2, h/4) on an interval of length h.""" rng = np.random.default_rng(seed) n = 2**levels dt = T / n w = np.zeros((n_paths, n + 1)) w[:, n] = math.sqrt(T) * rng.standard_normal(n_paths) step = n while step > 1: half = step // 2 mids = np.arange(half, n, step) z = rng.standard_normal((n_paths, mids.size))Listing 2.1. Brownian paths built coarse to fine by the bridge. code/firm/mcengine/firm_mcengine.py The stop: observe the log price at a given number of times a day, and optionally add the bridge crossing probability between observations.
def simulate_touch(b: float, sigma: float, days: int, per_day: int, n_paths: int, seed: int, bridge: bool = False) -> tuple[float, float]: """Monte Carlo probability that the log price (driftless, volatility sigma) is at or below b at one of `per_day` equally spaced observations a day; with bridge=True, each interval's crossing probability is added analytically (the Brownian-bridge correction). Returns the estimate and its standard error.""" n = days * per_day dt = 1.0 / (YEAR * per_day) x = sigma * brownian_paths(n_paths, n, n * dt, seed) # log price minus its start hit_grid = (x <= b).any(axis=1) if not bridge: est = hit_grid.astype(float) else: p_cross = bridge_crossing_probability(x[:, :-1], x[:, 1:], b, sigma**2 * dt) est = 1.0 - np.prod(1.0 - p_cross, axis=1) return float(est.mean()), float(est.std() / math.sqrt(n_paths))Listing 2.2. Discrete monitoring of a stop, with and without the bridge correction. code/methods/02-brownian-motion/python/qm_brownian.py - Run
stop_problem(),convergence_table()andfig_brownian.py; check that the C++20 and Rust engines draw the same normals as Python from the same seed (code/firm/mcengine/).
What to change next. Replace the fixed stop by a trailing stop 2% below the running maximum and find its trigger probability; give the log price the drift and compare the simulation with Proposition 2.9.
2.7 Build: the Monte Carlo engine, stage one
Purpose. Every simulation of the miniature firm draws its paths here: this chapter’s Brownian paths, the stochastic differential equations of chapter 4, and the variance reduction and low-discrepancy points of chapter 26.
Interface. SplitMix64(seed), NormalStream(seed) (Box–Muller, cosine first); brownian_paths(n_paths, n_steps, T, seed, corr=None); bridge_paths(n_paths, levels, T, seed); bridge_crossing_probability(x0, x1, barrier, var); in C++20 and Rust, brownian_path, bridge_path and bridge_crossing_probability over a NormalStream.
Rules. The reference stream (SplitMix64, Box–Muller) is identical in the three languages; bulk Python paths use NumPy’s PCG64; correlated paths through the Cholesky factor of the correlation matrix; seeds are explicit arguments, never global state.
Acceptance tests. code/firm/mcengine/{tests,cpp,rust}: the SplitMix64 test vector; the first normals and a four-step path equal in the three languages to ; and for both constructions; the crossing formula against a fine simulation.
Stretch. Antithetic pairs; a counter-based generator whose streams can be split across threads (chapter 26).
Sources and further reading
- L. Bachelier, “Théorie de la spéculation”, Annales scientifiques de l’École Normale Supérieure 17, 1900.
- N. Wiener, “Differential-space”, Journal of Mathematics and Physics 2, 1923.
- M. D. Donsker, “An invariance principle for certain probability limit theorems”, Memoirs of the AMS 6, 1951.
- M. Broadie, P. Glasserman and S. Kou, “A continuity correction for discrete barrier options”, Mathematical Finance 7, 1997.
- I. Karatzas and S. E. Shreve, Brownian Motion and Stochastic Calculus, Springer, 2nd ed., 1991.
2.8 Exercises
Exercise 2.1 ★
Compute , and the correlation of and .
Solution
Solution of Exercise 2.1.
; ; correlation .
Exercise 2.2 ★
What is the probability that a standard Brownian motion reaches 1 before time 1?
Solution
Solution of Exercise 2.2.
By the reflection principle, .
Exercise 2.3 ★
A stock has an annual volatility of 20%. What is the standard deviation of its log return over one day and over one week of five trading days?
Solution
Solution of Exercise 2.3.
a day; times that, 2.82%, a week.
Exercise 2.4 ★★
A stop sits 5% below the entry of a stock with 30% volatility. What is the probability it is touched within three months (63 trading days) if watched continuously, and if watched at the closes only?
Solution
Solution of Exercise 2.4.
, : continuously ; at the closes, the level shifted by gives 67.8%.
Exercise 2.5 ★★
Show that is a martingale, and deduce the expected time for to leave the interval , .
Solution
Solution of Exercise 2.5.
, so is a martingale. With the exit time, ; letting (bounded convergence on the left, monotone on the right) and using : .
Exercise 2.6 ★★
For a Brownian bridge from 0 to 0 on , give the law of its value at and the probability that it reaches .
Exercise 2.7 ★★★
Coding. The sum of squared increments of on at points has standard deviation . Check it by simulating 2 000 paths at , and say whether the fluctuations of Figure 2.4 are consistent with it.
Solution
Solution of Exercise 2.7.
: at the standard deviation is 0.022, and 2 000 simulated paths give 0.022. The figure’s value at 4 096 points, 1.031, is 1.4 standard deviations from 1: consistent.
Exercise 2.8 ★★★
Find the flaw. “Our Monte Carlo for a contract that knocks out if the stock ever trades below a barrier simulates daily closes and checks them against the barrier; the price has converged to four digits.” Correct it.
Solution
Solution of Exercise 2.8.
Checking daily closes prices a contract monitored daily, not continuously: it misses every crossing between closes and underestimates the knock-out probability by several points (72% against 82% for the 2% stop of the chapter). More paths only reduce the statistical error, not this bias, which falls like . Add each interval’s bridge crossing probability, or price the continuous contract with the level shifted by to check.
2.9 Problem: The Stop-Loss
Problem 2.1
Weekend problem — how often a 2% stop is touched in a month
A stock with an annual volatility of 30% is bought with a stop 2% below the entry. Its log price is modelled as a Brownian motion with volatility and no drift, over 21 trading days of a 252-day year.
Part I — The continuous stop.
- What is the stop level in log price, and the standard deviation over the month?
- What is the probability that the stock ends the month below the stop?
- What is the probability that it touches the stop during the month, watched continuously?
- Why is the second number exactly twice the first?
- With the drift that makes the price a martingale, what does Proposition 2.9 give?
Part II — Watched at the close.
- What does a simulation of 200 000 months of daily closes give?
- What is the Broadie–Glasserman–Kou shift with daily closes, and the equivalent continuous stop?
- What probability does the shifted level give?
- Watched every 15 minutes (26 times a day), what do the simulation and the shift give?
- Why does refining the grid by four only halve the gap to the continuous answer?
Part III — The bridge.
- Two consecutive closes are each 1% above the stop. What is the probability the stop was touched between them?
- What does the daily simulation give once each day’s crossing probability is added?
- Why is this estimate unbiased for the continuous probability?
- Which is cheaper for a target accuracy: 64 observations a day, or daily observations with the bridge?
Part IV — Judgement.
- At 15% volatility, what is the continuous probability?
- Over three months, what are the continuous and daily-close probabilities?
- The stop is a resting order on the exchange; which number applies, and what does the model miss?
- The desk sells a note that knocks out on a daily close below the level. Which number should price it?
- State the named result: the probability that the 2% stop is touched in a month, continuously and at the closes.
- In one sentence: why is a barrier watched continuously so much more likely to be touched than one watched daily?
Solution
Solution of Problem 2.1.
1. ; . 2. . 3. . 4. By the reflection principle each path that touches the stop and ends above it is paired with its mirror image, which ends below. 5. 82.4%: the negative drift makes the touch slightly likelier. 6. 72.0% (standard error 0.1 point). 7. in log price: the stop behaves like a 3.1% stop watched continuously. 8. 71.9%. 9. 79.6% by simulation, 79.6% by the shift. 10. The overshoot, and hence the error, is of order : dividing by four halves it (77.1%, 79.1%, 80.5% at 4, 16 and 64 observations a day). 11. . 12. 81.6% (standard error 0.08 point), equal to the continuous answer. 13. Given the closes, the crossings in different days are independent bridges, so is the conditional probability of a touch; its mean is the unconditional one. 14. The bridge: it is exact at the cost of daily steps, while 64 steps a day still leave a 1-point bias at 64 times the cost. 15. 64.1%. 16. 89.3% continuously, 83.5% at the closes. 17. The continuous number, 82%; the model misses gaps (the order fills below the stop when the price jumps through it), volatility that is not constant, and intraday patterns. 18. The daily-close number, 72%: the contract is monitored at the closes. 19. Named result: the stop-loss: a 2% stop on a 30%-volatility stock is touched within a month with probability 81.6% if watched continuously and 72.0% if watched at the closes; the Broadie–Glasserman–Kou shift gives 71.9% and the bridge-corrected daily simulation 81.6%. 20. Because a Brownian path crosses and re-crosses a level between observations, and the closes see only the crossings that last until the close.
2.10 Interview questions
Interview question 2.1 ★ trader, researcher
A driftless Brownian motion starts at 0. What is the probability it hits before ?
Solution
Solution of Interview question 2.1.
is a bounded martingale up to the exit, so : , .
What the interviewer is looking for: optional stopping in one line.
Interview question 2.2 ★ researcher
Why is the quadratic variation of a Brownian path , and why does it matter for trading?
Solution
Solution of Interview question 2.2.
The squared increments over a partition have mean equal to the elapsed time and a variance that vanishes with the mesh. It is why the variance of a hedged book accumulates with time whatever the rebalancing frequency, why volatility is measurable from one path, and why Itô’s formula has a second-order term.
What the interviewer is looking for: the computation and its consequences.
Interview question 2.3 ★★ researcher, trader
What is the expected maximum of a standard Brownian motion over ?
Solution
Solution of Interview question 2.3.
By the reflection principle has the law of , so .
What the interviewer is looking for: reflection, then the half-normal mean.
Interview question 2.4 ★★ developer, researcher
How do you price a continuously monitored barrier by Monte Carlo without taking tiny time steps?
Solution
Solution of Interview question 2.4.
Simulate on the grid you need anyway and, in each interval, multiply by the bridge probability of not crossing, (or sample the crossing with that probability); for a quick check, shift the level by .
What the interviewer is looking for: the Brownian-bridge crossing probability.
Interview question 2.5 ★★ risk, trader
A trader says a 2% stop on a 30%-volatility stock is triggered about 40% of the time in a month. What did they compute, and what is the right number?
Solution
Solution of Interview question 2.5.
The probability of ending the month below the stop, 41%. A stop is triggered by the minimum, not the terminal value; by reflection the right number is twice that, 82% continuously, 72% if only closes count.
What the interviewer is looking for: terminal versus path-dependent probability.
Interview question 2.6 ★★★ researcher
Compute .
Solution
Solution of Interview question 2.6.
are independent standard normals , and the event is , : a wedge of angle in the plane, so the probability is .
What the interviewer is looking for: rotational symmetry of the Gaussian.