Mathematical Modeling and Computation in Finance TTTThhhhiiiissss ppppaaaaggggeeee iiiinnnntttteeeennnnttttiiiioooonnnnaaaallllllllyyyy lllleeeefffftttt bbbbllllaaaannnnkkkk Mathematical Modeling and Computation in Finance with Exercises and Python and MATLAB computer codes Cornelis W Oosterlee Centrum Wiskunde & Informatica (CWI) & Delft University of Technology, The Netherlands Lech A Grzelak Delft University of Technology, The Netherlands World Scientific NEW JERSEY • LONDON • SINGAPORE • BEIJING • SHANGHAI • HONG KONG • TAIPEI • CHENNAI • TOKYO Published by World Scientific Publishing Europe Ltd. 57 Shelton Street, Covent Garden, London WC2H 9HE Head office: 5 Toh Tuck Link, Singapore 596224 USA office: 27 Warren Street, Suite 401-402, Hackensack, NJ 07601 Library of Congress Control Number: 2019950785 British Library Cataloguing-in-Publication Data A catalogue record for this book is available from the British Library. MATHEMATICAL MODELING AND COMPUTATION IN FINANCE With Exercises and Python and MATLAB Computer Codes Copyright © 2020 by Cornelis W. Oosterlee and Lech A. Grzelak All rights reserved. ISBN 978-1-78634-794-7 ISBN 978-1-78634-805-0 (pbk) For any available supplementary material, please visit https://www.worldscientific.com/worldscibooks/10.1142/Q0236#t=suppl Desk Editor: Shreya Gopi Typeset by Stallion Press Email: [email protected] Printed in Singapore Dedicated to Anasja, Wim, Mathijs, Wim en Agnes (Kees) Dedicated to my mum, brother, Anna and my whole family (Lech) TTTThhhhiiiissss ppppaaaaggggeeee iiiinnnntttteeeennnnttttiiiioooonnnnaaaallllllllyyyy lllleeeefffftttt bbbbllllaaaannnnkkkk Preface This book is discussing the interplay of stochastics (applied probability theory) and numerical analysis in the field of quantitative finance. The contents will be usefulforpeople workinginthe financialindustry, forthose aimingtowork there one day, and for anyone interested in quantitative finance. Stochastic processes, and stochastic differential equations of increasing com- plexity, are discussed for the various asset classes, reaching to the models that are in use at financial institutions. Only in exceptional cases, solutions to these stochastic differential equations are available in closed form. The typical models in use at financial institutions have changed over time. Basically, each time when the behavior of participants in financial markets changes, the corresponding stochastic mathematical models describing the prices maychangeaswell. Alsofinancialregulationwillplayitsroleinsuchchanges. In the book we therefore discuss a variety of models for stock prices, interest rates as well as foreign-exchange rates. A basic notion in such a diverse and varying field is “don’t fall in love with your favorite model”. Financial derivatives are products that are based on the performance of another, uncertain, underlying asset, like on stock, interest rate or FX prices. Next to the modeling of these products, they also have to be priced, and the risk related to selling these products needs to be assessed. Option valuation is also encountered in the financial industry during the calibration of the stochastic models of the asset prices (fitting the model parameters of the governing SDEs so that model and market values of options match), and also in risk management when dealing with counterparty credit risk. Advanced risk management consists nowadays of taking into account the risk thatacounterpartyofafinancialcontractmaydefault(CCR,CounterpartyCredit Risk). Because of this risk, fair values of option prices are adjusted, by means of the so-called Valuation Adjustments. We will also discuss the Credit Valuation Adjustment (CVA) in the context of risk management and derive the governing equations. vii viii Mathematical Modeling and Computation in Finance Option values are governed by partial differential equations, however, they can also be defined as expectations that need to be computed in an efficient, accurate and robust way. We are particularly interested in stochastic volatility basedmodels,withthewell-knownHestonmodelservingasthepointofreference. As the computational methods to value these financial derivatives, we present a Fourier-based pricing technique as well as the Monte Carlo pricing method. Whereas Fourier techniques are useful when pricing basic option contracts, like European options, within the calibration procedure, Monte Carlo methods are often used when more involved option contracts, or more involved asset price dynamics are being considered. Bygraduallyincreasingthecomplexityofthestochasticmodelsinthedifferent chapters of the book, we aim to present the mathematical tools for defining appropriatemodels, aswellasfortheefficientpricingofEuropeanoptions. From the equity models in the first 10 chapters, we move to short-rate and market interest rate models. We cast these models for the interest rate into the Heath- Jarrow-Morton framework, show relations between the different models, and we explain a few interest rate products and their pricing as well. It is sometimes useful to combine SDEs from different asset classes, like stock and interest rate, into a correlated set of SDEs, or, in other words, into a system ofSDEs. Wediscussthehybridassetpricemodelswithastochasticequitymodel and a stochastic interest rate model. Summarizing, the reader may encounter a variety of stochastic models, numerical valuation techniques, computational aspects, financial products and riskmanagementapplicationswhilereadingthisbook. Theaimistohelpreaders progress in the challenging field of computational finance. ThetopicsthatarediscussedarerelevantforMScandPhDstudents,academic researchers as well as for quants in the financial industry. We expect knowledge of applied probability theory (Brownian motion, Poisson process, martingales, Girsanov theorem,...), partial differential equations (heat equation, boundary conditions),familiaritywithiterativesolutionmethods,liketheNewton-Raphson method, and a basic notion of finance, assets, prices, options. Acknowledgment Here, wewouldliketoacknowledgedifferentpeoplefortheirhelpinbringingthis book project to a successful end. Firstofall,wewouldliketothankouremployersfortheirsupport,ourgroups at CWI — Center for Mathematics & Computer Science, in Amsterdam and at the Delft Institute of Applied Mathematics (DIAM), from the Delft University of Technology in the Netherlands. We thank our colleagues at the CWI, at DIAM, and at Rabobank for their friendliness. Particularly, Nada Mitrovic is acknowledged for all the help. Vital for us were the many fruitful discussions, cooperationsandinputfromourgroupmembers,likefromourPhDstudents,the post-docs and also the several guests in our groups. In particular, we thank our dear colleagues Peter Forsyth, Luis Ortiz Gracia, Mike Staunton, Carlos Vazquez, Andrea Pascucci, Yuying Li, and Karel in’t Hout for their insight and the discussions. Proofreadingwithdetailedpointersandsuggestionsforimprovementshasbeen very valuable for us and for this we would like to thank in particular Natalia Borovykh, TimDijkstra, ClarissaElli, IrfanIlgin, MarkoIskra, FabienLeFloc’h, Patrik Karlsson, Erik van Raaij, Sacha van Weeren, Felix Wolf and Thomas van der Zwaard. Wegotinspiredbythegroup’sPhDandpost-doctoralstudents, inalphabetic order, Kristoffer Andersson, Anastasia Borovykh, Ki Wai Chau, Bin Chen, Fei Cong, Fang Fang, Qian Feng, Andrea Fontanari, Xinzheng Huang, Shashi Jain, Prashant Kumar, Coen Leentvaar, Shuaiqiang Liu, Peiyao Luo, Marta Pou, Marjon Ruijter, Beatriz Salvador Mancho, Luis Souto, Anton van der Stoep, Maria Suarez, Bowen Zhang, Jing Zhao, and Hisham bin Zubair. We would like to thank Shreya Gopi, her team and Jane Sayers at World Scientific Publishing for the great cooperation. Our gratefulness to our families cannot be described in words. ix