A replication of key results from "Tail-GAN: Simulate Tail-Risk Scenarios"
Open in Colab
Table of Contents
Tail-GAN is a GAN architecture with the goal of training a generator to produce realistic stock return scenarios by implementing tail-sensitive loss functions. This is achieved by projecting the stock scenarios to 1D PnL distributions from predictable strategies which in turn are evaluated based on their risk metrics (VaR and ES). While common loss functions (KL-Divergence, Wasserstein Distance) tend to oversample the center of the distribution, the proposed loss function is tail-sensitive.
We reproduce the results for the synthetic data, which consists of
- IID normal distribution
- AR with
$\psi_1 = 0.5$ - AR with
$\psi_2 = -0.5$ - GARCH(1,1) with student-t (
$\nu_1 = 5$ ) distribution - GARCH(1,1) with student-t (
$\nu_2 = 10$ ) distribution
all of them are correlated by an underlying Gaussian innovation vector
There are four important architectural features:
- A set of trading strategies which project the generated stock scenarios to PnL distributions. The discriminator takes these PnL distributions as input.
- The discriminator will output two values which will be interepreted as
$\alpha$ -VaR and$\alpha$ -ES and handed as arguments to the score function. - The "Neural Sorting": This refers to a soft-sort algorithm by Grover et al (2019) which can be backpropagated through. Because
$\alpha$ -VaR of a distribution can be approximated by the$\lfloor \alpha n \rfloor^{\text{th}}$ smallest value in a sample of size$n$ , sorting the PnL samples will potentially improve performance. - The score function evaluates how close the discriminator is to the correct
$\alpha$ -VaR and$\alpha$ -ES of the sampled distribution.
What is a "Score function"?
Consider a functional
In other words,
VaR is elicitable but ES is not. But as it turns out the two are jointly elictable, i.e. we can find a score function
VaR and ES lend themselves to an interpretable measure of tail-realism. During training we can simply evaluate the difference between generated and real tail risk measures. After training we can further:
- Compare tail risk measures on out-of-sample data
- Compare the correlation matrix of the generated data with that of the real data
- Compare autocorrelation coefficients accross the time-series with the real data
- Compare the rank-distributions of the generated and real data
These methods allow for a rigorous measure of model performance.
This project was built with PyTorch
Simply install the required packages in your virtual environment and download and run the notebook. Note that training of the models without a GPU can be quite slow.
Not fixed yet.
This project is a replication of the research by Cont et al. ("Tail-GAN: Learning to Simulate Tail Risk Scenarios"): arXiv
While I have added some numerical experiments and adapted hyperparameters as I saw fit, all of the key ideas in this project are theirs.