Remarks on stochastic automatic adjoint differentiation and financial models calibration

Similar documents
2.1 Mathematical Basis: Risk-Neutral Pricing

Barrier Option. 2 of 33 3/13/2014

Computer Exercise 2 Simulation

Computational Finance. Computational Finance p. 1

Convergence Analysis of Monte Carlo Calibration of Financial Market Models

Computational Finance

Numerical schemes for SDEs

AD in Monte Carlo for finance

A distributed Laplace transform algorithm for European options

EFFICIENT MONTE CARLO ALGORITHM FOR PRICING BARRIER OPTIONS

Computer Exercise 2 Simulation

Pricing Variance Swaps under Stochastic Volatility Model with Regime Switching - Discrete Observations Case

Monte Carlo Simulations

A new approach for scenario generation in risk management

King s College London

Heston Stochastic Local Volatility Model

NAG for HPC in Finance

Risk Neutral Valuation

Fast Convergence of Regress-later Series Estimators

Fast and accurate pricing of discretely monitored barrier options by numerical path integration

Monte Carlo Methods for Uncertainty Quantification

The Use of Importance Sampling to Speed Up Stochastic Volatility Simulations

IEOR E4703: Monte-Carlo Simulation

Calibrating to Market Data Getting the Model into Shape

Algorithmic Differentiation of a GPU Accelerated Application

A No-Arbitrage Theorem for Uncertain Stock Model

Financial Mathematics and Supercomputing

Asset Pricing Models with Underlying Time-varying Lévy Processes

Cash Accumulation Strategy based on Optimal Replication of Random Claims with Ordinary Integrals

RISK-NEUTRAL VALUATION AND STATE SPACE FRAMEWORK. JEL Codes: C51, C61, C63, and G13

Optimal stopping problems for a Brownian motion with a disorder on a finite interval

Handbook of Financial Risk Management

Accelerated Option Pricing Multiple Scenarios

Domokos Vermes. Min Zhao

Monte Carlo Methods in Financial Engineering

F1 Acceleration for Montecarlo: financial algorithms on FPGA

Hedging with Life and General Insurance Products

"Pricing Exotic Options using Strong Convergence Properties

Monte Carlo Methods for Uncertainty Quantification

Math 416/516: Stochastic Simulation

Implementing Models in Quantitative Finance: Methods and Cases

On the Calibration of Stochastic Volatility Models: A Comparison Study

In physics and engineering education, Fermi problems

Reconfigurable Acceleration for Monte Carlo based Financial Simulation

arxiv: v2 [q-fin.cp] 22 Dec 2014

Callable Bond and Vaulation

Quasi-Monte Carlo for Finance

Simulating Stochastic Differential Equations

Calibration Lecture 4: LSV and Model Uncertainty

Puttable Bond and Vaulation

Modeling via Stochastic Processes in Finance

Interest Rate Bermudan Swaption Valuation and Risk

Smoking Adjoints: fast evaluation of Greeks in Monte Carlo calculations

FX Smile Modelling. 9 September September 9, 2008

Financial Risk Modeling on Low-power Accelerators: Experimental Performance Evaluation of TK1 with FPGA

arxiv: v1 [math.oc] 28 Jan 2019

MAFS Computational Methods for Pricing Structured Products

Math Computational Finance Option pricing using Brownian bridge and Stratified samlping

STOCHASTIC VOLATILITY AND OPTION PRICING

Introduction to Financial Mathematics

The Evaluation of American Compound Option Prices under Stochastic Volatility. Carl Chiarella and Boda Kang

Valuation of Equity / FX Instruments

DRAFT. 1 exercise in state (S, t), π(s, t) = 0 do not exercise in state (S, t) Review of the Risk Neutral Stock Dynamics

Stochastic Volatility (Working Draft I)

King s College London

An Asymptotic Expansion Formula for Up-and-Out Barrier Option Price under Stochastic Volatility Model

Pricing Early-exercise options

Numerics for SLV models in FX markets

American Option Pricing: A Simulated Approach

The Pennsylvania State University. The Graduate School. Department of Industrial Engineering AMERICAN-ASIAN OPTION PRICING BASED ON MONTE CARLO

Pricing Implied Volatility

Simple Robust Hedging with Nearby Contracts

Stochastic Grid Bundling Method

"Vibrato" Monte Carlo evaluation of Greeks

An Experimental Study of the Behaviour of the Proxel-Based Simulation Algorithm

Outline. GPU for Finance SciFinance SciFinance CUDA Risk Applications Testing. Conclusions. Monte Carlo PDE

From Discrete Time to Continuous Time Modeling

Recovery of time-dependent parameters of a Black- Scholes-type equation: an inverse Stieltjes moment approach

MASM006 UNIVERSITY OF EXETER SCHOOL OF ENGINEERING, COMPUTER SCIENCE AND MATHEMATICS MATHEMATICAL SCIENCES FINANCIAL MATHEMATICS.

NEWCASTLE UNIVERSITY SCHOOL OF MATHEMATICS, STATISTICS & PHYSICS SEMESTER 1 SPECIMEN 2 MAS3904. Stochastic Financial Modelling. Time allowed: 2 hours

Adjoint methods for option pricing, Greeks and calibration using PDEs and SDEs

An Asymptotic Expansion Formula for Up-and-Out Barrier Option Price under Stochastic Volatility Model

One-Factor Models { 1 Key features of one-factor (equilibrium) models: { All bond prices are a function of a single state variable, the short rate. {

Option Pricing Using Bayesian Neural Networks

UQ, STAT2201, 2017, Lectures 3 and 4 Unit 3 Probability Distributions.

Monte Carlo Simulation of a Two-Factor Stochastic Volatility Model

Stochastic Volatility

Math 623 (IOE 623), Winter 2008: Final exam

Chapter 2 Uncertainty Analysis and Sampling Techniques

Heinz W. Engl. Industrial Mathematics Institute Johannes Kepler Universität Linz, Austria

Lecture on advanced volatility models

arxiv:cond-mat/ v2 [cond-mat.str-el] 5 Nov 2002

Advanced Numerical Techniques for Financial Engineering

No-arbitrage theorem for multi-factor uncertain stock model with floating interest rate

AN IMPROVED BINOMIAL METHOD FOR PRICING ASIAN OPTIONS

OpenGamma Quantitative Research Algorithmic Differentiation in Finance: Root Finding and Least Square Calibration

Monte Carlo Methods in Finance

arxiv: v1 [math.pr] 15 Dec 2011

Interest Rate Cancelable Swap Valuation and Risk

A SIMPLE DERIVATION OF AND IMPROVEMENTS TO JAMSHIDIAN S AND ROGERS UPPER BOUND METHODS FOR BERMUDAN OPTIONS

Transcription:

arxiv:1901.04200v1 [q-fin.cp] 14 Jan 2019 Remarks on stochastic automatic adjoint differentiation and financial models calibration Dmitri Goloubentcev, Evgeny Lakshtanov Abstract In this work, we discuss the Automatic Adjoint Differentiation (AAD) for functions of the form G = 1 2 m 1 (Ey i C i ) 2, which often appear in the calibration of financial models. This helps to understand the algorithm proposed recently in [4] by C. Fries. He suggested to use the term Stochastic AAD in situations when expectation is an internal operation. We analyze this in detail and provide the cost estimate of the SAAD for the case when the AAD tool allows an automatic parallelization. Key words: Stochastic Automatic Adjoint Differentiation, automatic vectorization, model calibration, Single instruction multiple data For financial institutions, the model calibration is a routine day-to-day procedure. Although the Partial Differential Equation (PDE)-based techniques became quite popular e.g. [3, 7], practitioners more often use direct numeric simulations due to the simplicity of the technique. This led to the rapid development of the Automatic Differentiation and, in particular, Adjoint Automatic Differentiation (AAD) techniques during last 20 years [1, 2, 6]. The AAD got the wide acceptance in applications due to the following condition: If one has an algorithm for a function f : R n x R m y, then AAD maps each λ R m to the linear combinations of i f { λ f(x) }, i = 1...n (1) x i MathLogic LTD, London, UK., dmitri@matlogica.com CIDMA, Department ofmathematics, UniversityofAveiro,Aveiro3810-193,Portugal and MathLogic LTD, London, UK., lakshtanov@matlogica.com 1

the computation cost does not exceed that of f which is usually between 2 and 10 (depending on a specific AAD tool used). The utilization of parallel computations appears naturally in calculation of expectations since it assumes the numerous independent calculation of an integrand. Suppose that one needs to calculate the d Ey, the algorithm for dx the d y is first determined and then the average using parallel computations. dx From that point of view, the AD should avoid differentiate expectations. However, in case of the Adjoint AD, this approach becomes mandatory. The point is that the adjoint differentiation algorithm is not local (e.g. [2]) i.e. it requires analysis of the whole algorithm for f, thus the differentiation of expectation requires much more memory than taking expectation of the derivative. Some important problems involve computations that include an expectationas an intermediate operation. It is not a trivial question how one can use AAD and avoid differentiation of expectations. In a recent article [4], Fries suggest a general recipe for this problem (see Appendix). However, Fries did not provide the accurate analysis for the computational cost of the proposed algorithm. This work conducts a step-by-step computation of the following simple but important example. Consider a functional of the type G = 1 2 m (Ey i C i ) 2, (2) 1 where y i are random variables on a filtered probability space (Ω,Q,{F t }) and C i are some given target conditions, i = 1,...n. It is assumed that we are provided with a forward algorithm F : R M+N R m y, which calculates y i for a given set of M parameters and N independent random variables in frames of a time-discretization of the stochastic process. We assume that the AAD tool provides the algorithm R (so called reverse algorithm, e.g. [2]) which calculates the full set of derivatives (1) 1 We also assume that the AAD tool produces parallelized versions F v and R v. This means that F v (or R v ) provides the execution of F (or R) for c 1 it can be applied only after the F was launched. 2

independent sets of input data. For example, the natural value of c for the case of an AAD-tool tuned to the Intel AVX512 architecture is c = 8 Number of Cores. (3) Is noted that the first factor in (3) equals to 1 in all known to us C++ AAD tools. We consider the operations F F v and F R v as a simple way to parallelize calculations and we are interested to check if there is a way to use this tool effectively. CorrectioncoefficientsK F andk R aredefinedviathefollowingexpression Cost(F v ) = K F c Cost(F), Cost(R v) = K R Cost(F) (4) c andtheyreflectthequalityoftheaad tool. Ideally, K F = 1, butinpractice, the different software optimization and different hardware specifics can never make it perfect. One reason is that the executable version of F is produced with all compiler s optimization abilities turned On, including the ability SIMD vectorization. Some remarks on the Monte-Carlo simulations. We approximate expectations by number 1 of Paths Ey y(ω k ), number of Paths where the set {ω i } contains Monte-Carlo simulations of a given stochastic process and each ω i is a simulated sample path of sequences of random variables. It is assumed that drawings are Q-uniform. In particular,the cost of the independent evaluation for the set {Ey i,i = 1,...,m} is Cost({Ey}) = K F c k=1 number of Paths Cost(F). (5) Calculation of the gradient of G (introduced in (2)). For any parameter x j we get that ( m ) G = E (Ey i C i ) y i, j = 1,...,M. (6) x j x j i=1 It leads to the following algorithm : 3

1. Calculate Ey i using F v. The costs of this calculation is given by (5). 2. Fix a path ω. Using formula (1) for the vector λ with components λ i = Ey i C i we get the set { m } (Ey i C i ) y i(ω), j = 1...M x j i=1 Forcpaths, it costs (K F +K R )Cost(F) since foreach pathω thereverse algorithm can be executed only after the forward algorithm has been launched, unless execution results of the first step can be stored in the memory for each ω. In case memory usage is not constrained, the cost is K R Cost(F) 3. Summation over paths ω. To calculate the cost of this operation we take into account that the integrand should be calculated number of Paths times. Summarizing, we get the total cost Cost(G) = 2K F +K R c number of Paths Cost(F). (7) For C++, AAD-compiler produced by MathLogic LTD can be rewritten as Cost(G) = 2K F +K R number of Paths Cost(F). (8) 8 number of Cores where 8 reflects that the AVX512 architecture allows 8 doubles per vector register. Test on the Heston Stochastic Local Volatility model calibration. Consider the Heston SLV model given by a process ds t = µs t dt+ V t L(t,S t )S t dwt S, dv t = κ(θ V t )dt+ξ V t dwt V, dwt S dwt v = ρdt. Our implementation utilizes the standard Euler discretization (e.g. 3.4 of [5]) and European options in the quality of the y i,i =,...,m. The set of optimization parameters consists values of the piecewise constant Leverage function {L(t i,s j )} (where the set of interpolation nodes {t i,s j } is fixed) 4

and five standard Heston model parameters. We applied the AADC 2 by MathLogic LTD and observed the following values for coefficients K F and K R defined in (4). Cost(G) number of Paths Cost(F) N.Cores=1 K F /c K R /c AVX2 0.39 0.23 1.01 AVX512 0.23 0.12 0.58 Tests were executed on one core. The values of the aforementioned coefficients became almost constant when number of time intervals and number of optimization instruments m grow. As mentioned, all optimization parameters (like vectorization) were turned on while the evaluation of the Cost(F). Appendix. Expected Backward Automatic Differentiation Algorithm following [4]. Consider a scalar function y given by a sequence of operations: y := x N (9) x m := f m (x τm1,...,x τmi m ), 1 m < N. (10) where the number of variables i m is either 0 and it means that the x m is an independent variable or 1 i m < m. Evidently for function τ m we have 1 τ m < m. We assume that k th operator is an expectation operator and others f m,m k given by a closed-form 3. Sequentially, Initialise D N = 1 and D m = 0, m < N. For all m = N,N 1,...,1 (iterating backward through the operator list) for all j = τ m 1,...,τ m i m (iterating through the argument list) { f D j +D m m x D j = j, m k, D j +ED m, m = k. 2 C++ AAD-tool produced by matlogica.com 3 i.e. it can be evaluated in a finite number of the well-known operations, see e.g. wikipedia https://en.wikipedia.org/wiki/closed-form expression for the detailed definition. 5

Then, for all 1 i N E y x i = ED i. Acknowledgments. E.L. was partially supported by Portuguese funds through the CIDMA - Center for Research and Development in Mathematics and Applications and the Portuguese Foundation for Science and Technology ( FCT Fundção para a Ciência e a Tecnologia ), within project UID/MAT/ 0416/2019. References [1] Bartholomew-Biggs, M., Brown, S., Christianson, B., Dixon, L. (2000). Automatic differentiation of algorithms. Journal of Computational and Applied Mathematics, 124(1-2), 171-190. [2] Capriotti, L. (2011). Fast Greeks by algorithmic differentiation. The Journal of Computational Finance, 14(3), 3. [3] Crépey, S. (2003). Calibration of the local volatility in a generalized black scholes model using tikhonov regularization. SIAM Journal on Mathematical Analysis, 34(5), 1183-1206. [4] Christian P. Fries. Stochastic Automatic Differentiation: Automatic Differentiation for Monte-Carlo Simulations. In: SSRN (2017). DOI: 10.2139/ ssrn.2995695. [5] Glasserman, P. (2013). Monte Carlo methods in financial engineering (Vol. 53). Springer Science & Business Media. [6] Srajer, F., Kukelova, Z., Fitzgibbon, A. (2018). A benchmark of selected algorithmic differentiation tools on some problems in computer vision and machine learning. Optimization Methods and Software, 1-14. [7] Saporito, Y. F., Yang, X., Zubelli, J. P. (2017). The Calibration of Stochastic-Local Volatility Models-An Inverse Problem Perspective. arxiv preprint arxiv:1711.03023. 6