The maths, gently

Latin Hypercube vs Monte Carlo: a steadier P80 in a fraction of the runs

RunMonteCarlo team · 8 min read

Two people run the same schedule risk model, 2,000 iterations each, same ranges. One reads a P80 of day 214. The other reads day 219. Neither is wrong — that five-day wobble is sampling noise, the price you pay for estimating a tail from a finite pile of random draws. The usual cure is brute force: run more iterations until the wobble shrinks. There is a quieter cure that most practitioners never turn on, and it is the default in RunMonteCarlo: Latin Hypercube sampling (LHS). It buys you the same steadiness at a fraction of the iterations. Here is why.

Plain Monte Carlo leaves gaps

Ordinary Monte Carlo samples each uncertain duration independently and at random. Over enough draws the samples fill out the distribution nicely — but "enough" is the catch. With a few thousand purely random draws, some parts of a distribution get crowded and others get missed entirely, purely by luck. The rare-but-costly tail of a duration, the part that actually sets your P80, might get two draws in one run and eleven in the next. That is exactly the region you care most about, sampled worst.

The error of a plain Monte Carlo estimate shrinks slowly — as the square root of the number of runs:

Monte Carlo standard error ∝ 1 / √N

Quadruple the iterations, halve the noise. To cut the wobble by ten you run a hundred times as long. That is the treadmill every risk analyst has been on since Pertmaster.

Latin Hypercube fills the gaps on purpose

LHS refuses to leave coverage to luck. For each uncertain input it slices the distribution into N equal-probability bands — if you are running 2,000 iterations, that's 2,000 horizontal slices of the cumulative curve, each holding 1/2,000th of the probability. It then draws exactly one value from every band, and shuffles the order of the bands independently for each input before pairing them up across iterations.

The consequence is simple and powerful: after a single pass, every part of every distribution has been visited — the fat middle and the thin tails alike, in exact proportion to their probability. No region is over- or under-sampled by chance, because chance was taken out of the coverage. Randomness survives only in where inside each band the draw lands and in how the bands pair across inputs — which is what keeps the result an honest random sample rather than a rigid grid.

Split each input into N equal-probability bands → draw once per band → shuffle bands per input → run N iterations

The technique goes back to McKay, Beckman and Conover's 1979 Technometrics paper; the stratification is what does the work.

How much does it actually save?

For the quantity most schedule risk lives on — a percentile of an output distribution — the improvement is dramatic. Where plain Monte Carlo error falls as 1/√N, Latin Hypercube error can fall closer to 1/N for the smooth, well-behaved part of the problem:

Latin Hypercube standard error ∝ 1 / N (vs 1 / √N for plain MC)

Read that as: to match the precision of N Latin Hypercube runs, plain Monte Carlo may need on the order of runs. Analytica's team put numbers on it with a clean test — estimating the mean of a standard Normal at 100 samples, they measured randomised LHS error roughly twenty times smaller than plain Monte Carlo at the same sample count (Analytica, "Latin Hypercube vs Monte Carlo sampling"). In a schedule model the gain is usually less extreme than 20× — but a stable P80 at 2,000 LHS iterations that would need many times that in plain Monte Carlo is an entirely ordinary result.

SamplingError vs runsTo halve the noise
Plain Monte Carlo∝ 1 / √N4× the iterations
Latin Hypercube≈ 1 / N2× the iterations

The honest caveat — and why schedule risk sidesteps it

Latin Hypercube's edge is largest when a few inputs dominate the output. When many variables contribute roughly equally, their independent errors partly cancel on their own, and the stratification advantage narrows — David Vose's nine-input test is the classic demonstration that with enough equally-weighted drivers, LHS and plain MC converge (Risk Analysis: A Quantitative Guide).

Here is the thing: schedule risk is almost never the equal-weight case. A project's completion distribution is driven by the handful of activities on and near the critical path. Everything else has float and contributes almost nothing to the finish date. That is the exact regime — a few dominant drivers — where Latin Hypercube pays the most. The property that makes hand methods fail (only a few paths matter, and they shift under risk — see merge bias) is the same property that makes LHS shine.

"But my durations are correlated"

They should be — trades share weather, crews and productivity, and pretending otherwise understates the tail. A fair worry is whether stratifying each input separately breaks the correlation structure. It doesn't. Latin Hypercube composes cleanly with correlation: you stratify the marginals, then impose the dependency by reordering the samples to hit a target rank correlation — the Iman & Conover method (1982) — or, equivalently, drive the strata through a copula. RunMonteCarlo uses a Gaussian copula for correlation and still stratifies underneath it, so you get correlated and well-covered durations at once. Details are on The Maths.

Isn't stratifying slower?

Effectively no. The one-time cost is turning a uniform draw into a value on your distribution — the inverse CDF. For the Normal that has no closed form, but Acklam's rational approximation computes it to machine precision in a few multiplications, so an LHS draw costs about the same as a plain one. And in a schedule model the sampling is a rounding error next to the real work: re-solving the CPM network over thousands of iterations. You get the variance reduction essentially for free. RunMonteCarlo already cites Acklam's inverse-normal in The Maths for precisely this reason.

How RunMonteCarlo implements it

Latin Hypercube isn't a buried expert option in RunMonteCarlo — it's how the engine samples by default, and it's the same seeded, reproducible pipeline the rest of the tool runs on:

There's a practical payoff on the Free tier, which caps runs at 2,000 iterations: because Latin Hypercube extracts more signal per iteration, that cap reads a steadier P80 than 2,000 plain Monte Carlo draws ever could. The cap stops being a limitation and starts being plenty.

What to do with this on Monday

Every distribution in RunMonteCarlo is stratified this way out of the box — import a P6 or MS Project file, set your ranges, and read a P80 you can trust at iteration counts that finish in seconds.

References

  1. M. D. McKay, R. J. Beckman and W. J. Conover, "A Comparison of Three Methods for Selecting Values of Input Variables in the Analysis of Output from a Computer Code," Technometrics, 21(2), 239–245, 1979.
  2. R. L. Iman and W. J. Conover, "A Distribution-Free Approach to Inducing Rank Correlation Among Input Variables," Communications in Statistics – Simulation and Computation, 11(3), 311–334, 1982.
  3. P. J. Acklam, "An Algorithm for Computing the Inverse Normal Cumulative Distribution Function," 2010.
  4. D. Vose, Risk Analysis: A Quantitative Guide, 3rd ed., Wiley, 2008 (the multi-input comparison of LHS and Monte Carlo convergence).
  5. Analytica (Lumina Decision Systems), "Latin Hypercube vs Monte Carlo sampling," analytica.com/blog/latin-hypercube-vs-monte-carlo-sampling.

A steadier P80, right in your browser.

Latin Hypercube sampling and a Gaussian copula, on by default. Import a P6 or MS Project file, build the register, press Run. Free tier included; your schedule never leaves your machine.

Launch RunMonteCarlo →