Modern Computational Finance
Description
An incisive and essential guide to building a complete system for derivative scripting
In Volume 2 of Modern Computational Finance Scripting for Derivatives and xVA, quantitative finance experts and practitioners Drs. Antoine Savine and Jesper Andreasen deliver an indispensable and insightful roadmap to the interrogation, aggregation, and manipulation of cash-flows in a variety of ways. The book demonstrates how to facilitate portfolio-wide risk assessment and regulatory calculations (like xVA).
Complete with a professional scripting library written in modern C++, this stand-alone volume walks readers through the construction of a comprehensive risk and valuation tool. This essential book also offers:
- Effective strategies for improving scripting libraries, from basic examples—like support for dates and vectors—to advanced improvements, including American Monte Carlo techniques
- Exploration of the concepts of fuzzy logic and risk sensitivities, including support for smoothing and condition domains
- Discussion of the application of scripting to xVA, complete with a full treatment of branching
Perfect for quantitative analysts, risk professionals, system developers, derivatives traders, and financial analysts, Modern Computational Finance Scripting for Derivatives and xVA: Volume 2 is also a must-read resource for students and teachers in master’s and PhD finance programs.
My Life in Script by Jesper Andreasen xi
Part I A Scripting Library in C++
Introduction 3
Chapter 1 Opening Remarks 7
Introduction 7
1.1 Scripting is not only for exotics 12
1.2 Scripting is for cash-flows not payoffs 13
1.3 Simulation models 15
1.4 Pre-processing 17
1.5 Visitors 19
1.6 Modern implementation in C++ 21
1.7 Script templates 22
Chapter 2 Expression Trees 25
2.1 In theory 25
2.2 In code 35
Chapter 3 Visitors 41
3.1 The visitor pattern 41
3.2 The debugger visitor 47
3.3 The variable indexer 50
3.4 Pre-processors 54
3.5 Const visitors 55
3.6 The evaluator 57
3.7 Communicating with models 65
Chapter 4 Putting Scripting Together with a Model 71
4.1 A simplistic Black-Scholes Monte-Carlo simulator 71
4.1.1 Random number generators 71
4.1.2 Simulation models 73
4.1.3 Simulation engines 76
4.2 Connecting the model to the scripting framework 76
Chapter 5 Core Extensions and the “Pays” Keyword 81
5.1 In theory 81
5.2 In code 83
Part II Basic Improvements
Introduction 93
Chapter 6 Past Evaluator 95
Chapter 7 Macros 97
Chapter 8 Schedules of Cash-Flows 99
Chapter 9 Support for Dates 105
Chapter 10 Predefined Schedules and Functions 109
Chapter 11 Support for Vectors 113
11.1 Basic functionality 113
11.2 Advanced functionality 115
11.2.1 New node types 116
11.2.2 Support in the parser 116
11.2.3 Processing 117
11.2.4 Evaluation 117
Part III Advanced Improvements Introduction 121
Chapter 12 Linear Products 123
12.1 Interest rates and swaps 123
12.2 Equities, foreign exchange, and commodities 125
12.3 Linear model implementation 126
Chapter 13 Fixed Income Instruments 127
13.1 Delayed payments 127
13.2 Discount factors 128
13.3 The simulated data processor 129
13.4 Indexing 129
13.5 Upgrading “pays” to support delayed payments 131
13.6 Annuities 132
13.7 Forward discount factors 132
13.8 Back to equities 132
13.9 Libor and rate fixings 133
13.10 Scripts for swaps and options 134
Chapter 14 Multiple Underlying Assets 137
14.1 Multiple assets 137
14.2 Multiple currencies 139
Chapter 15 American Monte-Carlo 143
15.1 Least Squares Method 143
15.2 One proxy 147
15.3 Additional regression variables 149
15.4 Feedback and exercise 149
15.5 Multiple exercise and recursion 152
Part IV Fuzzy Logic and Risk Sensitivities Introduction 157
Chapter 16 Risk Sensitivities with Monte-Carlo 161
16.1 Risk instabilities 161
16.2 Two approaches toward a solution 165
16.3 Smoothing for digitals and barriers 166
16.4 Smoothing for scripted transactions 168
Chapter 17 Support for Smoothing 169
Chapter 18 An Automated Smoothing Algorithm 175
18.1 Basic algorithm 176
18.2 Nested and combined conditions 179
18.3 Affected variables 179
18.4 Further optimization 180
Chapter 19 Fuzzy Logic 183
Chapter 20 Condition Domains 189
20.1 Fuzzy evaluation of discrete conditions 189
20.1.1 Condition domains 189
20.1.2 Constant conditions 190
20.1.3 Boolean conditions 191
20.1.4 Binary conditions 193
20.1.5 Discrete conditions 193
20.1.6 Putting it all together 197
20.2 Identification of condition domains 198
20.3 Constant expressions 201
Chapter 21 Limitations 203
21.1 Dead and alive 203
21.2 Non-linear use of fuzzy variables 206
Chapter 22 The Smoothing Factor 209
22.1 Scripting support 209
22.2 Automatic determination 211
Part V Application to xVA
Chapter 23 xVA 215
Chapter 24 Branching 219
Chapter 25 Closing Remarks 223
25.1 Script examples 223
25.2 Multi-threading and AAD 228
25.3 Advanced LSM optimizations 229
Appendix A Parsing 231
A.1 Preparing for parsing 231
A.2 Parsing statements 234
A.3 Recursively parsing conditions 238
A.4 Recursively parsing expressions 244
A.5 Performance 252
Bibliography 255
Index 257
“The Global Financial Crisis resulted in profound changes in quants’ Modus Operandi. This timely three-volume set describes some of the tools necessary to deal with these changes. Individual volumes cover in detail several important topics of interest to anyone who wants to stay au courant with modern developments in financial engineering. While the books are predominantly practically oriented, they strike a fine balance between theoretical and applied considerations. The authors are prominent practitioners and indisputable thought-leaders in the field. I recommend this set enthusiastically to anyone who wishes to understand the current and emerging trends in financial engineering.”
- Prof. Alexander Lipton, Founder and CEO, Stronghold Labs; Fellow, Connection Science and Engineering, Massachusetts Institute of Technology
ANTOINE SAVINE is a mathematician and derivatives practitioner with 25 years of leadership experience with global investment banks. He wrote the book on automatic adjoint differentiation (AAD) and co-developed Differential Machine Learning. He was also influential in volatility modeling and many areas of numerical and computational finance. Antoine works with Superfly Analytics at Danske Bank, winner of the 2019 Excellence in Risk Management and Modelling RiskMinds award. He holds a PhD in Mathematical Finance from Copenhagen University, where he teaches quantitative and computational finance.
Jesper Andreasen heads the Quantitative Research department at Saxo Bank. Over a 25 year long career he has held senior roles in quant departments of Bank of America, Nordea and General Re Financial Products, and he founded and headed the Superfly Analytics department at Danske Bank. Jesper co-received Risk magazine’s 2001 and 2012 Quant of the year awards and their In-House Risk System of the year award in 2015. He is an honorary professor of Mathematical Finance at Copenhagen University and completed his PhD in the same subject at Aarhus University in 1997.
The scripting of derivatives transactions has been a central feature of finance software since the 1990s. Most derivatives valuation and risk systems, both in-house and externally provided, include some form of feature scripting technology. Despite this, a significant gap exists in the existing literature regarding the application of scripting to derivatives and risk.
In Modern Computational Finance: Scripting for Derivatives and xVA, a team of distinguished finance professionals addresses this gap and delivers an extraordinary exposition of scripting for derivatives valuation. With a complete, professional scripting library written in modern C++, this volume demonstrates that scripting technology has much wider applications than what is typically assumed. It offers the strategies, concepts, and information required to construct a comprehensive risk and valuation tool.
In this stand-alone volume, the authors show how scripting offers a unique representation of financial transactions that enable finance practitioners to interrogate, aggregate, and manipulate cash-flows in several ways. This facilitates portfolio-wide risk assessment and regulatory calculations.
The book provides effective strategies for improving scripting libraries, from basic examples, like support for dates and vectors, to advanced concepts, like American Monte Carlo techniques. It also explores the concepts of fuzzy logic and risk sensitivities with support for smoothing and condition domains, as well as a complete and fulsome discussion of the application of scripting to xVA.
Ideal for quantitative analysts, risk professionals, system developers, derivatives traders, and financial analysts, Modern Computational Finance: Scripting for Derivatives and xVA, is also required reading for students in any of these fields seeking a definitive resource on derivative scripting.
PRAISE FOR MODERN COMPUTATIONAL FINANCE
“This book is an indispensable resource for any quant. ÂWritten by experts in the field and filled with practical examples and industry insights that are hard to find elsewhere, the book sets a new standard for computational finance.”
—Paul Glasserman, Jack R. Anderson Professor of Business, Columbia University
“The global financial crisis resulted in profound changes to quants’ Modus Operandi. Modern Computational Finance describes some of the tools necessary to deal with these changes. This book covers in detail several important topics of interest to anyone who wants to stay au Âcourant with modern developments in financial engineering. While the book is Âpredominantly practically oriented, it strikes a fine balance between theoretical and applied considerations. The authors are prominent practitioners and undisputed thought-leaders in the field. I recommend this book enthusiastically to anyone who wishes to understand the current and emerging trends in financial engineering.”
—Professor Alexander Lipton, Fellow, Connection Science and Engineering, Massachusetts Institute of Technology; Founder and CIO, Sila
“This is a new era that expects a new, expanded skill set from a new Âgeneration of quants. This is a new type of publication that combines words, mathematics, and code to offer a full picture for the generic, effective, practical development of modern financial libraries. The authors Âprovide the unique perspective of long-time leading derivatives practitioners. Brilliant.”
—Rolf Poulsen, Professor of Mathematical Finance, University of ÂCopenhagen
PUBLISHER:
Wiley
ISBN-13:
9781119540786
BINDING:
Hardback
BISAC:
COMPUTERS
BOOK DIMENSIONS:
Dimensions: 160.00(W) x Dimensions: 231.10(H) x Dimensions: 27.90(D)
AUDIENCE TYPE:
General/Adult
LANGUAGE:
English