Making Monte Carlo cheaper: control variates for SDE simulation

Stochastic differential equations rarely have closed-form solutions, so if you want E[g(XT)]\mathbb{E}[g(X_T)] for some functional gg of the solution, you simulate: discretize the equation, generate many paths, average. That gives you two separate errors. Discretization contributes a bias of order O(Δt)\mathcal{O}(\Delta t), and averaging finitely many paths contributes a statistical error of order O(N1/2)\mathcal{O}(N^{-1/2}).

The second rate is the annoying one. It doesn’t care about the dimension of the problem, which is why Monte Carlo is used at all — but it is slow. Cutting the error by a factor of ten costs a hundred times more paths. Since the cost per path is fixed, buying accuracy by brute force stops being viable very quickly.

The root mean squared error of the estimator is

RMSE=σgN,\text{RMSE} = \frac{\sigma_g}{\sqrt{N}},

and NN sits in the denominator, but σg\sigma_g sits in the numerator. This is the whole idea behind my seminar paper: instead of pushing NN up, push σg\sigma_g down.

The setup

Take an Itô process

dXt=μ(t,Xt)dt+σ(t,Xt)dBtdX_t = \mu(t, X_t)\,dt + \sigma(t, X_t)\,dB_t

and approximate it with the Euler–Maruyama scheme on a uniform grid tn=nΔtt_n = n\,\Delta t:

Yn+1=Yn+μ(tn,Yn)Δt+σ(tn,Yn)ΔBn,ΔBnN(0,Δt).Y_{n+1} = Y_n + \mu(t_n, Y_n)\,\Delta t + \sigma(t_n, Y_n)\,\Delta B_n, \qquad \Delta B_n \sim \mathcal{N}(0, \Delta t).

The Monte Carlo estimator θ^Δ=1Nig(YM(i))\hat{\theta}_\Delta = \frac{1}{N}\sum_i g(Y_M^{(i)}) is unbiased for the discretized target E[g(YM)]\mathbb{E}[g(Y_M)]; its bias relative to the true E[g(XT)]\mathbb{E}[g(X_T)] is exactly the weak error of the scheme, which for Euler–Maruyama is O(Δt)\mathcal{O}(\Delta t). Those are two different knobs — Δt\Delta t controls the bias, and everything below is about the variance.

Control variates

The trick is to pair each simulation output AiA_i with a second quantity CiC_i computed on the same path, whose expectation you happen to know exactly. Then for any fixed bb,

Ai(b)=Aib(CiE[C]),A_i(b) = A_i - b\,(C_i - \mathbb{E}[C]),

and averaging gives A^(b)=A^b(C^E[C])\hat{A}(b) = \hat{A} - b(\hat{C} - \mathbb{E}[C]). Since E[C^E[C]]=0\mathbb{E}[\hat{C} - \mathbb{E}[C]] = 0, the correction term has mean zero, so the estimator stays unbiased no matter what bb you pick. What changes is the variance:

Var[A(b)]=σA22bσCσAρCA+b2σC2,\text{Var}[A(b)] = \sigma_A^2 - 2b\,\sigma_C\sigma_A\rho_{CA} + b^2\sigma_C^2 ,

minimized at

b=Cov[C,A]Var[C],Var[A^(b)]Var[A^]=1ρCA2.b^* = \frac{\text{Cov}[C, A]}{\text{Var}[C]}, \qquad \frac{\text{Var}[\hat{A}(b^*)]}{\text{Var}[\hat{A}]} = 1 - \rho_{CA}^2 .

Two things worth noticing. First, bb^* is literally the slope of a linear regression of AA on CC — the method is regressing out the part of the noise that the control can explain. Second, the payoff is entirely governed by ρCA2\rho_{CA}^2: a control correlated at 0.50.5 buys you 25% of the variance, while one correlated at 0.990.99 buys you 98%. Weak controls are nearly worthless, and good ones are dramatic.

In practice bb^* is unknown and gets estimated from the same sample as b^=Cov^[C,A]/Var^[C]\hat{b} = \widehat{\text{Cov}}[C, A] / \widehat{\text{Var}}[C]. That reintroduces a small bias of order O(1/N)\mathcal{O}(1/N)b^\hat{b} and the term it multiplies are no longer independent — but it is dominated by the O(N1/2)\mathcal{O}(N^{-1/2}) standard error and is normally ignored.

A small example first: estimating π\pi

Throw points uniformly into the unit square and count how many land in the quarter disc. The scaled indicator ψ=41{x2+y21}\psi = 4 \cdot \mathbb{1}\{x^2 + y^2 \le 1\} has mean π\pi. As a control, take the average squared distance from the origin, C=1mj(xj2+yj2)C = \frac{1}{m}\sum_j (x_j^2 + y_j^2), whose expectation is 13+13=23\frac13 + \frac13 = \frac23 — no simulation needed, just two integrals.

Three panels: Monte Carlo sampling of points in the unit square, a scatter plot of the empirical π estimate against the control variate with a fitted regression line, and a bar chart comparing the variance of the naive and control-variate estimators, showing a 63.55% reduction.

The middle panel is the point: the empirical π\pi and the control move together, and the fitted regression line is b^\hat{b}. Subtracting that fitted component removes about 64% of the variance with m=100m=100 points per trial over n=60n=60 trials — for the cost of one extra sum per point.

A martingale as the control

For SDEs there’s a natural source of controls with known expectations: martingales. A martingale satisfies E[XtFs]=Xs\mathbb{E}[X_t \mid \mathcal{F}_s] = X_s, so its expectation is pinned to its starting value — the “known expectation” requirement comes for free. And if you build one from the same Brownian increments ΔBn\Delta B_n that drive your simulation, it picks up the same noise, which is where the correlation comes from.

The concrete case in the paper is a European call under geometric Brownian motion. The asset follows dSt=rStdt+σStdBtdS_t = rS_t\,dt + \sigma S_t\,dB_t, and the target is the discounted payoff A=erTmax(STK,0)A = e^{-rT}\max(S_T - K, 0). (There is a closed-form answer here, of course; the point is to pretend there isn’t and check the method against something verifiable.)

Consider the discounted price Zt=ertStZ_t = e^{-rt}S_t and apply Itô’s formula. Since h(t,x)=ertxh(t,x) = e^{-rt}x is linear in xx, the second-order term vanishes:

dZt=rertStdt+ert(rStdt+σStdBt)=ertσStdBt.dZ_t = -re^{-rt}S_t\,dt + e^{-rt}\left(rS_t\,dt + \sigma S_t\,dB_t\right) = e^{-rt}\sigma S_t\,dB_t .

The drift cancels exactly. What’s left is a pure Itô integral, which is a martingale, so E[ZT]=Z0=S0\mathbb{E}[Z_T] = Z_0 = S_0.

There is one detail that matters in practice. The simulation doesn’t produce STS_T, it produces the Euler–Maruyama approximation YMY_M, so the control that actually gets used is CΔ=erTYMC_\Delta = e^{-rT}Y_M — and its expectation is not S0S_0. Taking expectations through the scheme with E[ΔBn]=0\mathbb{E}[\Delta B_n] = 0 gives

E[CΔ]=S0erT(1+rΔt)M,\mathbb{E}[C_\Delta] = S_0\,e^{-rT}(1 + r\Delta t)^M ,

which is again known exactly, in closed form. Using the discrete expectation rather than the continuous one is what keeps the corrected estimator unbiased with respect to the discretized target instead of picking up a fresh O(Δt)\mathcal{O}(\Delta t) bias through the back door.

What it does, and where it stops working

Simulating N=10,000N = 10{,}000 paths with M=100M = 100 steps, S0=50S_0 = 50, r=0.05r = 0.05, T=0.25T = 0.25, σ=0.3\sigma = 0.3, and sweeping the strike:

Strike KKρCA\rho_{CA}Var (plain)Var (with CV)Reduction
400.99452.60.6198.8%
450.96741.52.6993.5%
500.89525.04.9780.1%
550.76711.54.7558.8%
600.6034.242.7036.4%
650.4311.351.1018.6%
700.2830.400.378.0%

Variance of the discounted payoff with and without the control variate, plotted against strike price, together with the correlation and the fraction of variance removed. Both the correlation and the reduction fall steadily as the strike rises from 40 to 70.

Deep in the money, the control removes 99% of the variance — the same accuracy for roughly 1% of the paths. That is a much better deal than anything you get by increasing NN.

But the effect decays fast, and the reason is structural rather than numerical. When KK is well below S0S_0, the option almost always pays out, the payoff is essentially erTSTe^{-rT}S_T minus a constant, and the discounted price tracks it almost perfectly. As KK rises, the max(,0)\max(\cdot, 0) starts clipping more and more paths to zero. The payoff stops being a linear function of the terminal price, the correlation collapses, and with it — quadratically — the benefit. By K=70K = 70 the control is doing almost nothing.

That failure mode is what makes the last observation interesting. The optimal coefficient is a regression slope, and the method is a linear projection onto a single hand-picked control. Nothing forces it to stay linear or hand-picked: for payoffs too awkward to handle analytically, you could train a model to produce a control that is highly correlated with the payoff and whose expectation is still known. That’s the direction I’d like to take this next.


Full write-up, with the definitions, proofs and references: Monte Carlo Simulation of SDEs and Variance Reduction via Control Variates (PDF).