This project implements a structured portfolio risk analysis workflow in Python.
It covers both static and conditional risk models for measuring portfolio Value-at-Risk (VaR) and Expected Shortfall (ES), together with backtesting, multi-day risk analysis, and stress testing.
- Normal VaR produces the lowest risk estimates and tends to be the least conservative.
- Student-t and Historical Simulation generate higher VaR and ES estimates, reflecting heavier tails and realized extreme losses.
- VaR violations cluster strongly during stress periods, especially around 2020.
- Multi-day VaR shows that square-root-of-time scaling is a useful benchmark, but it becomes less accurate at longer horizons.
- Stress testing shows that portfolio downside risk is driven mainly by equity shocks.
- Conditional methods such as GARCH-CCC and FHS-EWMA provide a more dynamic view of risk under changing volatility conditions.
The goal of this project is to analyze the downside risk of a diversified portfolio using multiple market risk methodologies and compare their outputs in a clean, reproducible workflow.
The portfolio consists of six components:
- Microsoft (MSFT)
- Shell (SHEL)
- JPMorgan Chase (JPM)
- S&P 500 index (^GSPC)
- EUR/USD exchange rate (EURUSD=X)
- Loan component (LOAN)
The portfolio uses the following fixed weights:
- MSFT: 20%
- SHEL: 15%
- JPM: 15%
- S&P 500: 20%
- EUR/USD: 10%
- LOAN: 20%
- Normal variance-covariance VaR and ES
- Student-t variance-covariance VaR and ES
- Historical simulation
- GARCH(1,1) with Constant Conditional Correlation (CCC)
- Filtered Historical Simulation with EWMA
- Student-t QQ-plot comparison for degree-of-freedom selection
- VaR backtesting
- Multi-day VaR (1-day, 5-day, 10-day)
- Stress testing under equity, FX, and rate shocks
- Final comparison across all methods
- Build portfolio return and loss series
- Estimate VaR and ES using static models
- Select Student-t specification using QQ-plots
- Backtest VaR models
- Compare historical multi-day VaR with square-root-of-time scaling
- Perform stress testing
- Estimate GARCH-CCC VaR and ES
- Estimate FHS-EWMA VaR and ES
- Compare all methods in final tables and figures
code/→ Python scriptsdata/→ raw input data and rebuilt working datasetfigures/→ generated plotsresults/→ generated result tables
- Student-t QQ-plots
- Backtesting plots
- Yearly VaR violations
- Multi-day VaR comparison
- Stress testing VaR changes
- Final VaR and ES comparison plots
- VaR and ES estimates across methods
- Backtesting tables
- Multi-day VaR tables
- Stress-testing outputs
- GARCH-CCC parameter and matrix outputs
- Final method comparison table
Install dependencies first:
pip install -r requirements.txt