Machine Learning for Quantitative Finance Fast derivative pricing Sofie Reyners Joint work with Jan De Spiegeleer, Dilip Madan and Wim Schoutens
Derivative pricing is time-consuming... Vanilla option pricing European-type Fast Fourier transform American-type Tree methods Exotic option pricing Monte Carlo simulations 1 Machine Learning for Quantitative Finance
... but time is money! time-consuming algorithms continuously moving markets prices are outdated when available, overnight calculations cannot be performed in one night,... 2 Machine Learning for Quantitative Finance
Let a machine learn the pricing function machine learning product, market and model parameters model price time-consuming method Expensive pricing function is summarized with machine learning. 3 Machine Learning for Quantitative Finance
Let a machine learn the pricing function machine learning product, market and model parameters model price time-consuming method When training is completed, prediction is extremely fast! 3 Machine Learning for Quantitative Finance
Gaussian process regression (GPR) Consider a training set (X, y) = {(x i, y i ) i = 1,..., n}. Find a relation between inputs and outputs: y i = f(x i ) + ε i where f(x) is a Gaussian process and ε i N (0, σ 2 n) are i.i.d. random variables representing the noise in the data. 4 Machine Learning for Quantitative Finance
Gaussian process A Gaussian process f(x) is a, possibly infinite, collection of random variables, any finite subset of it having a joint Gaussian distribution. Mean function: m(x) = E [ f(x) ] Kernel function: k(x, x ) = Cov(f(x), f(x )) = f(x) GP (m(x), k(x, x )) 5 Machine Learning for Quantitative Finance
Gaussian process If f(x) GP (0, k(x, x )), then f N (0, K(X, X)) where (X, f) = {(x i, f i ) i = 1,..., n} is a sample from f(x) and k(x 1, x 1 )... k(x 1, x n ) K(X, X) =..... k(x n, x 1 )... k(x n, x n ) 6 Machine Learning for Quantitative Finance
GPR: a Bayesian method Don t model the relation as one function, but as a distribution over functions. Procedure: 1 Start from a prior GP prior knowledge: smooth function, periodic function,... prior distribution over functions 2 Include observed data points 3 Compute a posterior GP 7 Machine Learning for Quantitative Finance
Posterior distribution Only consider functions that agree with the data. Take new inputs X, with corresponding (unknown) function values f Joint distribution of training outputs and function values: [ ] ( [ ]) y K(X, X) + σ 2 N 0, n I K(X, X ) K(X, X) K(X, X ) f 8 Machine Learning for Quantitative Finance
Posterior distribution Condition on the observations: ( ) f X, X, y N µ, Σ with µ = K(X, X) [ K(X, X) + σ 2 ni ] 1 y Σ = K(X, X ) K(X, X) [ K(X, X) + σ 2 ni ] 1 K(X, X ) 9 Machine Learning for Quantitative Finance
Kernel function Squared exponential kernel function ( x x k(x, x ) = σf 2 2 ) exp 2l 2 with hyperparameters σ f and l: σ 2 f = signal variance l = length-scale parameter Hyperparameters (including σ n ) are estimated from the training data, usually with MLE. 10 Machine Learning for Quantitative Finance
Mean function Often set to zero, but can be modelled using basis functions h(x). g(x) = f(x) + h(x) T β GP (h(x) T β, k(x, x )) where f(x) GP (0, k(x, x )) β should be estimated from the training data Common choice: h(x) = (1, x, x 2 ) 11 Machine Learning for Quantitative Finance
Application set-up Construct a training set: product, market and model parameters time-consuming method model price sample n random combinations x i compute n corresponding prices y i Fit a Gaussian process regression (GPR) model. Fast prediction of new model prices. 12 Machine Learning for Quantitative Finance
Pricing European call options Training set: Product/market VG Heston K [40%, 160%] σ [0.05, 0.45] κ [1.4, 2.6] T [11M, 1Y ] ν [0.55, 0.95] ρ [ 0.85, 0.55] r [1.5%, 2.5%] θ [ 0.35, 0.05] θ [0.45, 0.75] q [0%, 5%] η [0.01, 0.1] v 0 [0.01, 0.1] sample n values of each parameter calculate n FFT-based model prices 13 Machine Learning for Quantitative Finance
Pricing European call options Fit the GPR model K, T, r q, model parameters GPR FFT model price Construct a test set: Similarly as training set Slightly smaller parameter intervals 14 Machine Learning for Quantitative Finance
Out-of-sample prediction (a) Variance Gamma (b) Heston model trained on 10 000 points, tested on 100 000 points. 15 Machine Learning for Quantitative Finance
Performance summary VG Heston Size of training set 5000 10 000 20 000 5000 10 000 20 000 In-sample prediction MAE 0.0016 0.0017 0.0013 0.0036 0.0027 0.0033 AAE 2.5763e-04 1.9627e-04 1.4747e-04 5.2260e-04 4.0347e-04 3.4524e-04 Out-of-sample prediction MAE 0.0028 0.0022 0.0016 0.0060 0.0054 0.0048 AAE 2.2508e-04 1.6942e-04 1.2828e-04 5.8991e-04 4.4112e-04 3.6623e-04 Speed-up 30 15 7 40 20 10 with MAE = max { EC F F T (i) EC GP R(i), i = 1,..., n} AAE = 1 n EC F F T (i) EC GP R(i) n i=1 16 Machine Learning for Quantitative Finance
Pricing American options Put options with strike K and maturity T Use binomial tree model (daily steps) with volatility σ [0.05, 0.55] K, T, r, q, σ GPR binomial tree model price 17 Machine Learning for Quantitative Finance
Out-of-sample performance MAE 0.0086 AAE 9.1684e-04 Speed-up 70 model trained on 10 000 points, tested on 100 000 points. 18 Machine Learning for Quantitative Finance
Pricing barrier options Down-and-out barrier put options with barrier level H, strike K and maturity T with H [55%, 99%] Use Monte Carlo simulation, according to Heston s model H, K, T, r, q, GPR MC Heston κ, ρ, θ, η, v 0 model price 19 Machine Learning for Quantitative Finance
Out-of-sample performance MAE 0.0086 AAE 6.7386e-04 Speed-up 5850 model trained and tested on 10 000 points. 20 Machine Learning for Quantitative Finance
Conclusion Time-consuming pricing methods Gaussian process regression Matrix inversion Hyperparameter optimization Apply GPR on existing methods Speed-up of several orders of magnitude Some trade-off with accuracy 21 Machine Learning for Quantitative Finance
Thank you! More information: De Spiegeleer, J., Madan, D. B., Reyners, S. and Schoutens, W. (2018), Machine Learning for Quantitative Finance: Fast Derivative Pricing, Hedging and Fitting, Quantitative Finance, forthcoming. 22 Machine Learning for Quantitative Finance