Understanding the value at risk (VaR) calculator — concept and principle
Value at risk (VaR) summarises the downside risk of a portfolio in one number: the loss that should be exceeded only with a small probability over a set period. This calculator uses the parametric (variance–covariance) method and also gives the expected shortfall, the average loss on the worst days.
How it is calculated
- Holding-period volatility: σh = σyear × √(days ÷ trading days per year).
- VaR = value × (z × σh − μh), where z is the standard normal quantile (1.645 at 95%, 2.326 at 99%) and μh the expected return over the period.
- Expected shortfall = value × (σh × φ(z) ÷ (1 − c) − μh), with φ the normal density and c the confidence level.
- Average holding periods between breaches = 1 ÷ (1 − c).
The principle
If returns are normally distributed, a known share of outcomes lies beyond any number of standard deviations from the mean. At 95% confidence, only 5% of outcomes are worse than 1.645 standard deviations below the mean. Volatility grows with the square root of time when returns are independent, so a one-day volatility is the annual figure divided by √252. Expected shortfall looks inside the tail and averages the losses beyond VaR, which makes it more informative about extreme events.
Worked example
Default inputs: portfolio 100,000 USD, annual volatility 18%, expected return 0%, 95% confidence, 1 day, 252 trading days.
- σh = 18% ÷ √252 ≈ 1.13%.
- z = 1.645; VaR = 100,000 × 1.645 × 0.011339 ≈ 1,865 USD (1.87% of the portfolio).
- Value after a VaR-sized loss = 98,135 USD.
- Expected shortfall = 100,000 × 0.011339 × 0.1031 ÷ 0.05 ≈ 2,339 USD.
- Breaches expected about once every 20 days.
| Portfolio value | Value at risk (VaR) |
|---|---|
| 25,000 | $466 |
| 50,000 | $933 |
| 75,000 | $1,399 |
| 100,000 | $1,865 |
| 125,000 | $2,331 |
| 150,000 | $2,798 |
| 200,000 | $3,730 |
How to read the result
A 1-day 95% VaR of 1,865 USD means losses larger than that are expected on about 1 day in 20. It is not a maximum loss: on those bad days the average loss is about 2,339 USD, and occasional losses can be much larger. Real returns have fatter tails than the normal curve, so extreme losses happen more often than this model suggests.
Common mistakes
- Treating VaR as the worst possible loss.
- Using the square-root-of-time rule over long periods when returns are not independent.
- Ignoring correlations that rise in a crisis.
- Mixing annual and daily volatility.
Frequently asked questions
What does 95% VaR mean?
There is a 5% chance of losing more than the VaR amount over the holding period.
What is expected shortfall?
The average loss on the days when the loss exceeds VaR; it is also called conditional VaR.
Why use the square root of time?
If daily returns are independent, variance adds up over days, so volatility grows with the square root of the number of days.
Sources: J.P. Morgan/Reuters (1996). RiskMetrics Technical Document, 4th edition · Hull, J. C., Risk Management and Financial Institutions (VaR and expected shortfall)