SlideShare une entreprise Scribd logo
1  sur  28
Télécharger pour lire hors ligne
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

Contenu connexe

Similaire à 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
 

Similaire à 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
 

Plus de 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
 

Plus de 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 ...
 

Dernier

Webinar on E-Invoicing for Fintech Belgium
Webinar on E-Invoicing for Fintech BelgiumWebinar on E-Invoicing for Fintech Belgium
Webinar on E-Invoicing for Fintech BelgiumFinTech Belgium
 
MASTERING FOREX: STRATEGIES FOR SUCCESS.pdf
MASTERING FOREX: STRATEGIES FOR SUCCESS.pdfMASTERING FOREX: STRATEGIES FOR SUCCESS.pdf
MASTERING FOREX: STRATEGIES FOR SUCCESS.pdfCocity Enterprises
 
Group 8 - Goldman Sachs & 1MDB Case Studies
Group 8 - Goldman Sachs & 1MDB Case StudiesGroup 8 - Goldman Sachs & 1MDB Case Studies
Group 8 - Goldman Sachs & 1MDB Case StudiesNghiaPham100
 
Test bank for advanced assessment interpreting findings and formulating diffe...
Test bank for advanced assessment interpreting findings and formulating diffe...Test bank for advanced assessment interpreting findings and formulating diffe...
Test bank for advanced assessment interpreting findings and formulating diffe...robinsonayot
 
Business Principles, Tools, and Techniques in Participating in Various Types...
Business Principles, Tools, and Techniques  in Participating in Various Types...Business Principles, Tools, and Techniques  in Participating in Various Types...
Business Principles, Tools, and Techniques in Participating in Various Types...jeffreytingson
 
Stock Market Brief Deck (Under Pressure).pdf
Stock Market Brief Deck (Under Pressure).pdfStock Market Brief Deck (Under Pressure).pdf
Stock Market Brief Deck (Under Pressure).pdfMichael Silva
 
abortion pills in Riyadh Saudi Arabia (+919707899604)cytotec pills in dammam
abortion pills in Riyadh Saudi Arabia (+919707899604)cytotec pills in dammamabortion pills in Riyadh Saudi Arabia (+919707899604)cytotec pills in dammam
abortion pills in Riyadh Saudi Arabia (+919707899604)cytotec pills in dammamsamsungultra782445
 
Call Girls Howrah ( 8250092165 ) Cheap rates call girls | Get low budget
Call Girls Howrah ( 8250092165 ) Cheap rates call girls | Get low budgetCall Girls Howrah ( 8250092165 ) Cheap rates call girls | Get low budget
Call Girls Howrah ( 8250092165 ) Cheap rates call girls | Get low budgetSareena Khatun
 
falcon-invoice-discounting-unlocking-prime-investment-opportunities
falcon-invoice-discounting-unlocking-prime-investment-opportunitiesfalcon-invoice-discounting-unlocking-prime-investment-opportunities
falcon-invoice-discounting-unlocking-prime-investment-opportunitiesFalcon Invoice Discounting
 
20240419-SMC-submission-Annual-Superannuation-Performance-Test-–-design-optio...
20240419-SMC-submission-Annual-Superannuation-Performance-Test-–-design-optio...20240419-SMC-submission-Annual-Superannuation-Performance-Test-–-design-optio...
20240419-SMC-submission-Annual-Superannuation-Performance-Test-–-design-optio...Henry Tapper
 
Law of Demand.pptxnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
Law of Demand.pptxnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnLaw of Demand.pptxnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
Law of Demand.pptxnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnTintoTom3
 
+97470301568>>buy weed in qatar,buy thc oil in qatar doha>>buy cannabis oil i...
+97470301568>>buy weed in qatar,buy thc oil in qatar doha>>buy cannabis oil i...+97470301568>>buy weed in qatar,buy thc oil in qatar doha>>buy cannabis oil i...
+97470301568>>buy weed in qatar,buy thc oil in qatar doha>>buy cannabis oil i...Health
 
Certified Kala Jadu, Black magic specialist in Rawalpindi and Bangali Amil ba...
Certified Kala Jadu, Black magic specialist in Rawalpindi and Bangali Amil ba...Certified Kala Jadu, Black magic specialist in Rawalpindi and Bangali Amil ba...
Certified Kala Jadu, Black magic specialist in Rawalpindi and Bangali Amil ba...batoole333
 
In Sharjah ௵(+971)558539980 *_௵abortion pills now available.
In Sharjah ௵(+971)558539980 *_௵abortion pills now available.In Sharjah ௵(+971)558539980 *_௵abortion pills now available.
In Sharjah ௵(+971)558539980 *_௵abortion pills now available.hyt3577
 
Strategic Resources May 2024 Corporate Presentation
Strategic Resources May 2024 Corporate PresentationStrategic Resources May 2024 Corporate Presentation
Strategic Resources May 2024 Corporate PresentationAdnet Communications
 
Avoidable Errors in Payroll Compliance for Payroll Services Providers - Globu...
Avoidable Errors in Payroll Compliance for Payroll Services Providers - Globu...Avoidable Errors in Payroll Compliance for Payroll Services Providers - Globu...
Avoidable Errors in Payroll Compliance for Payroll Services Providers - Globu...globusfinanza
 
Economics Presentation-2.pdf xxjshshsjsjsjwjw
Economics Presentation-2.pdf xxjshshsjsjsjwjwEconomics Presentation-2.pdf xxjshshsjsjsjwjw
Economics Presentation-2.pdf xxjshshsjsjsjwjwmordockmatt25
 
Responsible Finance Principles and Implication
Responsible Finance Principles and ImplicationResponsible Finance Principles and Implication
Responsible Finance Principles and ImplicationNghiaPham100
 
Explore Dual Citizenship in Africa | Citizenship Benefits & Requirements
Explore Dual Citizenship in Africa | Citizenship Benefits & RequirementsExplore Dual Citizenship in Africa | Citizenship Benefits & Requirements
Explore Dual Citizenship in Africa | Citizenship Benefits & Requirementsmarketingkingdomofku
 
Q1 2024 Conference Call Presentation vF.pdf
Q1 2024 Conference Call Presentation vF.pdfQ1 2024 Conference Call Presentation vF.pdf
Q1 2024 Conference Call Presentation vF.pdfAdnet Communications
 

Dernier (20)

Webinar on E-Invoicing for Fintech Belgium
Webinar on E-Invoicing for Fintech BelgiumWebinar on E-Invoicing for Fintech Belgium
Webinar on E-Invoicing for Fintech Belgium
 
MASTERING FOREX: STRATEGIES FOR SUCCESS.pdf
MASTERING FOREX: STRATEGIES FOR SUCCESS.pdfMASTERING FOREX: STRATEGIES FOR SUCCESS.pdf
MASTERING FOREX: STRATEGIES FOR SUCCESS.pdf
 
Group 8 - Goldman Sachs & 1MDB Case Studies
Group 8 - Goldman Sachs & 1MDB Case StudiesGroup 8 - Goldman Sachs & 1MDB Case Studies
Group 8 - Goldman Sachs & 1MDB Case Studies
 
Test bank for advanced assessment interpreting findings and formulating diffe...
Test bank for advanced assessment interpreting findings and formulating diffe...Test bank for advanced assessment interpreting findings and formulating diffe...
Test bank for advanced assessment interpreting findings and formulating diffe...
 
Business Principles, Tools, and Techniques in Participating in Various Types...
Business Principles, Tools, and Techniques  in Participating in Various Types...Business Principles, Tools, and Techniques  in Participating in Various Types...
Business Principles, Tools, and Techniques in Participating in Various Types...
 
Stock Market Brief Deck (Under Pressure).pdf
Stock Market Brief Deck (Under Pressure).pdfStock Market Brief Deck (Under Pressure).pdf
Stock Market Brief Deck (Under Pressure).pdf
 
abortion pills in Riyadh Saudi Arabia (+919707899604)cytotec pills in dammam
abortion pills in Riyadh Saudi Arabia (+919707899604)cytotec pills in dammamabortion pills in Riyadh Saudi Arabia (+919707899604)cytotec pills in dammam
abortion pills in Riyadh Saudi Arabia (+919707899604)cytotec pills in dammam
 
Call Girls Howrah ( 8250092165 ) Cheap rates call girls | Get low budget
Call Girls Howrah ( 8250092165 ) Cheap rates call girls | Get low budgetCall Girls Howrah ( 8250092165 ) Cheap rates call girls | Get low budget
Call Girls Howrah ( 8250092165 ) Cheap rates call girls | Get low budget
 
falcon-invoice-discounting-unlocking-prime-investment-opportunities
falcon-invoice-discounting-unlocking-prime-investment-opportunitiesfalcon-invoice-discounting-unlocking-prime-investment-opportunities
falcon-invoice-discounting-unlocking-prime-investment-opportunities
 
20240419-SMC-submission-Annual-Superannuation-Performance-Test-–-design-optio...
20240419-SMC-submission-Annual-Superannuation-Performance-Test-–-design-optio...20240419-SMC-submission-Annual-Superannuation-Performance-Test-–-design-optio...
20240419-SMC-submission-Annual-Superannuation-Performance-Test-–-design-optio...
 
Law of Demand.pptxnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
Law of Demand.pptxnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnLaw of Demand.pptxnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
Law of Demand.pptxnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
 
+97470301568>>buy weed in qatar,buy thc oil in qatar doha>>buy cannabis oil i...
+97470301568>>buy weed in qatar,buy thc oil in qatar doha>>buy cannabis oil i...+97470301568>>buy weed in qatar,buy thc oil in qatar doha>>buy cannabis oil i...
+97470301568>>buy weed in qatar,buy thc oil in qatar doha>>buy cannabis oil i...
 
Certified Kala Jadu, Black magic specialist in Rawalpindi and Bangali Amil ba...
Certified Kala Jadu, Black magic specialist in Rawalpindi and Bangali Amil ba...Certified Kala Jadu, Black magic specialist in Rawalpindi and Bangali Amil ba...
Certified Kala Jadu, Black magic specialist in Rawalpindi and Bangali Amil ba...
 
In Sharjah ௵(+971)558539980 *_௵abortion pills now available.
In Sharjah ௵(+971)558539980 *_௵abortion pills now available.In Sharjah ௵(+971)558539980 *_௵abortion pills now available.
In Sharjah ௵(+971)558539980 *_௵abortion pills now available.
 
Strategic Resources May 2024 Corporate Presentation
Strategic Resources May 2024 Corporate PresentationStrategic Resources May 2024 Corporate Presentation
Strategic Resources May 2024 Corporate Presentation
 
Avoidable Errors in Payroll Compliance for Payroll Services Providers - Globu...
Avoidable Errors in Payroll Compliance for Payroll Services Providers - Globu...Avoidable Errors in Payroll Compliance for Payroll Services Providers - Globu...
Avoidable Errors in Payroll Compliance for Payroll Services Providers - Globu...
 
Economics Presentation-2.pdf xxjshshsjsjsjwjw
Economics Presentation-2.pdf xxjshshsjsjsjwjwEconomics Presentation-2.pdf xxjshshsjsjsjwjw
Economics Presentation-2.pdf xxjshshsjsjsjwjw
 
Responsible Finance Principles and Implication
Responsible Finance Principles and ImplicationResponsible Finance Principles and Implication
Responsible Finance Principles and Implication
 
Explore Dual Citizenship in Africa | Citizenship Benefits & Requirements
Explore Dual Citizenship in Africa | Citizenship Benefits & RequirementsExplore Dual Citizenship in Africa | Citizenship Benefits & Requirements
Explore Dual Citizenship in Africa | Citizenship Benefits & Requirements
 
Q1 2024 Conference Call Presentation vF.pdf
Q1 2024 Conference Call Presentation vF.pdfQ1 2024 Conference Call Presentation vF.pdf
Q1 2024 Conference Call Presentation vF.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