The third method sits between the other two in spirit: like the parametric method, it starts from an assumed model (most simply, the same Normal(mu, sigma) assumption); unlike the parametric method, it never touches a closed-form quantile formula. Instead, it draws a large number of simulated returns from the assumed model and then reads the tail off the simulated sample using exactly the same order-statistic procedure historical simulation used on a real sample.
How do you build and check a Monte Carlo VaR?
Two engineering details make this method actually work as a graded, reproducible exercise rather than a source of flaky, unrepeatable numbers. First, the random draws must come from a seeded generator: numpy.random.default_rng(seed), never the unseeded global numpy.random state, so that calling the function twice with the same seed reproduces the identical result, on any machine, every time. This is not a nicety for this course; it is the entire reason the hidden tests can grade Monte Carlo code at all, and it is precisely the same "seeds, not vibes" discipline QD1.03 demanded of a strategy backtest and QD2.04 will demand of an entire research pipeline. Second, because you are only ever approximating a distribution you could, in this Normal case, have computed exactly with the parametric formula, the correct sanity check on a Monte Carlo implementation is not "does it match some hardcoded number" but "does it converge to the parametric answer as the number of simulated draws grows", which is exactly what code pack exercise QD2.02-e03's hidden tests check, within a generous statistical tolerance, since a Monte Carlo estimate is itself a random variable with its own sampling error.
Running 20,000 seeded draws from mu = 0.02%, sigma = 1.5%, at 99% confidence gives a Monte Carlo VaR of 3.473% and ES of 3.966%, against a parametric answer of 3.470% and 3.978% on the exact same parameters, a relative gap of about a tenth of a percent on VaR and three tenths of a percent on ES, comfortably inside the sampling noise you would expect from 20,000 draws of a quantile estimator. Widen the simulation to 200,000 draws and that gap shrinks further; this convergence, not any single number, is the actual proof that your simulation code is correct.
Advertisement
When is Monte Carlo VaR worth the extra work?
The payoff for accepting this extra machinery is flexibility the closed-form parametric method cannot offer at any price. Swap the Normal draw for a fatter-tailed distribution, a correlated multi-asset simulation, or a genuinely path-dependent payoff (an option, a barrier, a stop-loss rule), and the exact same "simulate, then read the tail off the sample" logic still works untouched, where the parametric method would need an entirely new closed-form derivation, if one exists at all. Monte Carlo is the method you reach for the moment the assumption you actually believe in stops having a convenient formula.