Reproducible research package for Value at Risk, Conditional Value at Risk, and tail-risk analysis.
Project description
Value at Risk versus Conditional Value at Risk
A Rigorous Framework for Measuring Extreme Tail Risk and Regulatory Compliance
Alpha Stochastic Research
Independent Quantitative Finance Research Laboratory
Overview
This repository is the reproducible research package for the working paper:
Value at Risk versus Conditional Value at Risk: A Rigorous Framework for Measuring Extreme Tail Risk and Regulatory Compliance
It studies VaR, CVaR, and Expected Shortfall through mathematical analysis, Monte Carlo simulation, robustness checks, backtesting, and regulatory interpretation.
What is included
- empirical and closed-form VaR/CVaR implementations;
- the two-defaultable-bond counterexample to VaR subadditivity;
- Gaussian and standardized Student-t loss models;
- convergence and tail-thickness sensitivity studies;
- VaR exception and Kupiec backtesting utilities;
- a reproducible Jupyter notebook;
- generated CSV result tables and publication-ready figures;
- a LaTeX working paper;
- automated tests and GitHub Actions CI;
- citation, authorship, license, and reproducibility metadata.
Repository structure
asr-var-cvar-tail-risk/
├── .github/workflows/python-ci.yml
├── docs/METHODOLOGY.md
├── figures/
├── notebooks/var_cvar_reproduction.ipynb
├── paper/
│ ├── main.tex
│ ├── references.bib
│ └── README.md
├── results/
├── scripts/run_analysis.py
├── src/asr_tail_risk/
│ ├── __init__.py
│ ├── backtesting.py
│ ├── models.py
│ ├── plotting.py
│ ├── risk_measures.py
│ └── simulation.py
├── tests/
├── AUTHORS.md
├── CHANGELOG.md
├── CITATION.cff
├── LICENSE
├── Makefile
├── README.md
├── REPRODUCIBILITY.md
├── pyproject.toml
└── requirements.txt
Installation
git clone https://github.com/Alpha-Stochastic-Research/asr-var-cvar-tail-risk.git
cd asr-var-cvar-tail-risk
python -m venv .venv
source .venv/bin/activate # macOS/Linux
# .venv\Scripts\activate # Windows
python -m pip install --upgrade pip
pip install -e ".[dev]"
Reproduce everything
python scripts/run_analysis.py
pytest -q
Or:
make reproduce
The analysis writes tables to results/ and figures to figures/.
Baseline experiment
| Parameter | Value |
|---|---|
| Portfolio notional | USD 10,000,000 |
| Daily volatility | 1.2% |
| Student-t degrees of freedom | 4 |
| Monte Carlo paths | 200,000 |
| Seed | 42 |
| Confidence levels | 95%, 97.5%, 99% |
The Student-t model is rescaled so that its unconditional volatility matches the Gaussian benchmark.
Package usage
from asr.risk.tail import (
empirical_var,
empirical_cvar,
gaussian_var,
gaussian_cvar,
simulate_student_t_losses,
)
losses = simulate_student_t_losses(
n_paths=200_000,
notional=10_000_000,
volatility=0.012,
degrees_of_freedom=4,
seed=42,
)
var_99 = empirical_var(losses, 0.99)
cvar_99 = empirical_cvar(losses, 0.99)
Python Import Namespace
The package is distributed under the project name:
asr-var-cvar-tail-risk
The recommended Python import namespace is:
from asr.risk.tail import TailRiskConfig
The legacy namespace remains available for backward compatibility:
from asr_tail_risk import TailRiskConfig
New applications, notebooks, and research scripts should use asr.risk.tail.
Working paper
Compile from the repository root:
cd paper
pdflatex main.tex
bibtex main
pdflatex main.tex
pdflatex main.tex
Citation
Citation metadata are provided in CITATION.cff.
License
MIT License. See LICENSE.
Contact
Alpha Stochastic Research
https://asr-lab.online
research@asr-lab.online
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file asr_var_cvar_tail_risk-1.0.0.tar.gz.
File metadata
- Download URL: asr_var_cvar_tail_risk-1.0.0.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c03ee2cbfbf28c8a17d367713d02035c4c79087b122a95df812652c60c0f478
|
|
| MD5 |
a2b75eccba03a587a466c1bf91d4be5f
|
|
| BLAKE2b-256 |
f303addc7d91d75010cf71be3a8d923b20ede2f8fbb82e50d036e811232ead24
|
Provenance
The following attestation bundles were made for asr_var_cvar_tail_risk-1.0.0.tar.gz:
Publisher:
publish-pypi.yml on Alpha-Stochastic-Research/asr-var-cvar-tail-risk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
asr_var_cvar_tail_risk-1.0.0.tar.gz -
Subject digest:
0c03ee2cbfbf28c8a17d367713d02035c4c79087b122a95df812652c60c0f478 - Sigstore transparency entry: 2140016491
- Sigstore integration time:
-
Permalink:
Alpha-Stochastic-Research/asr-var-cvar-tail-risk@e16481f559ce8a4df94f7c386d38a5f2b6ccc28d -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/Alpha-Stochastic-Research
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@e16481f559ce8a4df94f7c386d38a5f2b6ccc28d -
Trigger Event:
release
-
Statement type:
File details
Details for the file asr_var_cvar_tail_risk-1.0.0-py3-none-any.whl.
File metadata
- Download URL: asr_var_cvar_tail_risk-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2137b04ec79e878655cb7fd301689d3994ae8c99c4900fc57c1cd0db0e9c1d99
|
|
| MD5 |
c0d61fc040a7bfce38e498b5a8d672ca
|
|
| BLAKE2b-256 |
45a6d40946c06fbfe3eb1c9371d1be675b3a475964c5a78e4bb9e9bf92e3af79
|
Provenance
The following attestation bundles were made for asr_var_cvar_tail_risk-1.0.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on Alpha-Stochastic-Research/asr-var-cvar-tail-risk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
asr_var_cvar_tail_risk-1.0.0-py3-none-any.whl -
Subject digest:
2137b04ec79e878655cb7fd301689d3994ae8c99c4900fc57c1cd0db0e9c1d99 - Sigstore transparency entry: 2140016515
- Sigstore integration time:
-
Permalink:
Alpha-Stochastic-Research/asr-var-cvar-tail-risk@e16481f559ce8a4df94f7c386d38a5f2b6ccc28d -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/Alpha-Stochastic-Research
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@e16481f559ce8a4df94f7c386d38a5f2b6ccc28d -
Trigger Event:
release
-
Statement type: