SlideShare a Scribd company logo
1 of 28
Download to read offline
My recent attempts at using GANs for simulating
realistic stocks returns
Hong Kong Machine Learning Meetup - Season 2 Episode 4 [online]
Gautier Marti
HKML
8 April 2020
Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 1 / 28
Table of contents
1 Motivations
2 My attempts at building CorrGAN
Starting simple, always: The 3-dimensional case
From 3D to nD, many difficulties arise. . .
Exploring different architectures
Evaluation of CorrGAN
3 Next steps
Comparison of ML-based portfolio allocation methods
cCorrGAN for conditional sampling on the market state
Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 2 / 28
Section 1
Motivations
Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 3 / 28
Motivations
Most financial time series are too short!
We only observe one path of history out of the many possible.
As a consequence, most findings (e.g. trading algos, cross-sectional
alphas, portfolio construction methods) could be over-fitted to this one
particular observed path.
Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 4 / 28
Monte Carlo Simulations: A set of techniques to alleviate
these problems
Ideally: We want to sample time series from the underlying true
(multivariate) distribution.
Some of the techniques available:
sampling from a parametric distribution (iid, parameters fit on a
single path, simplistic and unrealistic distribution) [1946]
bootstrapping (iid, only historical values) [1979]
stationary block-bootstrapping (only historical values) [1994]
GANs (less obvious assumptions, but dependent on many
hyper-parameters such as its architecture) [2014]
Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 5 / 28
GANs
Already presented at the meetup by Alex Lau: http://www.hkml.ai/
2019/07/hong-kong-machine-learning-season-1-episode-12/
In finance (time series), not much yet but:
https://arxiv.org/abs/1901.01751, univariate time series;
https://arxiv.org/abs/1907.06673, univariate time series;
For multivariate time series, i.e. capturing the joint behaviour of a large
number of stocks, nothing really.
CorrGAN, https://arxiv.org/abs/1910.09504, is a first step.
Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 6 / 28
CorrGAN scope
Simulating the full multivariate distribution of stocks returns, that is
their joint behaviour (think correlations between the stocks), and also
marginal behaviour (think their typical volatility and occasional
jumps) is hard.
With CorrGAN, I will only focus on their joint behaviour as captured
by correlation matrices (already a major simplification of the full
dependence distribution - cf. copula theory).
Goal: Sampling realistic correlation matrices which could have been
estimated from real stock returns.
Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 7 / 28
Section 2
My attempts at building CorrGAN
Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 8 / 28
Subsection 1
Starting simple, always: The 3-dimensional case
Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 9 / 28
3D CorrGAN
E3 =



(ρ12, ρ13, ρ23) ∈ R3


1 ρ12 ρ13
ρ12 1 ρ23
ρ13 ρ23 1

 0



http://marti.ai/ml/2019/06/23/CorrGan-3D.html
http://marti.ai/ml/2019/07/01/CorrGan-3D-empirical.html
OK, it works! in 3D. . .
Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 10 / 28
Subsection 2
From 3D to nD, many difficulties arise. . .
Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 11 / 28
How to evaluate in nD?
Challenge: Not possible to visualize anymore the space of empirical and
simulated correlations, how to evaluate?
Several stylized facts are known about these matrices:
Distribution of pairwise correlations is significantly shifted to the
positive,
Eigenvalues follow the Marchenko–Pastur distribution, but for
1 a very large first eigenvalue,
2 a couple of other large eigenvalues,
Perron-Frobenius property (first eigenvector has positive entries),
Hierarchical structure of clusters,
Scale-free property of the corresponding MST.
http://marti.ai/ml/2019/07/15/
financial-correlations-stylized-facts.html
Alternative: Compare empirical (real) and generated (fake) distributions
using Topological Data Analysis https://arxiv.org/abs/1802.02664
Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 12 / 28
Permutation invariance in neural networks?
GANs rely on deep nets. Those are in general not permutation invariant.
Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 13 / 28
Why do we care about permutation invariance?
Regression task: Given a set of coefficients (the upper diagonal of a
correlation matrix), output the sum of its values.
Remark: There are n(n−1)
2 ! equivalent input vectors. If we don’t leverage
permutation invariance, the number of examples is not sufficient for the
model to “learn”. http://marti.ai/ml/2019/09/01/
correl-invariance-permutations-nn.html
Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 14 / 28
Idea 1: Build invariance directly into the NN architecture
A simple neural network module based on the permutation invariance
property of the sum operator one can plug into the main deep net for
adding permutation invariance to it:
Deep Sets https://arxiv.org/abs/1703.06114
My experience is that it is not working technology yet. Some other
research supporting this claim https://arxiv.org/abs/1901.09006.
Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 15 / 28
Idea 2: Find a canonical representation
Find a canonical representation, e.g. associate each of the n! equivalent
correlation matrices to the same one, the representer.
Arbitrary C Rij = CπS (i)πS (j) Rij = CπH (i)πH (j)
Figure 1: Three equivalent correlation matrices. The leftmost one has been
obtained by estimation on returns of arbitrarily ordered stocks; The one displayed
in the middle has been reordered by applying the same permutation πS to the
rows and columns (obtained by sorting the rows according to their sum); The
rightmost one by applying the same permutation πH to the rows and columns
(induced by a hierarchical clustering algorithm).
Question: Are some representations better than others?
Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 16 / 28
Subsection 3
Exploring different architectures
Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 17 / 28
MLP GAN
Did not manage to make it work: The GAN converges toward generating
the mean of the dataset.
Empirical Generated Mean of empirical
Figure 2: (Left) Flatten upper triangular of an empirical correlation matrix
re-ordered by πS and displayed in Figure 1; (Center) An example of vector
generated by the MLP GAN trained on 10,000 flatten upper triangular of
empirical correlation matrices re-ordered by πS . It seems that the model has
learnt to generate an average of the empirical correlations (Right).
http://marti.ai/ml/2019/09/22/
tf-mlp-gan-repr-correlation-matrices.html
Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 18 / 28
DCGAN + Hierarchical sorting ≈ CorrGAN
Figure 3: Three correlation matrices; Can you guess which one is
DCGAN-generated?
http://marti.ai/ml/2019/10/13/
tf-dcgan-financial-correlation-matrices.html
Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 19 / 28
Subsection 4
Evaluation of CorrGAN
Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 20 / 28
Evaluation of CorrGAN
As a first evaluation, we can verify that the generated matrices verify the
known stylized facts:
Figure 4: (Left) Distribution of correlations; (Center) Distribution of eigenvalues;
(Right) First eigenvector entries
Results are summarized in the paper:
https://arxiv.org/abs/1910.09504
http://marti.ai/ml/2019/10/13/
tf-dcgan-financial-correlation-matrices.html
Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 21 / 28
CorrGAN.io
One can look at outputs of the model (fake) vs real empirical correlations,
and try to guess which is which.
Figure 5: http://www.corrgan.io/, a simple web app using Flask.
Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 22 / 28
Section 3
Next steps
Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 23 / 28
Subsection 1
Comparison of ML-based portfolio allocation methods
Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 24 / 28
Lopez de Prado HRP vs. Papenbrock-Raffinot HERC
http://marti.ai/qfin/2019/12/04/
hierarchical-risk-parity-part-3.html
http://marti.ai/qfin/2020/03/22/
herc-part-i-implementation.html
Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 25 / 28
Subsection 2
cCorrGAN for conditional sampling on the market state
Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 26 / 28
cCorrGAN - {normal, stressed, rally} market correlations
We may want to sample conditional on the market state. For example,
3-modal: normal, rally, and stressed.
Figure 6: Correlation matrices estimated when the market was in a normal, rally,
and stress state respectively.
Preparing the training set: http:
//marti.ai/qfin/2020/02/03/sp500-sharpe-vs-corrmats.html
Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 27 / 28
Questions? Suggestions?
Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 28 / 28

More Related Content

Similar to My recent attempts at using GANs for simulating realistic stocks returns

CFM Challenge - Course Project
CFM Challenge - Course ProjectCFM Challenge - Course Project
CFM Challenge - Course ProjectKhalilBergaoui
 
Business game - Polimi (three-year bachelor thesis)
Business game - Polimi (three-year bachelor thesis)Business game - Polimi (three-year bachelor thesis)
Business game - Polimi (three-year bachelor thesis)filippo cheli
 
Modeling market and nonmarket Intangible investments in a macro-econometric f...
Modeling market and nonmarket Intangible investments in a macro-econometric f...Modeling market and nonmarket Intangible investments in a macro-econometric f...
Modeling market and nonmarket Intangible investments in a macro-econometric f...SPINTAN
 
Human activity spatio-temporal indicators using mobile phone data
Human activity spatio-temporal indicators using mobile phone dataHuman activity spatio-temporal indicators using mobile phone data
Human activity spatio-temporal indicators using mobile phone dataUniversity of Salerno
 
Testing and extending the capital asset pricing model
Testing and extending the capital asset pricing modelTesting and extending the capital asset pricing model
Testing and extending the capital asset pricing modelGabriel Koh
 
Dynamic Causal Relationships among the Greater China Stock markets
Dynamic Causal Relationships among the Greater China Stock marketsDynamic Causal Relationships among the Greater China Stock markets
Dynamic Causal Relationships among the Greater China Stock marketsAM Publications,India
 
Garch Models in Value-At-Risk Estimation for REIT
Garch Models in Value-At-Risk Estimation for REITGarch Models in Value-At-Risk Estimation for REIT
Garch Models in Value-At-Risk Estimation for REITIJERDJOURNAL
 
Re-Mining Association Mining Results through Visualization, Data Envelopment ...
Re-Mining Association Mining Results through Visualization, Data Envelopment ...Re-Mining Association Mining Results through Visualization, Data Envelopment ...
Re-Mining Association Mining Results through Visualization, Data Envelopment ...Gurdal Ertek
 
Intruction to Algorithms.pptx
Intruction to Algorithms.pptxIntruction to Algorithms.pptx
Intruction to Algorithms.pptxSayantamalHalder
 
Stochastic Vol Forecasting
Stochastic Vol ForecastingStochastic Vol Forecasting
Stochastic Vol ForecastingSwati Mital
 
An improved graph based method
An improved graph based methodAn improved graph based method
An improved graph based methodijseajournal
 
Re-Mining Association Mining Results Through Visualization, Data Envelopment ...
Re-Mining Association Mining Results Through Visualization, Data Envelopment ...Re-Mining Association Mining Results Through Visualization, Data Envelopment ...
Re-Mining Association Mining Results Through Visualization, Data Envelopment ...ertekg
 
PREDICTIVE EVALUATION OF THE STOCK PORTFOLIO PERFORMANCE USING FUZZY CMEANS A...
PREDICTIVE EVALUATION OF THE STOCK PORTFOLIO PERFORMANCE USING FUZZY CMEANS A...PREDICTIVE EVALUATION OF THE STOCK PORTFOLIO PERFORMANCE USING FUZZY CMEANS A...
PREDICTIVE EVALUATION OF THE STOCK PORTFOLIO PERFORMANCE USING FUZZY CMEANS A...ijfls
 

Similar to My recent attempts at using GANs for simulating realistic stocks returns (20)

CFM Challenge - Course Project
CFM Challenge - Course ProjectCFM Challenge - Course Project
CFM Challenge - Course Project
 
Business game - Polimi (three-year bachelor thesis)
Business game - Polimi (three-year bachelor thesis)Business game - Polimi (three-year bachelor thesis)
Business game - Polimi (three-year bachelor thesis)
 
Modeling market and nonmarket Intangible investments in a macro-econometric f...
Modeling market and nonmarket Intangible investments in a macro-econometric f...Modeling market and nonmarket Intangible investments in a macro-econometric f...
Modeling market and nonmarket Intangible investments in a macro-econometric f...
 
Mt 75 maelzer revise
Mt 75 maelzer reviseMt 75 maelzer revise
Mt 75 maelzer revise
 
Predicting Intraday Prices in the Frontier Stock Market of Romania Using Mach...
Predicting Intraday Prices in the Frontier Stock Market of Romania Using Mach...Predicting Intraday Prices in the Frontier Stock Market of Romania Using Mach...
Predicting Intraday Prices in the Frontier Stock Market of Romania Using Mach...
 
Human activity spatio-temporal indicators using mobile phone data
Human activity spatio-temporal indicators using mobile phone dataHuman activity spatio-temporal indicators using mobile phone data
Human activity spatio-temporal indicators using mobile phone data
 
Testing and extending the capital asset pricing model
Testing and extending the capital asset pricing modelTesting and extending the capital asset pricing model
Testing and extending the capital asset pricing model
 
Algorithmic competition – Emilio Calvano – June 2023 OECD discussion
Algorithmic competition – Emilio Calvano – June 2023 OECD discussionAlgorithmic competition – Emilio Calvano – June 2023 OECD discussion
Algorithmic competition – Emilio Calvano – June 2023 OECD discussion
 
Dynamic Causal Relationships among the Greater China Stock markets
Dynamic Causal Relationships among the Greater China Stock marketsDynamic Causal Relationships among the Greater China Stock markets
Dynamic Causal Relationships among the Greater China Stock markets
 
Garch Models in Value-At-Risk Estimation for REIT
Garch Models in Value-At-Risk Estimation for REITGarch Models in Value-At-Risk Estimation for REIT
Garch Models in Value-At-Risk Estimation for REIT
 
Ijcet 06 06_003
Ijcet 06 06_003Ijcet 06 06_003
Ijcet 06 06_003
 
Re-Mining Association Mining Results through Visualization, Data Envelopment ...
Re-Mining Association Mining Results through Visualization, Data Envelopment ...Re-Mining Association Mining Results through Visualization, Data Envelopment ...
Re-Mining Association Mining Results through Visualization, Data Envelopment ...
 
Intruction to Algorithms.pptx
Intruction to Algorithms.pptxIntruction to Algorithms.pptx
Intruction to Algorithms.pptx
 
Stochastic Vol Forecasting
Stochastic Vol ForecastingStochastic Vol Forecasting
Stochastic Vol Forecasting
 
An improved graph based method
An improved graph based methodAn improved graph based method
An improved graph based method
 
Re-Mining Association Mining Results Through Visualization, Data Envelopment ...
Re-Mining Association Mining Results Through Visualization, Data Envelopment ...Re-Mining Association Mining Results Through Visualization, Data Envelopment ...
Re-Mining Association Mining Results Through Visualization, Data Envelopment ...
 
Glm
GlmGlm
Glm
 
7 qc tools
7 qc tools7 qc tools
7 qc tools
 
PREDICTIVE EVALUATION OF THE STOCK PORTFOLIO PERFORMANCE USING FUZZY CMEANS A...
PREDICTIVE EVALUATION OF THE STOCK PORTFOLIO PERFORMANCE USING FUZZY CMEANS A...PREDICTIVE EVALUATION OF THE STOCK PORTFOLIO PERFORMANCE USING FUZZY CMEANS A...
PREDICTIVE EVALUATION OF THE STOCK PORTFOLIO PERFORMANCE USING FUZZY CMEANS A...
 
The mismeasuring of AI: How it all began
The mismeasuring of AI: How it all beganThe mismeasuring of AI: How it all began
The mismeasuring of AI: How it all began
 

More from Gautier Marti

Using Large Language Models in 10 Lines of Code
Using Large Language Models in 10 Lines of CodeUsing Large Language Models in 10 Lines of Code
Using Large Language Models in 10 Lines of CodeGautier Marti
 
What deep learning can bring to...
What deep learning can bring to...What deep learning can bring to...
What deep learning can bring to...Gautier Marti
 
A quick demo of Top2Vec With application on 2020 10-K business descriptions
A quick demo of Top2Vec With application on 2020 10-K business descriptionsA quick demo of Top2Vec With application on 2020 10-K business descriptions
A quick demo of Top2Vec With application on 2020 10-K business descriptionsGautier Marti
 
Autoregressive Convolutional Neural Networks for Asynchronous Time Series
Autoregressive Convolutional Neural Networks for Asynchronous Time SeriesAutoregressive Convolutional Neural Networks for Asynchronous Time Series
Autoregressive Convolutional Neural Networks for Asynchronous Time SeriesGautier Marti
 
Some contributions to the clustering of financial time series - Applications ...
Some contributions to the clustering of financial time series - Applications ...Some contributions to the clustering of financial time series - Applications ...
Some contributions to the clustering of financial time series - Applications ...Gautier Marti
 
Clustering CDS: algorithms, distances, stability and convergence rates
Clustering CDS: algorithms, distances, stability and convergence ratesClustering CDS: algorithms, distances, stability and convergence rates
Clustering CDS: algorithms, distances, stability and convergence ratesGautier Marti
 
Clustering Financial Time Series using their Correlations and their Distribut...
Clustering Financial Time Series using their Correlations and their Distribut...Clustering Financial Time Series using their Correlations and their Distribut...
Clustering Financial Time Series using their Correlations and their Distribut...Gautier Marti
 
A closer look at correlations
A closer look at correlationsA closer look at correlations
A closer look at correlationsGautier Marti
 
Clustering Financial Time Series: How Long is Enough?
Clustering Financial Time Series: How Long is Enough?Clustering Financial Time Series: How Long is Enough?
Clustering Financial Time Series: How Long is Enough?Gautier Marti
 
Optimal Transport vs. Fisher-Rao distance between Copulas
Optimal Transport vs. Fisher-Rao distance between CopulasOptimal Transport vs. Fisher-Rao distance between Copulas
Optimal Transport vs. Fisher-Rao distance between CopulasGautier Marti
 
On Clustering Financial Time Series - Beyond Correlation
On Clustering Financial Time Series - Beyond CorrelationOn Clustering Financial Time Series - Beyond Correlation
On Clustering Financial Time Series - Beyond CorrelationGautier Marti
 
Optimal Transport between Copulas for Clustering Time Series
Optimal Transport between Copulas for Clustering Time SeriesOptimal Transport between Copulas for Clustering Time Series
Optimal Transport between Copulas for Clustering Time SeriesGautier Marti
 
On the stability of clustering financial time series
On the stability of clustering financial time seriesOn the stability of clustering financial time series
On the stability of clustering financial time seriesGautier Marti
 
Clustering Random Walk Time Series
Clustering Random Walk Time SeriesClustering Random Walk Time Series
Clustering Random Walk Time SeriesGautier Marti
 
On clustering financial time series - A need for distances between dependent ...
On clustering financial time series - A need for distances between dependent ...On clustering financial time series - A need for distances between dependent ...
On clustering financial time series - A need for distances between dependent ...Gautier Marti
 

More from Gautier Marti (15)

Using Large Language Models in 10 Lines of Code
Using Large Language Models in 10 Lines of CodeUsing Large Language Models in 10 Lines of Code
Using Large Language Models in 10 Lines of Code
 
What deep learning can bring to...
What deep learning can bring to...What deep learning can bring to...
What deep learning can bring to...
 
A quick demo of Top2Vec With application on 2020 10-K business descriptions
A quick demo of Top2Vec With application on 2020 10-K business descriptionsA quick demo of Top2Vec With application on 2020 10-K business descriptions
A quick demo of Top2Vec With application on 2020 10-K business descriptions
 
Autoregressive Convolutional Neural Networks for Asynchronous Time Series
Autoregressive Convolutional Neural Networks for Asynchronous Time SeriesAutoregressive Convolutional Neural Networks for Asynchronous Time Series
Autoregressive Convolutional Neural Networks for Asynchronous Time Series
 
Some contributions to the clustering of financial time series - Applications ...
Some contributions to the clustering of financial time series - Applications ...Some contributions to the clustering of financial time series - Applications ...
Some contributions to the clustering of financial time series - Applications ...
 
Clustering CDS: algorithms, distances, stability and convergence rates
Clustering CDS: algorithms, distances, stability and convergence ratesClustering CDS: algorithms, distances, stability and convergence rates
Clustering CDS: algorithms, distances, stability and convergence rates
 
Clustering Financial Time Series using their Correlations and their Distribut...
Clustering Financial Time Series using their Correlations and their Distribut...Clustering Financial Time Series using their Correlations and their Distribut...
Clustering Financial Time Series using their Correlations and their Distribut...
 
A closer look at correlations
A closer look at correlationsA closer look at correlations
A closer look at correlations
 
Clustering Financial Time Series: How Long is Enough?
Clustering Financial Time Series: How Long is Enough?Clustering Financial Time Series: How Long is Enough?
Clustering Financial Time Series: How Long is Enough?
 
Optimal Transport vs. Fisher-Rao distance between Copulas
Optimal Transport vs. Fisher-Rao distance between CopulasOptimal Transport vs. Fisher-Rao distance between Copulas
Optimal Transport vs. Fisher-Rao distance between Copulas
 
On Clustering Financial Time Series - Beyond Correlation
On Clustering Financial Time Series - Beyond CorrelationOn Clustering Financial Time Series - Beyond Correlation
On Clustering Financial Time Series - Beyond Correlation
 
Optimal Transport between Copulas for Clustering Time Series
Optimal Transport between Copulas for Clustering Time SeriesOptimal Transport between Copulas for Clustering Time Series
Optimal Transport between Copulas for Clustering Time Series
 
On the stability of clustering financial time series
On the stability of clustering financial time seriesOn the stability of clustering financial time series
On the stability of clustering financial time series
 
Clustering Random Walk Time Series
Clustering Random Walk Time SeriesClustering Random Walk Time Series
Clustering Random Walk Time Series
 
On clustering financial time series - A need for distances between dependent ...
On clustering financial time series - A need for distances between dependent ...On clustering financial time series - A need for distances between dependent ...
On clustering financial time series - A need for distances between dependent ...
 

Recently uploaded

The Core Functions of the Bangko Sentral ng Pilipinas
The Core Functions of the Bangko Sentral ng PilipinasThe Core Functions of the Bangko Sentral ng Pilipinas
The Core Functions of the Bangko Sentral ng PilipinasCherylouCamus
 
原版1:1复刻堪萨斯大学毕业证KU毕业证留信学历认证
原版1:1复刻堪萨斯大学毕业证KU毕业证留信学历认证原版1:1复刻堪萨斯大学毕业证KU毕业证留信学历认证
原版1:1复刻堪萨斯大学毕业证KU毕业证留信学历认证jdkhjh
 
NO1 Certified Ilam kala Jadu Specialist Expert In Bahawalpur, Sargodha, Sialk...
NO1 Certified Ilam kala Jadu Specialist Expert In Bahawalpur, Sargodha, Sialk...NO1 Certified Ilam kala Jadu Specialist Expert In Bahawalpur, Sargodha, Sialk...
NO1 Certified Ilam kala Jadu Specialist Expert In Bahawalpur, Sargodha, Sialk...Amil Baba Dawood bangali
 
PMFBY , Pradhan Mantri Fasal bima yojna
PMFBY , Pradhan Mantri  Fasal bima yojnaPMFBY , Pradhan Mantri  Fasal bima yojna
PMFBY , Pradhan Mantri Fasal bima yojnaDharmendra Kumar
 
NO1 WorldWide Love marriage specialist baba ji Amil Baba Kala ilam powerful v...
NO1 WorldWide Love marriage specialist baba ji Amil Baba Kala ilam powerful v...NO1 WorldWide Love marriage specialist baba ji Amil Baba Kala ilam powerful v...
NO1 WorldWide Love marriage specialist baba ji Amil Baba Kala ilam powerful v...Amil baba
 
(办理学位证)加拿大萨省大学毕业证成绩单原版一比一
(办理学位证)加拿大萨省大学毕业证成绩单原版一比一(办理学位证)加拿大萨省大学毕业证成绩单原版一比一
(办理学位证)加拿大萨省大学毕业证成绩单原版一比一S SDS
 
Classical Theory of Macroeconomics by Adam Smith
Classical Theory of Macroeconomics by Adam SmithClassical Theory of Macroeconomics by Adam Smith
Classical Theory of Macroeconomics by Adam SmithAdamYassin2
 
chapter_2.ppt The labour market definitions and trends
chapter_2.ppt The labour market definitions and trendschapter_2.ppt The labour market definitions and trends
chapter_2.ppt The labour market definitions and trendslemlemtesfaye192
 
Economics, Commerce and Trade Management: An International Journal (ECTIJ)
Economics, Commerce and Trade Management: An International Journal (ECTIJ)Economics, Commerce and Trade Management: An International Journal (ECTIJ)
Economics, Commerce and Trade Management: An International Journal (ECTIJ)ECTIJ
 
How Automation is Driving Efficiency Through the Last Mile of Reporting
How Automation is Driving Efficiency Through the Last Mile of ReportingHow Automation is Driving Efficiency Through the Last Mile of Reporting
How Automation is Driving Efficiency Through the Last Mile of ReportingAggregage
 
Vp Girls near me Delhi Call Now or WhatsApp
Vp Girls near me Delhi Call Now or WhatsAppVp Girls near me Delhi Call Now or WhatsApp
Vp Girls near me Delhi Call Now or WhatsAppmiss dipika
 
Call Girls Near Me WhatsApp:+91-9833363713
Call Girls Near Me WhatsApp:+91-9833363713Call Girls Near Me WhatsApp:+91-9833363713
Call Girls Near Me WhatsApp:+91-9833363713Sonam Pathan
 
Stock Market Brief Deck for 4/24/24 .pdf
Stock Market Brief Deck for 4/24/24 .pdfStock Market Brief Deck for 4/24/24 .pdf
Stock Market Brief Deck for 4/24/24 .pdfMichael Silva
 
Monthly Market Risk Update: April 2024 [SlideShare]
Monthly Market Risk Update: April 2024 [SlideShare]Monthly Market Risk Update: April 2024 [SlideShare]
Monthly Market Risk Update: April 2024 [SlideShare]Commonwealth
 
Call Girls Near Golden Tulip Essential Hotel, New Delhi 9873777170
Call Girls Near Golden Tulip Essential Hotel, New Delhi 9873777170Call Girls Near Golden Tulip Essential Hotel, New Delhi 9873777170
Call Girls Near Golden Tulip Essential Hotel, New Delhi 9873777170Sonam Pathan
 
Economic Risk Factor Update: April 2024 [SlideShare]
Economic Risk Factor Update: April 2024 [SlideShare]Economic Risk Factor Update: April 2024 [SlideShare]
Economic Risk Factor Update: April 2024 [SlideShare]Commonwealth
 
letter-from-the-chair-to-the-fca-relating-to-british-steel-pensions-scheme-15...
letter-from-the-chair-to-the-fca-relating-to-british-steel-pensions-scheme-15...letter-from-the-chair-to-the-fca-relating-to-british-steel-pensions-scheme-15...
letter-from-the-chair-to-the-fca-relating-to-british-steel-pensions-scheme-15...Henry Tapper
 
Lundin Gold April 2024 Corporate Presentation v4.pdf
Lundin Gold April 2024 Corporate Presentation v4.pdfLundin Gold April 2024 Corporate Presentation v4.pdf
Lundin Gold April 2024 Corporate Presentation v4.pdfAdnet Communications
 

Recently uploaded (20)

The Core Functions of the Bangko Sentral ng Pilipinas
The Core Functions of the Bangko Sentral ng PilipinasThe Core Functions of the Bangko Sentral ng Pilipinas
The Core Functions of the Bangko Sentral ng Pilipinas
 
原版1:1复刻堪萨斯大学毕业证KU毕业证留信学历认证
原版1:1复刻堪萨斯大学毕业证KU毕业证留信学历认证原版1:1复刻堪萨斯大学毕业证KU毕业证留信学历认证
原版1:1复刻堪萨斯大学毕业证KU毕业证留信学历认证
 
NO1 Certified Ilam kala Jadu Specialist Expert In Bahawalpur, Sargodha, Sialk...
NO1 Certified Ilam kala Jadu Specialist Expert In Bahawalpur, Sargodha, Sialk...NO1 Certified Ilam kala Jadu Specialist Expert In Bahawalpur, Sargodha, Sialk...
NO1 Certified Ilam kala Jadu Specialist Expert In Bahawalpur, Sargodha, Sialk...
 
PMFBY , Pradhan Mantri Fasal bima yojna
PMFBY , Pradhan Mantri  Fasal bima yojnaPMFBY , Pradhan Mantri  Fasal bima yojna
PMFBY , Pradhan Mantri Fasal bima yojna
 
NO1 WorldWide Love marriage specialist baba ji Amil Baba Kala ilam powerful v...
NO1 WorldWide Love marriage specialist baba ji Amil Baba Kala ilam powerful v...NO1 WorldWide Love marriage specialist baba ji Amil Baba Kala ilam powerful v...
NO1 WorldWide Love marriage specialist baba ji Amil Baba Kala ilam powerful v...
 
(办理学位证)加拿大萨省大学毕业证成绩单原版一比一
(办理学位证)加拿大萨省大学毕业证成绩单原版一比一(办理学位证)加拿大萨省大学毕业证成绩单原版一比一
(办理学位证)加拿大萨省大学毕业证成绩单原版一比一
 
Classical Theory of Macroeconomics by Adam Smith
Classical Theory of Macroeconomics by Adam SmithClassical Theory of Macroeconomics by Adam Smith
Classical Theory of Macroeconomics by Adam Smith
 
🔝+919953056974 🔝young Delhi Escort service Pusa Road
🔝+919953056974 🔝young Delhi Escort service Pusa Road🔝+919953056974 🔝young Delhi Escort service Pusa Road
🔝+919953056974 🔝young Delhi Escort service Pusa Road
 
chapter_2.ppt The labour market definitions and trends
chapter_2.ppt The labour market definitions and trendschapter_2.ppt The labour market definitions and trends
chapter_2.ppt The labour market definitions and trends
 
Economics, Commerce and Trade Management: An International Journal (ECTIJ)
Economics, Commerce and Trade Management: An International Journal (ECTIJ)Economics, Commerce and Trade Management: An International Journal (ECTIJ)
Economics, Commerce and Trade Management: An International Journal (ECTIJ)
 
How Automation is Driving Efficiency Through the Last Mile of Reporting
How Automation is Driving Efficiency Through the Last Mile of ReportingHow Automation is Driving Efficiency Through the Last Mile of Reporting
How Automation is Driving Efficiency Through the Last Mile of Reporting
 
Vp Girls near me Delhi Call Now or WhatsApp
Vp Girls near me Delhi Call Now or WhatsAppVp Girls near me Delhi Call Now or WhatsApp
Vp Girls near me Delhi Call Now or WhatsApp
 
Call Girls Near Me WhatsApp:+91-9833363713
Call Girls Near Me WhatsApp:+91-9833363713Call Girls Near Me WhatsApp:+91-9833363713
Call Girls Near Me WhatsApp:+91-9833363713
 
Stock Market Brief Deck for 4/24/24 .pdf
Stock Market Brief Deck for 4/24/24 .pdfStock Market Brief Deck for 4/24/24 .pdf
Stock Market Brief Deck for 4/24/24 .pdf
 
Monthly Economic Monitoring of Ukraine No 231, April 2024
Monthly Economic Monitoring of Ukraine No 231, April 2024Monthly Economic Monitoring of Ukraine No 231, April 2024
Monthly Economic Monitoring of Ukraine No 231, April 2024
 
Monthly Market Risk Update: April 2024 [SlideShare]
Monthly Market Risk Update: April 2024 [SlideShare]Monthly Market Risk Update: April 2024 [SlideShare]
Monthly Market Risk Update: April 2024 [SlideShare]
 
Call Girls Near Golden Tulip Essential Hotel, New Delhi 9873777170
Call Girls Near Golden Tulip Essential Hotel, New Delhi 9873777170Call Girls Near Golden Tulip Essential Hotel, New Delhi 9873777170
Call Girls Near Golden Tulip Essential Hotel, New Delhi 9873777170
 
Economic Risk Factor Update: April 2024 [SlideShare]
Economic Risk Factor Update: April 2024 [SlideShare]Economic Risk Factor Update: April 2024 [SlideShare]
Economic Risk Factor Update: April 2024 [SlideShare]
 
letter-from-the-chair-to-the-fca-relating-to-british-steel-pensions-scheme-15...
letter-from-the-chair-to-the-fca-relating-to-british-steel-pensions-scheme-15...letter-from-the-chair-to-the-fca-relating-to-british-steel-pensions-scheme-15...
letter-from-the-chair-to-the-fca-relating-to-british-steel-pensions-scheme-15...
 
Lundin Gold April 2024 Corporate Presentation v4.pdf
Lundin Gold April 2024 Corporate Presentation v4.pdfLundin Gold April 2024 Corporate Presentation v4.pdf
Lundin Gold April 2024 Corporate Presentation v4.pdf
 

My recent attempts at using GANs for simulating realistic stocks returns

  • 1. My recent attempts at using GANs for simulating realistic stocks returns Hong Kong Machine Learning Meetup - Season 2 Episode 4 [online] Gautier Marti HKML 8 April 2020 Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 1 / 28
  • 2. Table of contents 1 Motivations 2 My attempts at building CorrGAN Starting simple, always: The 3-dimensional case From 3D to nD, many difficulties arise. . . Exploring different architectures Evaluation of CorrGAN 3 Next steps Comparison of ML-based portfolio allocation methods cCorrGAN for conditional sampling on the market state Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 2 / 28
  • 3. Section 1 Motivations Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 3 / 28
  • 4. Motivations Most financial time series are too short! We only observe one path of history out of the many possible. As a consequence, most findings (e.g. trading algos, cross-sectional alphas, portfolio construction methods) could be over-fitted to this one particular observed path. Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 4 / 28
  • 5. Monte Carlo Simulations: A set of techniques to alleviate these problems Ideally: We want to sample time series from the underlying true (multivariate) distribution. Some of the techniques available: sampling from a parametric distribution (iid, parameters fit on a single path, simplistic and unrealistic distribution) [1946] bootstrapping (iid, only historical values) [1979] stationary block-bootstrapping (only historical values) [1994] GANs (less obvious assumptions, but dependent on many hyper-parameters such as its architecture) [2014] Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 5 / 28
  • 6. GANs Already presented at the meetup by Alex Lau: http://www.hkml.ai/ 2019/07/hong-kong-machine-learning-season-1-episode-12/ In finance (time series), not much yet but: https://arxiv.org/abs/1901.01751, univariate time series; https://arxiv.org/abs/1907.06673, univariate time series; For multivariate time series, i.e. capturing the joint behaviour of a large number of stocks, nothing really. CorrGAN, https://arxiv.org/abs/1910.09504, is a first step. Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 6 / 28
  • 7. CorrGAN scope Simulating the full multivariate distribution of stocks returns, that is their joint behaviour (think correlations between the stocks), and also marginal behaviour (think their typical volatility and occasional jumps) is hard. With CorrGAN, I will only focus on their joint behaviour as captured by correlation matrices (already a major simplification of the full dependence distribution - cf. copula theory). Goal: Sampling realistic correlation matrices which could have been estimated from real stock returns. Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 7 / 28
  • 8. Section 2 My attempts at building CorrGAN Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 8 / 28
  • 9. Subsection 1 Starting simple, always: The 3-dimensional case Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 9 / 28
  • 10. 3D CorrGAN E3 =    (ρ12, ρ13, ρ23) ∈ R3   1 ρ12 ρ13 ρ12 1 ρ23 ρ13 ρ23 1   0    http://marti.ai/ml/2019/06/23/CorrGan-3D.html http://marti.ai/ml/2019/07/01/CorrGan-3D-empirical.html OK, it works! in 3D. . . Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 10 / 28
  • 11. Subsection 2 From 3D to nD, many difficulties arise. . . Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 11 / 28
  • 12. How to evaluate in nD? Challenge: Not possible to visualize anymore the space of empirical and simulated correlations, how to evaluate? Several stylized facts are known about these matrices: Distribution of pairwise correlations is significantly shifted to the positive, Eigenvalues follow the Marchenko–Pastur distribution, but for 1 a very large first eigenvalue, 2 a couple of other large eigenvalues, Perron-Frobenius property (first eigenvector has positive entries), Hierarchical structure of clusters, Scale-free property of the corresponding MST. http://marti.ai/ml/2019/07/15/ financial-correlations-stylized-facts.html Alternative: Compare empirical (real) and generated (fake) distributions using Topological Data Analysis https://arxiv.org/abs/1802.02664 Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 12 / 28
  • 13. Permutation invariance in neural networks? GANs rely on deep nets. Those are in general not permutation invariant. Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 13 / 28
  • 14. Why do we care about permutation invariance? Regression task: Given a set of coefficients (the upper diagonal of a correlation matrix), output the sum of its values. Remark: There are n(n−1) 2 ! equivalent input vectors. If we don’t leverage permutation invariance, the number of examples is not sufficient for the model to “learn”. http://marti.ai/ml/2019/09/01/ correl-invariance-permutations-nn.html Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 14 / 28
  • 15. Idea 1: Build invariance directly into the NN architecture A simple neural network module based on the permutation invariance property of the sum operator one can plug into the main deep net for adding permutation invariance to it: Deep Sets https://arxiv.org/abs/1703.06114 My experience is that it is not working technology yet. Some other research supporting this claim https://arxiv.org/abs/1901.09006. Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 15 / 28
  • 16. Idea 2: Find a canonical representation Find a canonical representation, e.g. associate each of the n! equivalent correlation matrices to the same one, the representer. Arbitrary C Rij = CπS (i)πS (j) Rij = CπH (i)πH (j) Figure 1: Three equivalent correlation matrices. The leftmost one has been obtained by estimation on returns of arbitrarily ordered stocks; The one displayed in the middle has been reordered by applying the same permutation πS to the rows and columns (obtained by sorting the rows according to their sum); The rightmost one by applying the same permutation πH to the rows and columns (induced by a hierarchical clustering algorithm). Question: Are some representations better than others? Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 16 / 28
  • 17. Subsection 3 Exploring different architectures Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 17 / 28
  • 18. MLP GAN Did not manage to make it work: The GAN converges toward generating the mean of the dataset. Empirical Generated Mean of empirical Figure 2: (Left) Flatten upper triangular of an empirical correlation matrix re-ordered by πS and displayed in Figure 1; (Center) An example of vector generated by the MLP GAN trained on 10,000 flatten upper triangular of empirical correlation matrices re-ordered by πS . It seems that the model has learnt to generate an average of the empirical correlations (Right). http://marti.ai/ml/2019/09/22/ tf-mlp-gan-repr-correlation-matrices.html Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 18 / 28
  • 19. DCGAN + Hierarchical sorting ≈ CorrGAN Figure 3: Three correlation matrices; Can you guess which one is DCGAN-generated? http://marti.ai/ml/2019/10/13/ tf-dcgan-financial-correlation-matrices.html Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 19 / 28
  • 20. Subsection 4 Evaluation of CorrGAN Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 20 / 28
  • 21. Evaluation of CorrGAN As a first evaluation, we can verify that the generated matrices verify the known stylized facts: Figure 4: (Left) Distribution of correlations; (Center) Distribution of eigenvalues; (Right) First eigenvector entries Results are summarized in the paper: https://arxiv.org/abs/1910.09504 http://marti.ai/ml/2019/10/13/ tf-dcgan-financial-correlation-matrices.html Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 21 / 28
  • 22. CorrGAN.io One can look at outputs of the model (fake) vs real empirical correlations, and try to guess which is which. Figure 5: http://www.corrgan.io/, a simple web app using Flask. Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 22 / 28
  • 23. Section 3 Next steps Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 23 / 28
  • 24. Subsection 1 Comparison of ML-based portfolio allocation methods Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 24 / 28
  • 25. Lopez de Prado HRP vs. Papenbrock-Raffinot HERC http://marti.ai/qfin/2019/12/04/ hierarchical-risk-parity-part-3.html http://marti.ai/qfin/2020/03/22/ herc-part-i-implementation.html Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 25 / 28
  • 26. Subsection 2 cCorrGAN for conditional sampling on the market state Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 26 / 28
  • 27. cCorrGAN - {normal, stressed, rally} market correlations We may want to sample conditional on the market state. For example, 3-modal: normal, rally, and stressed. Figure 6: Correlation matrices estimated when the market was in a normal, rally, and stress state respectively. Preparing the training set: http: //marti.ai/qfin/2020/02/03/sp500-sharpe-vs-corrmats.html Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 27 / 28
  • 28. Questions? Suggestions? Gautier Marti (HKML) GANs and financial stock returns 8 April 2020 28 / 28