This repository presents three methods, mathematically detailed and implemented in Python, for estimating Value at Risk (VaR), a key metric in financial risk management.
VaR/
β
βββ 1.VaR.Montecarlo.ipynb # Monte Carlo Simulation approach
βββ 2.VaR.Parametric.ipynb # Parametric (Variance-Covariance) approach
βββ 3.VaR.Historical.ipynb # Historical Simulation approach
Value at Risk (VaR) measures the maximum expected loss of a portfolio over a given time horizon at a specified confidence level. Formally, for confidence level
where
In practice, if VaR(95%) = $10,000, there is a 95% chance that losses will not exceed $10,000 and a 5% chance they will.
| Method | Assumptions | Formula & Key Points |
|---|---|---|
| Monte Carlo Simulation | - In this implementation: returns are simulated from a normal distribution. - In general: any return distribution can be modeled. - Model parameters (mean - Sufficient number of simulations to approximate distribution. |
Simulate Deterministic part: Stochastic part: |
| Parametric (Variance-Covariance) | - Portfolio returns are normally distributed. - Constant mean and variance over time. - Portfolio is linear (no significant derivatives). |
Analytical solution using Time adjustment via |
| Historical Simulation | - Historical returns are representative of future risks. - No specific distributional assumptions. - Past extreme events must be reflected in historical data. |
Empirical quantile approach. VaR based on historical percentiles. |
This project was inspired by the tutorials of Ryan O'Connell, CFA, FRM. You can check out his videos here: