Skip to content

Commit c3886f3

Browse files
committed
Publish org-ready clean-main with docs layout and packaging.
Reorganize LaTeX report and slides under docs/, add pyproject.toml, CITATION.cff, CI workflow, and a professional README for CttQuantLab.
0 parents  commit c3886f3

49 files changed

Lines changed: 6748 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, clean-main]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
python-version: ["3.11"]
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
cache: pip
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install -U pip
27+
pip install -r requirements.txt
28+
pip install -e ".[dev]"
29+
30+
- name: Run tests
31+
run: pytest -q

.gitignore

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*.pyo
5+
*.pyd
6+
*.so
7+
*.egg-info/
8+
dist/
9+
build/
10+
11+
# Environments
12+
.venv/
13+
venv/
14+
.env
15+
.env.*
16+
17+
# Notebooks
18+
.ipynb_checkpoints/
19+
*.nbconvert.ipynb
20+
21+
# Data caches
22+
/data/raw/
23+
*.parquet
24+
*.csv
25+
*.feather
26+
27+
# Logs
28+
*.log
29+
30+
# LaTeX build artifacts
31+
*.aux
32+
*.nav
33+
*.out
34+
*.snm
35+
*.toc
36+
*.vrb
37+
*.fls
38+
*.fdb_latexmk
39+
*.synctex.gz
40+
*.bbl
41+
*.blg
42+
43+
# IDE / OS
44+
.DS_Store
45+
.cursor/
46+
.pytest_cache/

CITATION.cff

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
cff-version: 1.2.0
2+
message: If you use this software, please cite it as below.
3+
title: "Quantifying VIX Tail Risk: Volatility Clustering and Jump Processes"
4+
authors:
5+
- family-names: Chandrean
6+
given-names: Vittorio Prana
7+
- family-names: Chong
8+
given-names: Tin Tak
9+
- family-names: Choi
10+
given-names: Man Hou
11+
version: 1.0.0
12+
date-released: "2025-12-17"
13+
license: MIT
14+
repository-code: https://github.com/CttQuantLab/Quantifying-VIX-Tail-Risk
15+
url: https://github.com/CttQuantLab/Quantifying-VIX-Tail-Risk
16+
abstract: >-
17+
Comparative study of GARCH-family volatility models and Compound Poisson
18+
jump processes for VIX tail-risk quantification, including regime analysis
19+
and out-of-sample VaR/CVaR evaluation.
20+
keywords:
21+
- VIX
22+
- GARCH
23+
- compound Poisson
24+
- tail risk
25+
- quantitative finance
26+
- volatility clustering

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Tin Tak (Douglas) CHONG
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
# Quantifying VIX Tail Risk
2+
3+
[![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
4+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
5+
[![Org](https://img.shields.io/badge/org-CttQuantLab-0B3D91.svg)](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

Comments
 (0)