Articles

How do you calculate Monte Carlo VaR for a portfolio?

Cholesky, simulate, revalue, sort: the four steps on a four-sleeve credit fund, how many scenarios the answer needs, and why the distribution matters more than the method.

Factor the correlation matrix with a Cholesky decomposition, use it to turn independent random draws into correlated sleeve returns, revalue the portfolio in each scenario, and read the loss at the confidence level. On an illustrative 840M credit fund, 100,000 normal scenarios give a one-day 99 per cent VaR of 7,200,794, within 0.58 per cent of the parametric 7,242,456. Swap the normal for fat-tailed draws with the same correlations and the VaR is 8,270,713: the method is the same, and the distribution decides the answer.

Worked in full in Financial Risk Management by Julian R. Sterling, with every figure reproduced in a free workbook.See the book on Amazon →

The assumptions

The fund is Halverton, the illustrative credit fund in Financial Risk Management: 840M of net assets in four sleeves. Annual volatilities are scaled to one day by the square root of 252. Positions are linear, so a sleeve's P&L is its market value times its return.

The four sleeves. The fund line is after correlation, so it is less than the sum of the sleeves
SleeveMarket valueAnnual volatilityDaily volatilityDaily sd in money
Investment-grade credit252,000,0004.5%0.2835%714,353
High yield294,000,0008.0%0.5040%1,481,621
Leveraged loans210,000,0006.0%0.3780%793,725
Structured credit84,000,00010.0%0.6299%529,150
Fund840,000,0000.3706%3,113,230

The reported correlations run from 0.45 between investment grade and structured credit to 0.80 between high yield and leveraged loans. On these inputs the closed-form parametric VaR is 7,242,456, the benchmark for this article; the method itself is worked on a simpler two-asset portfolio in how to calculate parametric VaR for a portfolio.

Step 1: the Cholesky factor

Independent random numbers have no correlation. To give them the fund's, factor the correlation matrix C as L × LT, with L lower triangular, and multiply each vector of independent draws by L.

Cholesky factor L of the reported correlation matrix
Sleevee1e2e3e4
Investment-grade1.00000.00000.00000.0000
High yield0.75000.66140.00000.0000
Leveraged loans0.55000.58580.59520.0000
Structured credit0.45000.54800.13680.6917

Read the second row: high yield's shock is 0.75 of the investment-grade shock plus 0.6614 of its own, and 0.752 + 0.66142 = 1, so its variance is right and its correlation with the first sleeve is 0.75. Each row squared sums to one. If the factorisation fails, the matrix is not a valid correlation matrix, which happens more often than it should with hand-edited stress correlations.

Step 2: one scenario, revalued

Correlated shocks x = L × e, with e four independent standard normals

Sleeve P&L = market value × daily volatility × xi

First draw: e = (0.8659, 0.8041, −1.9775, −0.1472) becomes x = (0.8659, 1.1813, −0.2297, 0.4580)

P&L = 618,538 + 1,750,232 − 182,337 + 242,364 = 2,428,798

Excel: =NORM.S.INV(RAND()) for each e, =MMULT(L, e) for x, then =SUMPRODUCT(MV*DailyVol, x)

Note the leveraged loan sleeve: its own draw was −1.9775, but the Cholesky mix pulls it towards the other two positive shocks, to −0.2297. That is correlation doing its work inside a single scenario.

Step 3: repeat, sort and read the tail

Run 100,000 scenarios, sort the losses from largest to smallest

The 99 per cent VaR is the loss at the 1 per cent tail: with 100,000 scenarios, the 1,000th largest loss

Monte Carlo VaR = 7,200,794, 0.857 per cent of net assets

Expected shortfall, the average of the 1,000 worst = 8,255,597

Excel: =-PERCENTILE.INC(PnL, 0.01)

The parametric answer is 7,242,456 and expected shortfall at 99 per cent is 8,297,424. The simulation lands 0.58 per cent below, with a simulated standard deviation within 0.35 per cent of the true 3,113,230. That is the first check on any Monte Carlo engine: on normal inputs and linear positions it must reproduce the closed form within its noise. If it does not, the bug is in the engine, not the market.

How many scenarios?

The VaR is read from a handful of tail scenarios, so it is noisy. Twenty independent runs at each size:

99% one-day VaR across twenty runs
ScenariosAverage VaRStandard deviationAs % of VaRLowestHighest
1,0007,355,152398,6725.5%6,812,1168,346,396
10,0007,266,53992,9641.3%7,108,5077,555,848
50,0007,239,87651,3630.7%7,146,5357,367,978

At 1,000 scenarios the 99 per cent VaR rests on ten tail observations, and two runs can differ by 1.5M. The noise falls with the square root of the number of scenarios, so halving it costs four times the computation. Fix the random seed so that a change in VaR from one day to the next reflects the portfolio, not the draw.

What if the tails are fat?

The real reason to simulate is that the scenarios can come from any distribution. Keep the same volatilities and correlations, but draw from a multivariate Student-t with 4 degrees of freedom, scaled to the same variance.

Same volatilities and correlations, two distributions, 100,000 scenarios
ConfidenceParametricMonte Carlo, normalMonte Carlo, Student-t
95.0%5,120,8075,116,3054,720,177
97.5%6,101,8186,062,8236,148,737
99.0%7,242,4567,200,7948,270,713
99% expected shortfall8,297,4248,255,59711,364,313

With identical volatility, the fat-tailed fund has a lower VaR at 95 per cent and, at 99, one 14.2 per cent above the parametric figure. Expected shortfall rises by 37 per cent. Fat tails move risk out of the middle and into the far tail, so the further out you look, the more the distribution matters. The 8,270,713 is close to the 8,244,223 that 500 days of history give in how to calculate historical VaR: that illustrative history was itself drawn with fat tails, which the normal does not have.

The common mistake

Treating Monte Carlo as more accurate by construction. A simulation with normal draws and fixed correlations is the parametric model with noise added: 100,000 scenarios on Halverton bought nothing the closed form did not already say. Monte Carlo earns its cost when the scenarios carry something the formula cannot: fat tails, options and other non-linear positions revalued in full, or correlations that rise in a sell-off. Report the distribution assumption beside the number.

Takeaway

The parametric construction, the correlation switch and the backtest counter for this fund are in the free workbooks for this book.

Questions readers ask

How many simulations do you need for Monte Carlo VaR?

Enough that the run-to-run noise is small against the decision. On the illustrative 840M fund, twenty runs of 1,000 scenarios give a 99 per cent VaR with a standard deviation of 398,672, 5.5 per cent of the answer; 10,000 scenarios cut it to 92,964 and 50,000 to 51,363, or 0.7 per cent. The error falls with the square root of the number of scenarios.

Is Monte Carlo VaR better than parametric VaR?

Only if it is given something parametric VaR cannot use: fat tails, non-linear positions such as options, or path dependence. With normal returns and linear positions, 100,000 scenarios on the illustrative fund give 7,200,794 against a parametric 7,242,456, the same number with noise. With Student-t tails the 99 per cent VaR rises to 8,270,713.

What is the Cholesky decomposition used for in Monte Carlo VaR?

It turns independent random draws into draws with the portfolio's correlations. The correlation matrix C is factored as L times L transposed, and each vector of independent normals e becomes L times e. For the illustrative fund the second sleeve's draw is 0.75 times the first shock plus 0.6614 times its own, which reproduces a 0.75 correlation.

Read the whole case

This article is one calculation from Financial Risk Management. The book takes the same case from first principles to the decision, chapter by chapter, and every figure it prints is a live formula in the free companion workbooks.

Get the book on Amazon →Free companion files

Also on Amazon UK · Amazon Germany · Amazon France · Amazon Canada

Also on this site

Reading guide: corporate finance, valuation and markets → · All 1340 articles →

If this book helped, or didn’t, a few lines on Amazon are worth more than they look: they are what the next reader goes on. Write a review. The workbook stays free either way.