01 — Risk Measures

Value at Risk (VaR)#

Quantile Loss✓ Mathematical1 min read
◆ The PatternMaximum expected loss at a chosen confidence level over a given horizon

VaR answers one question: "What is the worst loss I should expect on a normal day?" Three methods dominate — parametric (variance-covariance), historical simulation, and Monte Carlo. Parametric VaR assumes normally distributed returns:

VaRα = μ − zα · σ
zα is the inverse-normal quantile (e.g. 1.645 for 95 %). Historical simulation makes no distributional assumption — it ranks past P&L and reads the quantile directly.
// Interactive — confidence level vs. VaR threshold
Confidence %
MethodAssumptionStrength
ParametricNormal returnsFastest to compute
HistoricalNone (empirical)Captures fat tails
Monte CarloModel-dependentFlexible payoff profiles
Limitation. VaR says nothing about the magnitude of losses beyond the threshold — Expected Shortfall fills that gap.
Pattern bridge: Confidence intervals and quantiles are foundational in The Toolkit — Confidence Intervals.
Experiment — your portfolio's VaR
Adjust sliders to calculate your portfolio's Value at Risk.
Performance in practice
  • Basel III requires banks to report 99% 10-day VaR daily. Capital reserves must cover 3× this number — a $10M VaR means $30M in regulatory capital
  • Parametric VaR underestimated tail risk in 2008 by ~50% because returns were far from normal. Historical VaR caught the fat tails but missed unprecedented correlations
  • JPMorgan's RiskMetrics (1994) popularized VaR. Their original assumption of i.i.d. normal returns is still the baseline, despite known limitations
  • Modern practice: run all three methods and report the worst case. If they disagree significantly, your risk model has a blind spot
When to use this
Use when: Setting position sizes. Regulatory reporting (Basel III). Communicating risk to non-technical stakeholders. Comparing risk across different portfolios or strategies.
Skip when: You need to understand tail risk severity (use Expected Shortfall). Illiquid positions where you can't exit at market price. Options/derivatives with non-linear payoffs (use Monte Carlo or stress tests instead).
Quick start — copy to notebook
pip install numpy pandas yfinance scipy
# ────────────────────────────────────────
import numpy as np, pandas as pd, yfinance as yf
from scipy.stats import norm

prices = yf.download('SPY', period='2y')['Close']
returns = prices.pct_change().dropna()

# Parametric VaR (95%, 1-day)
mu, sigma = returns.mean(), returns.std()
var_95 = -(mu + norm.ppf(0.05) * sigma)
print(f"Parametric VaR (95%): {var_95:.2%}")

# Historical VaR
var_hist = -np.percentile(returns, 5)
print(f"Historical VaR (95%): {var_hist:.2%}")

# Dollar VaR for $100K portfolio
portfolio = 100_000
print(f"1-day dollar VaR: ${portfolio * var_95:,.0f}")
Open in the full reader, with the topic sidebar →