Conditional Monte Carlo and Rao-Blackwellization
A variance-reduction trick that replaces part of a simulation with an exact formula whenever one exists, so you only simulate the part you genuinely can't compute — and the result is provably never noisier than simulating everything.
Prerequisites: Monte Carlo Integration, The Law of Large Numbers
Simulating something end to end is easy to code but can be wasteful: if part of the calculation could actually be done exactly with a closed-form average, simulating it anyway just adds noise you didn't need to add. Conditional Monte Carlo — the technique behind Rao-Blackwellization — says: whenever a piece of your simulation has a known conditional expectation, replace that piece with its exact formula and simulate only the part left over. The result is mathematically guaranteed to have the same expected value but less variance, for free, every time such a piece exists.
An analogy: a weather forecaster who knows tomorrow's average
Suppose you want to estimate ice cream sales next month by simulating each day: draw a random temperature, then draw random sales conditional on that temperature, and average the results over many simulated days. But suppose you actually know, from a solid model, the exact average sales for any given temperature — no need to simulate that step at all. A smarter approach: simulate only the random temperatures (the part you truly don't know in advance), and for each simulated temperature just plug into the known average-sales formula instead of drawing a noisy random sales figure. You still get the right average sales estimate, but you've removed an entire layer of unnecessary randomness — the sales-given-temperature noise — that was adding variance without adding information.
The idea, one symbol at a time
Suppose you want where depends on two sources of randomness, and there's an intermediate variable such that the conditional expectation has a known closed form. By the law of total expectation, — so instead of simulating pairs and averaging the 's, you can simulate only and average instead, since both give the same expected value.
The variance comparison is the key result, sometimes called the Rao-Blackwell theorem in this context: by the law of total variance, . Since always, we get
meaning the conditional estimator has variance at most as large as simulating directly — strictly smaller whenever has any genuine leftover randomness given . In plain English: you've thrown away exactly the noise that carried no information about the answer (the within- variation of ), and kept only the noise that actually mattered (the variation of itself).
Worked example: pricing a barrier-dependent payoff
Suppose you simulate a stock path and want the expected payoff of a claim that pays if the path never crosses a barrier, and 0 if it does. Plain Monte Carlo simulates the full path, checks whether the barrier was crossed, and averages the payoff over many simulated paths — noisy, since each path's "crossed or not" outcome is a coin flip contributing binary noise. Conditional Monte Carlo instead notes that, given the path's terminal value (or a coarser summary of the path), the exact probability of not having crossed the barrier along the way has a known closed-form formula from reflection-principle arguments for Brownian motion. So instead of simulating the crossing event, you simulate only , and for each simulated you multiply by the exact non-crossing probability rather than a simulated 0/1 indicator — replacing binary-outcome noise with a smooth exact number every single path.
The explorer below lets you compare a binomial distribution against different parameters — try shrinking toward 1 to see the raw, high-variance coin-flip outcome that conditional Monte Carlo replaces with a smooth exact probability instead.
Worked example: a numeric variance comparison
Suppose and, given , (so is 0 or 1, with success probability equal to itself). Here . Plain Monte Carlo estimates by simulating , then simulating a coin flip with that probability, and averaging the 0/1 outcomes: . With uniform on , and , giving . The conditional estimator skips the coin flip and just averages directly, giving variance — roughly a threefold reduction in variance from removing the coin-flip noise, using the exact same number of simulated draws of .
What this means in practice
Conditional Monte Carlo (also called Rao-Blackwellization when framed as an estimator-improvement principle) shows up in option pricing whenever a sub-piece of the payoff has a known conditional formula — barrier options conditioned on terminal value, Asian options conditioned on a subset of averaging dates — and in particle filtering, where analytically tractable sub-states are integrated out exactly rather than sampled (see particle filters). The general lesson for any simulation project: before writing code that simulates everything, check whether any intermediate step has a known exact conditional average, and if so, plug in the formula instead of a random draw — it is never worse and often much better, for the same computational effort.
Whenever part of a simulation has a known conditional expectation, replacing that simulated piece with its exact formula and simulating only what's left over cannot increase variance and typically reduces it substantially, since it removes exactly the noise that carried no information about the final answer.
The trap is applying conditional Monte Carlo to a variable whose "exact" conditional formula is only an approximation, or forgetting that the technique requires the conditional expectation to be genuinely tractable in closed form — not just plausible-looking. If is itself estimated with error (say, from a separate small simulation or an approximate formula), you've reintroduced noise you thought you'd eliminated, and the clean variance-reduction guarantee no longer holds. Always verify the conditional expectation step is exact, not merely convenient, before trusting the variance comparison.
Related concepts
Practice in interviews
Further reading
- Glasserman, Monte Carlo Methods in Financial Engineering, ch. 4
- Casella, Robert, Rao-Blackwellisation of sampling schemes