|
| 1 | +# Quantifying VIX Tail Risk |
| 2 | + |
| 3 | +[](https://www.python.org/downloads/) |
| 4 | +[](LICENSE) |
| 5 | +[](https://github.com/CttQuantLab) |
| 6 | + |
| 7 | +Research codebase comparing GARCH-family volatility models and Compound Poisson Process (CPP) jump models for VIX tail-risk quantification. |
| 8 | +The pipeline fits EGARCH/GARCH on daily VIX log changes, identifies shock events, models arrival rates and jump magnitudes, and evaluates VaR/CVaR with regime and out-of-sample checks. |
| 9 | + |
| 10 | +Developed for **IEDA4000E - Statistical Modelling for Financial Engineering** at the Hong Kong University of Science and Technology (HKUST). |
| 11 | +Maintained under [CttQuantLab](https://github.com/CttQuantLab). |
| 12 | + |
| 13 | +> **Not financial advice.** This repository is for research and education only. |
| 14 | +> Historical results do not imply future performance. |
| 15 | +
|
| 16 | +## Highlights |
| 17 | + |
| 18 | +- GARCH(1,1) and EGARCH(1,1) with automatic GED/t/normal selection via PIT diagnostics |
| 19 | +- Shock identification by quantile and volatility-relative thresholds |
| 20 | +- Homogeneous and Hawkes arrival models plus Compound Poisson jump-risk estimation |
| 21 | +- Regime analysis across pre-COVID, COVID, post-COVID, and recent windows |
| 22 | +- Out-of-sample CPP forecast evaluation (2022-2025 holdout) |
| 23 | +- Reproducible pipeline (`runall.py`), notebooks, tests, report, and slides |
| 24 | + |
| 25 | +### Headline results |
| 26 | + |
| 27 | +| Model / metric | Value | Notes | |
| 28 | +|----------------|-------|-------| |
| 29 | +| Best volatility fit | EGARCH(1,1), GED | AIC 27,395 vs GARCH 27,531 | |
| 30 | +| Volatility half-life | 10.2 days | EGARCH persistence 0.934 | |
| 31 | +| CPP arrival rate | 12.64 / year | Full-sample Poisson rate | |
| 32 | +| CPP VaR (95%) | 4.24 | Annual cumulative shock impact | |
| 33 | +| CPP CVaR (95%) | 5.01 | Expected shortfall | |
| 34 | +| OOS forecast error | -17.8% | 2022-2025; VaR not exceeded | |
| 35 | + |
| 36 | +Full tables and discussion: [`docs/SUMMARY.md`](docs/SUMMARY.md), [`docs/report/report.pdf`](docs/report/report.pdf). |
| 37 | + |
| 38 | +## Repository layout |
| 39 | + |
| 40 | +```text |
| 41 | +. |
| 42 | +├── docs/ |
| 43 | +│ ├── SUMMARY.md # Results digest |
| 44 | +│ ├── report/ # Academic report (LaTeX + PDF) |
| 45 | +│ └── slides/ # Beamer presentation (LaTeX + PDF) |
| 46 | +├── figures/ # Published plots by category |
| 47 | +├── notebooks/ # Step-by-step analysis notebooks |
| 48 | +├── src/ # Core library modules |
| 49 | +├── tests/ # Pytest suite |
| 50 | +├── runall.py # End-to-end pipeline driver |
| 51 | +├── requirements.txt |
| 52 | +├── pyproject.toml |
| 53 | +└── LICENSE |
| 54 | +``` |
| 55 | + |
| 56 | +## Quick start |
| 57 | + |
| 58 | +```bash |
| 59 | +git clone https://github.com/CttQuantLab/Quantifying-VIX-Tail-Risk.git |
| 60 | +cd Quantifying-VIX-Tail-Risk |
| 61 | + |
| 62 | +python -m venv .venv |
| 63 | +source .venv/bin/activate # Windows: .venv\Scripts\activate |
| 64 | + |
| 65 | +pip install -U pip |
| 66 | +pip install -r requirements.txt |
| 67 | +pip install -e . |
| 68 | + |
| 69 | +pytest -q |
| 70 | +``` |
| 71 | + |
| 72 | +## Run the pipeline |
| 73 | + |
| 74 | +Download VIX data (Yahoo Finance), fit models, and regenerate figures: |
| 75 | + |
| 76 | +```bash |
| 77 | +python runall.py |
| 78 | +``` |
| 79 | + |
| 80 | +Optional flags: |
| 81 | + |
| 82 | +```bash |
| 83 | +python runall.py --force-download # refresh cached VIX history |
| 84 | +python runall.py --skip-plots # models only, no figure export |
| 85 | +``` |
| 86 | + |
| 87 | +Outputs land under `figures/` (grouped by topic) and cached data under `data/raw/`. |
| 88 | + |
| 89 | +## Data |
| 90 | + |
| 91 | +- **Source:** Yahoo Finance `^VIX` daily closes |
| 92 | +- **Window:** 2010-01-05 to latest available (4,100+ business days in the published run) |
| 93 | +- **Preprocessing:** business-day alignment, forward-fill, 0.1% winsorization, log-level and log-change features |
| 94 | +- **Train/test split:** 75% train (2010-2021), 25% test (2022-2025) for forecast evaluation |
| 95 | + |
| 96 | +## Method sketch |
| 97 | + |
| 98 | +**Volatility.** GARCH and EGARCH on daily log VIX changes; distribution chosen by PIT Kolmogorov-Smirnov fit. |
| 99 | + |
| 100 | +**Shocks.** Threshold exceedances on standardized returns; inter-arrival times fit to Poisson and Hawkes processes. |
| 101 | + |
| 102 | +**Jump risk.** Compound Poisson accumulation \(S(T)=\sum_{i=1}^{N(T)} J_i\) with Pareto jump sizes; Monte Carlo paths for VaR/CVaR. |
| 103 | + |
| 104 | +See the report for full equations, parameter tables, and diagnostic figures. |
| 105 | + |
| 106 | +## Documentation |
| 107 | + |
| 108 | +| Document | Description | |
| 109 | +|----------|-------------| |
| 110 | +| [`docs/SUMMARY.md`](docs/SUMMARY.md) | Condensed results and regime tables | |
| 111 | +| [`docs/report/report.pdf`](docs/report/report.pdf) | Full academic write-up | |
| 112 | +| [`docs/slides/slides.pdf`](docs/slides/slides.pdf) | Presentation deck | |
| 113 | +| [`figures/`](figures/) | Standalone result figures | |
| 114 | + |
| 115 | +## Development |
| 116 | + |
| 117 | +```bash |
| 118 | +pytest -q |
| 119 | +pip install -e ".[dev]" |
| 120 | +``` |
| 121 | + |
| 122 | +Random seeds default to `42` in `src/config.py`. |
| 123 | + |
| 124 | +## Citation |
| 125 | + |
| 126 | +If this repository is useful for your work, please cite the course project report and link this repository: |
| 127 | + |
| 128 | +```bibtex |
| 129 | +@misc{chong2025vixtailrisk, |
| 130 | + author = {Chandrean, Vittorio Prana and Chong, Tin Tak and Choi, Man Hou}, |
| 131 | + title = {Quantifying VIX Tail Risk: Volatility Clustering and Jump Processes}, |
| 132 | + year = {2025}, |
| 133 | + howpublished = {\url{https://github.com/CttQuantLab/Quantifying-VIX-Tail-Risk}}, |
| 134 | + note = {IEDA4000E course project, HKUST} |
| 135 | +} |
| 136 | +``` |
| 137 | + |
| 138 | +See also [`CITATION.cff`](CITATION.cff) for machine-readable metadata. |
| 139 | + |
| 140 | +## References |
| 141 | + |
| 142 | +1. Bollerslev, T. (1986). Generalized Autoregressive Conditional Heteroskedasticity. *Journal of Econometrics*. |
| 143 | +2. Nelson, D. B. (1991). Conditional Heteroskedasticity in Asset Returns. *Econometrica*. |
| 144 | +3. Cont, R., and Tankov, P. (2004). *Financial Modelling with Jump Processes*. Chapman and Hall/CRC. |
| 145 | +4. McNeil, A. J., Frey, R., and Embrechts, P. (2015). *Quantitative Risk Management*. Princeton University Press. |
| 146 | + |
| 147 | +## License |
| 148 | + |
| 149 | +MIT License. See [LICENSE](LICENSE). |
| 150 | + |
| 151 | +## Acknowledgments |
| 152 | + |
| 153 | +- Course: IEDA4000E - Statistical Modelling for Financial Engineering, HKUST |
| 154 | +- Authors: Vittorio Prana CHANDREAN, CHONG Tin Tak, CHOI Man Hou |
| 155 | +- Core stack: arch, statsmodels, pandas, scipy, matplotlib, yfinance |
0 commit comments