Core Path · L3.2.11

Monte Carlo VaR

12 minMarket riskVaRMonte CarloSimulation

By the end you will be able to

  1. 1Simulate correlated factor moves with a Cholesky factor of the covariance matrix, with lognormal prices.
  2. 2Revalue a book in full on each path and read VaR off the simulated P&Ls.
  3. 3Measure Monte Carlo accuracy with the standard error of a quantile, and choose the number of paths.
  4. 4Explain how the model, not the number of paths, decides how close Monte Carlo gets to reality.

Why it matters

Historical simulation can only replay the days that happened: 750 of them here, and only 8 in the 1% tail. Monte Carlo draws as many days as you can afford from a model of the risk factors. On RiskAtoms Bank's desk, 10,000 simulated days take well under a second. The catch is twofold: the answer is only as good as the model, and it moves every time you change the seed.

Core explanation

Thousands of days that never happened

Illustrative dataRiskAtoms Bank plc's Markets desk

One made-up trading book on one made-up valuation day, in pounds: eight positions in four books, eight risk factors and 750 days of simulated factor moves. The levels (UK index 8,000, GBP/USD 1.30, Brent $80 and so on) are round illustrative numbers, not market data. The same book runs through every lesson in Module 3.2, so the figures agree from lesson to lesson.

The model: factor moves jointly normal with the book's calm covariance matrix COV, mean zero. The module's run uses 10,000 paths and seed 32110. One day, pounds.

Monte Carlo VaR keeps the full revaluation of L3.2.10: Historical simulation in practice but replaces the history with a model. Click through the recipe:

ExploreMonte Carlo VaR in five steps

Click a box to see what happens there.

1. Model

Choose a distribution for the day's factor moves. Here: the eight moves are jointly normal with the covariance matrix of L3.2.09: Parametric VaR for a portfolio. Log-return factors give lognormal prices.

Correlated draws: the Cholesky factor

Independent normals are easy to generate; correlated ones are not. The trick is a matrix square root. A Cholesky factor LL of the covariance matrix satisfies LL⊤=ΣLL^\top = \Sigma, and then x=Lzx = Lz has covariance Σ\Sigma. For the UK index, the US index and UK vol:

Σ3=10−4×(1.00.7−60.00.71.2−48.4−60.0−48.46,400.0)\Sigma_3 = 10^{-4} \times \begin{pmatrix} 1.0 & 0.7 & -60.0 \\ 0.7 & 1.2 & -48.4 \\ -60.0 & -48.4 & 6{,}400.0 \end{pmatrix}
L3=(0.01000.00000.00000.00660.00880.0000−0.6000−0.10000.5196)L_3 = \begin{pmatrix} 0.0100 & 0.0000 & 0.0000 \\ 0.0066 & 0.0088 & 0.0000 \\ -0.6000 & -0.1000 & 0.5196 \end{pmatrix}

Read L3L_3 row by row. The UK index move is just 1% × z1z_1. The US index gets 0.0066 × z1z_1 (its link to the UK) plus its own 0.0088 × z2z_2. UK vol loads −0.60 on z1z_1, so it rises when the UK index falls. The full 8 × 8 factor used for the desk:

Cholesky factor L of COV (lower triangle; each row's units are its factor's)
UK indexUS index2y rate10y rateGBP/USDBrentUK volIG spread
UK index0.01000000000
US index0.00660.0088000000
2y rate0.600.305.9600000
10y rate1.050.535.154.590000
GBP/USD−0.00100.00140.0010−0.00030.0046000
Brent0.00600.00300.00130.00140.00240.018600
UK vol−0.60−0.10−0.0151−0.0174−0.190.02120.480
IG spread−1.25−0.63−0.0943−0.11−0.48−0.230.411.96

Lognormal prices

The equity, FX and oil moves are log returns, so a simulated price is S=S0 exS = S_0\,e^{x}: a lognormal price (M-C07: The lognormal distribution). It cannot go below zero, and it is skewed: at the 1st and 99th percentiles the UK index ends the day at 7,816 and 8,188, a fall of 184 points against a rise of 188, and its mean is 8,000.40, a touch above 8,000. Rates, the spread and implied vol are moved by normal amounts in bp or vol points.

The desk's Monte Carlo VaR

02004006008001000−4m−2m0m2m4mPathsDaily P&LVaR
Method99% one-day VaRWhat it assumes
Delta-normal (L3.2.09)£1.944mNormal moves, linear positions
Monte Carlo, deltas on the same paths£1.944mNormal moves, linear positions, sampled
Monte Carlo, full revaluation£1.848mNormal moves, positions repriced
Monte Carlo, stressed covariance£4.160mNormal moves at stressed vols and correlations
Historical simulation, 750 days (L3.2.10)£2.274mThe past 750 days, repriced

Two comparisons tell the story. Valued with deltas, the simulated paths give £1.944m, almost exactly delta-normal's £1.944m: on linear positions Monte Carlo just reproduces the formula, with noise. Revalued in full they give £1.848m: the puts' gamma cushions the big falls. And Monte Carlo sits well below historical simulation's £2.274m because the model has calm volatilities and normal tails. Feed it the stressed spell's covariance and it gives £4.160m. More paths will never fix the model.

How accurate is it?

Another seed gives another answer. The standard error of a simulated 99% quantile from NN paths is about α(1−α)/N / f(q)\sqrt{\alpha(1-\alpha)/N}\,/\,f(q), with ff the density of the P&L at the quantile. With the run's own standard deviation (£842,436) and a normal density, the 10,000-path VaR has a standard error of £31.5k: a 95% interval from £1.787m to £1.910m. A seed study confirms the formula:

Paths per runRunsMean VaRSpread across runs (sd)FormulaLowest – highest
1,000160£1.885m£98.8k£99.5k£1.59m – £2.14m
4,00040£1.877m£50.9k£49.7k£1.72m – £1.96m
16,00010£1.877m£25.3k£24.9k£1.83m – £1.92m

Four times the paths halve the error. The module's run (£1.848m) sits about one standard error below the seed study's average, which is exactly the kind of difference a seed makes. To get the standard error down to 1% of the VaR would take about 28,953 paths.

Run time

The module's run is 10,000 paths × 8 positions = 80,000 revaluations; the Try it below times it in your browser. A real trading book has thousands of positions, some priced by models that are slow themselves, so banks run fewer paths, approximate the slow pricers (delta-gamma or pre-computed grids), share paths across desks and use variance reduction. M6.2: Market risk modelling covers those techniques.

Monte Carlo or historical?

Historical simulation needs no model of the factors but only has the past it has. Monte Carlo can draw millions of days, fill in moves that never happened together and switch calibrations, but every number inherits the model's assumptions. Many banks run historical simulation for the headline VaR and use Monte Carlo where history is thin, or for credit and counterparty exposures (M6.6: Counterparty risk and XVA).

The formal version

Covariance of the draws. With z∼N(0,I)z \sim N(0, I), so E[zz⊤]=I\mathbb{E}[zz^\top] = I, and x=Lzx = Lz:

cov⁡(x)=E[xx⊤]=E[Lzz⊤L⊤]=L E[zz⊤] L⊤=LIL⊤=LL⊤=Σ\begin{aligned} \operatorname{cov}(x) &= \mathbb{E}[xx^\top] = \mathbb{E}[L z z^\top L^\top] \\ &= L\,\mathbb{E}[zz^\top]\,L^\top = L I L^\top \\ &= LL^\top = \Sigma \end{aligned}

Finding L. Write out LL⊤=ΣLL^\top = \Sigma for a 3 × 3 matrix and solve entry by entry, top-left first:

l11=σ11,l21=σ21/l11,l31=σ31/l11,l22=σ22−l212,l32=(σ32−l31l21)/l22,l33=σ33−l312−l322\begin{aligned} l_{11} &= \sqrt{\sigma_{11}}, & l_{21} &= \sigma_{21}/l_{11}, \\ l_{31} &= \sigma_{31}/l_{11}, & l_{22} &= \sqrt{\sigma_{22} - l_{21}^2}, \\ l_{32} &= (\sigma_{32} - l_{31}l_{21})/l_{22}, \\ l_{33} &= \sqrt{\sigma_{33} - l_{31}^2 - l_{32}^2} \end{aligned}

For the example: l11=0.0001=0.01l_{11} = \sqrt{0.0001} = 0.01, l21=0.000066/0.01=0.0066l_{21} = 0.000066 / 0.01 = 0.0066, l22=0.000121−0.00662=0.0088l_{22} = \sqrt{0.000121 - 0.0066^2} = 0.0088, l31=−0.006/0.01=−0.60l_{31} = -0.006 / 0.01 = -0.60, l32=(−0.00484−(−0.60)(0.0066))/0.0088=−0.10l_{32} = (-0.00484 - (-0.60)(0.0066))/0.0088 = -0.10 and l33=0.64−0.36−0.01=0.5196l_{33} = \sqrt{0.64 - 0.36 - 0.01} = 0.5196. Each square root must have a positive argument, which is exactly the condition that Σ is positive definite.

Standard error of the quantile. Let qq be the true 1% quantile of the P&L. The number of paths below it is binomial (M-C04: The binomial distribution) with mean N(1−α)N(1-\alpha) and standard deviation Nα(1−α)\sqrt{N\alpha(1-\alpha)}, so the share below it varies by α(1−α)/N\sqrt{\alpha(1-\alpha)/N}. Near qq, a change Δq\Delta q in the cut-off moves that share by about f(q) Δqf(q)\,\Delta q. Equating the two:

se⁡(q^)≈α(1−α)/Nf(q)f(q)=φ(zα)σ (normal)se⁡=0.99×0.01/10,000×842,4360.02665=£31,450\begin{aligned} \operatorname{se}(\hat q) &\approx \frac{\sqrt{\alpha(1-\alpha)/N}}{f(q)} \\ f(q) &= \frac{\varphi(z_\alpha)}{\sigma}\ \text{(normal)} \\ \operatorname{se} &= \frac{\sqrt{0.99 \times 0.01 / 10{,}000}\times 842{,}436}{0.02665} \\ &= \text{£}31{,}450 \end{aligned}

The error shrinks only with N\sqrt N, and it grows as α moves into the tail, where f(q)f(q) is small.

Try it

Run 1,000 paths a few times and watch the dots spread. Switch to 20,000 and run again: the strip tightens by about √20 ≈ 4.5. Then switch to the stressed covariance. The paths run in chunks between frames, so the page stays responsive.

Try itRun the desk's Monte Carlo VaR

Paths per run

Covariance

0 / 5,000 paths

Press Run to simulate 5,000 days for the desk.

Worked example

The first path of the module's run

One simulated day, by hand

Step 1 of 4
  1. 1

    Draw eight independent normals

    z=(1.6605−0.37890.1462−0.95630.60620.3901−0.88580.9518)z = \begin{pmatrix} 1.6605 \\ -0.3789 \\ 0.1462 \\ -0.9563 \\ 0.6062 \\ 0.3901 \\ -0.8858 \\ 0.9518 \end{pmatrix}

Regulatory lens · looking ahead

Basel's internal models rules have never prescribed one method: historical simulation, Monte Carlo and parametric models are all allowed if the model meets the qualitative and quantitative standards and passes validation and backtesting. FRTB keeps that freedom for expected shortfall (M4.3: Market risk capital (FRTB) and CVA). A bank using simulation should document its number of paths and its seeds, and be able to show that the simulation error is small. Variance reduction and fat-tailed simulation models are in M6.2: Market risk modelling.

Spark Atoms

Spark AtomNamed after a casino
Nicholas Metropolis and Stanisław Ulam published “The Monte Carlo Method” in 1949, after using random sampling for neutron calculations at Los Alamos. The name is a nod to the casino in Monaco: the method gambles its way to an answer.
Spark AtomAn artillery officer's square root
André-Louis Cholesky, a French army officer and surveyor, devised his factorisation to solve the least-squares problems of map making. He was killed in the First World War in 1918; a fellow officer published the method in 1924.

Key takeaways

  • Monte Carlo VaR draws many days from a model of the factors, revalues the book in full on each, and reads off the quantile.
  • A Cholesky factor (LL′ = Σ) turns independent normals into correlated moves: x = Lz.
  • Log-return factors give lognormal prices S₀eˣ: never negative, skewed up.
  • On the desk: £1.85m from 10,000 paths, below delta-normal (the puts' gamma) and below historical simulation (calm normal model).
  • The standard error of the quantile is about √(α(1−α)/N) / f(q): four times the paths halve it.
  • More paths reduce noise, never model error.

Reaction

Check what stuck

Question 1 · objective 1

Σ = [[4, 2], [2, 5]]. Its Cholesky factor is L = [[2, 0], [l₂₁, l₂₂]]. What is l₂₂?

Question 2 · objective 3

A Monte Carlo VaR from 10,000 paths has a standard error of £30,000. Roughly what standard error would 2,500 paths give, in pounds?

£

Question 3 · objective 3

With 5,000 paths the standard error is £40,000. How many paths would bring it to £10,000?

paths

Question 4 · objective 2

The desk's Monte Carlo VaR (£1.85m) is below its delta-normal VaR (£1.94m), with the same covariance matrix. Why?

Question 5 · objective 4

Historical simulation gives £2.27m on the same book. What would bring the Monte Carlo figure closer?

Glossary

Monte Carlo VaR
VaR read off the P&Ls of many simulated days, each drawn from a statistical model of the risk factors and revalued in full.
Path
One simulated day: a draw of all the factor moves, and the book's P&L for it.
Cholesky factor
A lower-triangular matrix L with L L′ = Σ. Multiplying independent standard normals by L gives draws with covariance Σ.
Seed
The starting value of a pseudo-random number generator. The same seed gives the same draws, so a run can be repeated exactly.
Standard error
The standard deviation of an estimate across repeated runs: how much the answer would change with a different seed.
Lognormal price
A price whose log return is normal: S = S₀eˣ. It cannot go negative and is skewed to the right.
Variance reduction
Ways to get the same accuracy with fewer paths: antithetic draws, control variates, importance sampling, quasi-random numbers.

Deep Dives & Origins

Deep Dives

  • P. Glasserman, Monte Carlo Methods in Financial Engineering, Springer, 2003, the chapter on applications in risk management. Advanced.
  • P. Jorion, Value at Risk: The New Benchmark for Managing Financial Risk, 3rd ed., McGraw-Hill, 2007, the chapter on Monte Carlo methods. Intermediate.

Origins

  • N. Metropolis and S. Ulam, “The Monte Carlo Method”, Journal of the American Statistical Association 44(247), 1949.
  • Commandant Benoît, “Note sur une méthode de résolution des équations normales… (Procédé du Commandant Cholesky)”, Bulletin Géodésique 2, 1924.
  • K. Dowd, Measuring Market Risk, 2nd ed., Wiley, 2005, on the precision of quantile estimators.

Watch this lesson

Video version

Prefer to watch? The same lesson as a 12-minute video will sit here, made from this page's script.