Numerical Methods in Computational Finance - Daniel J. Duffy - E-Book

Numerical Methods in Computational Finance E-Book

Daniel J. Duffy

0,0
71,99 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

This book is a detailed and step-by-step introduction to the mathematical foundations of ordinary and partial differential equations, their approximation by the finite difference method and applications to computational finance. The book is structured so that it can be read by beginners, novices and expert users. Part A Mathematical Foundation for One-Factor Problems Chapters 1 to 7 introduce the mathematical and numerical analysis concepts that are needed to understand the finite difference method and its application to computational finance. Part B Mathematical Foundation for Two-Factor Problems Chapters 8 to 13 discuss a number of rigorous mathematical techniques relating to elliptic and parabolic partial differential equations in two space variables. In particular, we develop strategies to preprocess and modify a PDE before we approximate it by the finite difference method, thus avoiding ad-hoc and heuristic tricks. Part C The Foundations of the Finite Difference Method (FDM) Chapters 14 to 17 introduce the mathematical background to the finite difference method for initial boundary value problems for parabolic PDEs. It encapsulates all the background information to construct stable and accurate finite difference schemes. Part D Advanced Finite Difference Schemes for Two-Factor Problems Chapters 18 to 22 introduce a number of modern finite difference methods to approximate the solution of two factor partial differential equations. This is the only book we know of that discusses these methods in any detail. Part E Test Cases in Computational Finance Chapters 23 to 26 are concerned with applications based on previous chapters. We discuss finite difference schemes for a wide range of one-factor and two-factor problems. This book is suitable as an entry-level introduction as well as a detailed treatment of modern methods as used by industry quants and MSc/MFE students in finance. The topics have applications to numerical analysis, science and engineering. More on computational finance and the author's online courses, see www.datasim.nl.

Sie lesen das E-Book in den Legimi-Apps auf:

Android
iOS
von Legimi
zertifizierten E-Readern

Seitenzahl: 661

Veröffentlichungsjahr: 2022

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

Cover

Title Page

Copyright

Preface

Who Should Read this Book?

PART A: Mathematical Foundation for One-Factor Problems

CHAPTER 1: Real Analysis Foundations for this Book

1.1 INTRODUCTION AND OBJECTIVES

1.2 CONTINUOUS FUNCTIONS

1.3 DIFFERENTIAL CALCULUS

1.4 PARTIAL DERIVATIVES

1.5 FUNCTIONS AND IMPLICIT FORMS

1.6 METRIC SPACES AND CAUCHY SEQUENCES

1.7 SUMMARY AND CONCLUSIONS

CHAPTER 2: Ordinary Differential Equations (ODEs), Part 1

2.1 INTRODUCTION AND OBJECTIVES

2.2 BACKGROUND AND PROBLEM STATEMENT

2.3 DISCRETISATION OF INITIAL VALUE PROBLEMS: FUNDAMENTALS

2.4 SPECIAL SCHEMES

2.5 FOUNDATIONS OF DISCRETE TIME APPROXIMATIONS

2.6 STIFF ODEs

2.7 INTERMEZZO: EXPLICIT SOLUTIONS

2.8 SUMMARY AND CONCLUSIONS

CHAPTER 3: Ordinary Differential Equations (ODEs), Part 2

3.1 INTRODUCTION AND OBJECTIVES

3.2 EXISTENCE AND UNIQUENESS RESULTS

3.3 OTHER MODEL EXAMPLES

3.4 EXISTENCE THEOREMS FOR STOCHASTIC DIFFERENTIAL EQUATIONS (SDEs)

3.5 NUMERICAL METHODS FOR ODES

3.6 THE RICCATI EQUATION

3.7 MATRIX DIFFERENTIAL EQUATIONS

3.8 SUMMARY AND CONCLUSIONS

CHAPTER 4: An Introduction to Finite Dimensional Vector Spaces

4.1 SHORT INTRODUCTION AND OBJECTIVES

4.2 WHAT IS A VECTOR SPACE?

4.3 SUBSPACES

4.4 LINEAR INDEPENDENCE AND BASES

4.5 LINEAR TRANSFORMATIONS

4.6 SUMMARY AND CONCLUSIONS

CHAPTER 5: Guide to Matrix Theory and Numerical Linear Algebra

5.1 INTRODUCTION AND OBJECTIVES

5.2 FROM VECTOR SPACES TO MATRICES

5.3 INNER PRODUCT SPACES

5.4 FROM VECTOR SPACES TO MATRICES

5.5 FUNDAMENTAL MATRIX PROPERTIES

5.6 ESSENTIAL MATRIX TYPES

5.7 THE CAYLEY TRANSFORM

5.8 SUMMARY AND CONCLUSIONS

CHAPTER 6: Numerical Solutions of Boundary Value Problems

6.1 INTRODUCTION AND OBJECTIVES

6.2 AN INTRODUCTION TO NUMERICAL LINEAR ALGEBRA

6.3 DIRECT METHODS FOR LINEAR SYSTEMS

6.4 SOLVING TRIDIAGONAL SYSTEMS

6.5 TWO-POINT BOUNDARY VALUE PROBLEMS

6.6 ITERATIVE MATRIX SOLVERS

6.7 EXAMPLE: ITERATIVE SOLVERS FOR ELLIPTIC PDEs

6.8 SUMMARY AND CONCLUSIONS

CHAPTER 7: Black–Scholes Finite Differences for the Impatient

7.1 INTRODUCTION AND OBJECTIVES

7.2 THE BLACK–SCHOLES EQUATION: FULLY IMPLICIT AND CRANK–NICOLSON METHODS

7.3 THE BLACK–SCHOLES EQUATION: TRINOMIAL METHOD

7.4 THE HEAT EQUATION AND ALTERNATING DIRECTION EXPLICIT (ADE) METHOD

7.5 ADE FOR BLACK–SCHOLES: SOME TEST RESULTS

7.6 SUMMARY AND CONCLUSIONS

PART B: Mathematical Foundation for Two-Factor Problems

CHAPTER 8: Classifying and Transforming Partial Differential Equations

8.1 INTRODUCTION AND OBJECTIVES

8.2 BACKGROUND AND PROBLEM STATEMENT

8.3 INTRODUCTION TO ELLIPTIC EQUATIONS

8.4 CLASSIFICATION OF SECOND-ORDER EQUATIONS

8.5 EXAMPLES OF TWO-FACTOR MODELS FROM COMPUTATIONAL FINANCE

8.6 SUMMARY AND CONCLUSIONS

CHAPTER 9: Transforming Partial Differential Equations to a Bounded Domain

9.1 INTRODUCTION AND OBJECTIVES

9.2 THE DOMAIN IN WHICH A PDE IS DEFINED: PREAMBLE

9.3 OTHER EXAMPLES

9.4 HOTSPOTS

9.5 WHAT HAPPENED TO DOMAIN TRUNCATION?

9.6 ANOTHER WAY TO REMOVE MIXED DERIVATIVE TERMS

9.7 SUMMARY AND CONCLUSIONS

CHAPTER 10: Boundary Value Problems for Elliptic and Parabolic Partial Differential Equations

10.1 INTRODUCTION AND OBJECTIVES

10.2 NOTATION AND PREREQUISITES

10.3 THE LAPLACE EQUATION

10.4 PROPERTIES OF THE LAPLACE EQUATION

10.5 SOME ELLIPTIC BOUNDARY VALUE PROBLEMS

10.6 EXTENDED MAXIMUM-MINIMUM PRINCIPLES

10.7 SUMMARY AND CONCLUSIONS

CHAPTER 11: Fichera Theory, Energy Inequalities and Integral Relations

11.1 INTRODUCTION AND OBJECTIVES

11.2 BACKGROUND AND PROBLEM STATEMENT

11.3 WELL-POSED PROBLEMS AND ENERGY ESTIMATES

11.4 THE FICHERA THEORY: OVERVIEW

11.5 THE FICHERA THEORY: THE CORE BUSINESS

11.6 THE FICHERA THEORY: FURTHER EXAMPLES AND APPLICATIONS

11.7 SOME USEFUL THEOREMS

11.8 SUMMARY AND CONCLUSIONS

CHAPTER 12: An Introduction to Time-Dependent Partial Differential Equations

12.1 INTRODUCTION AND OBJECTIVES

12.2 NOTATION AND PREREQUISITES

12.3 PREAMBLE: SEPARATION OF VARIABLES FOR THE HEAT EQUATION

12.4 WELL-POSED PROBLEMS

12.5 VARIATIONS ON INITIAL BOUNDARY VALUE PROBLEM FOR THE HEAT EQUATION

12.6 MAXIMUM-MINIMUM PRINCIPLES FOR PARABOLIC PDES

12.7 PARABOLIC EQUATIONS WITH TIME-DEPENDENT BOUNDARIES

12.8 UNIQUENESS THEOREMS FOR BOUNDARY VALUE PROBLEMS IN TWO DIMENSIONS

12.9 SUMMARY AND CONCLUSIONS

CHAPTER 13: Stochastics Representations of PDEs and Applications

13.1 INTRODUCTION AND OBJECTIVES

13.2 BACKGROUND, REQUIREMENTS AND PROBLEM STATEMENT

13.3 AN OVERVIEW OF STOCHASTIC DIFFERENTIAL EQUATIONS (SDEs)

13.4 AN INTRODUCTION TO ONE-DIMENSIONAL RANDOM PROCESSES

13.5 AN INTRODUCTION TO THE NUMERICAL APPROXIMATION OF SDEs

13.6 PATH EVOLUTION AND MONTE CARLO OPTION PRICING

13.7 TWO-FACTOR PROBLEMS

13.8 THE ITO FORMULA

13.9 STOCHASTICS MEETS PDEs

13.10 FIRST EXIT-TIME PROBLEMS

13.11 SUMMARY AND CONCLUSIONS

PART C: The Foundations of the Finite Difference Method (FDM)

CHAPTER 14: Mathematical and Numerical Foundations of the Finite Difference Method, Part I

14.1 INTRODUCTION AND OBJECTIVES

14.2 NOTATION AND PREREQUISITES

14.3 WHAT IS THE FINITE DIFFERENCE METHOD, REALLY?

14.4 FOURIER ANALYSIS OF LINEAR PDES

14.5 DISCRETE FOURIER TRANSFORM

14.6 THEORETICAL CONSIDERATIONS

14.7 FIRST-ORDER PARTIAL DIFFERENTIAL EQUATIONS

14.8 SUMMARY AND CONCLUSIONS

CHAPTER 15: Mathematical and Numerical Foundations of the Finite Difference Method, Part II

15.1 INTRODUCTION AND OBJECTIVES

15.2 A SHORT HISTORY OF NUMERICAL METHODS FOR CDR EQUATIONS

15.3 EXPONENTIAL FITTING AND TIME-DEPENDENT CONVECTION-DIFFUSION

15.4 STABILITY AND CONVERGENCE ANALYSIS

15.5 SPECIAL LIMITING CASES

15.6 STABILITY FOR INITIAL BOUNDARY VALUE PROBLEMS

15.7 SEMI-DISCRETISATION FOR CONVECTION-DIFFUSION PROBLEMS

15.8 PADÉ MATRIX APPROXIMATION

15.9 TIME-DEPENDENT CONVECTION-DIFFUSION EQUATIONS

15.10 SUMMARY AND CONCLUSIONS

CHAPTER 16: Sensitivity Analysis, Option Greeks and Parameter Optimisation, Part I

16.1 INTRODUCTION AND OBJECTIVES

16.2 HELICOPTER VIEW OF SENSITIVITY ANALYSIS

16.3 BLACK–SCHOLES–MERTON GREEKS

16.4 DIVIDED DIFFERENCES

16.5 CUBIC SPLINE INTERPOLATION

16.6 SOME COMPLEX FUNCTION THEORY

16.7 THE COMPLEX STEP METHOD (CSM)

16.8 SUMMARY AND CONCLUSIONS

CHAPTER 17: Advanced Topics in Sensitivity Analysis

17.1 INTRODUCTION AND OBJECTIVES

17.2 EXAMPLES OF CSE

17.3 CSE AND BLACK–SCHOLES PDE

17.4 USING OPERATOR CALCULUS TO COMPUTE GREEKS

17.5 AN INTRODUCTION TO AUTOMATIC DIFFERENTIATION (AD) FOR THE IMPATIENT

17.6 DUAL NUMBERS

17.7 AUTOMATIC DIFFERENTIATION IN C++

17.8 SUMMARY AND CONCLUSIONS

PART D: Advanced Finite Difference Schemes for Two-Factor Problems

CHAPTER 18: Splitting Methods, Part I

18.1 INTRODUCTION AND OBJECTIVES

18.2 BACKGROUND AND HISTORY

18.3 NOTATION, PREREQUISITES AND MODEL PROBLEMS

18.4 MOTIVATION: TWO-DIMENSIONAL HEAT EQUATION

18.5 OTHER RELATED SCHEMES FOR THE HEAT EQUATION

18.6 BOUNDARY CONDITIONS

18.7 TWO-DIMENSIONAL CONVECTION PDEs

18.8 THREE-DIMENSIONAL PROBLEMS

18.9 THE HOPSCOTCH METHOD

18.10 SOFTWARE DESIGN AND IMPLEMENTATION GUIDELINES

18.11 THE FUTURE: CONVECTION-DIFFUSION EQUATIONS

18.12 SUMMARY AND CONCLUSIONS

CHAPTER 19: The Alternating Direction Explicit (ADE) Method

19.1 INTRODUCTION AND OBJECTIVES

19.2 BACKGROUND AND PROBLEM STATEMENT

19.3 GLOBAL OVERVIEW AND APPLICABILITY OF ADE

19.4 MOTIVATING EXAMPLES: ONE-DIMENSIONAL AND TWO-DIMENSIONAL DIFFUSION EQUATIONS

19.5 ADE FOR CONVECTION (ADVECTION) EQUATION

19.6 CONVECTION-DIFFUSION PDEs

19.7 ATTENTION POINTS WITH ADE

19.8 SUMMARY AND CONCLUSIONS

CHAPTER 20: The Method of Lines (MOL), Splitting and the Matrix Exponential

20.1 INTRODUCTION AND OBJECTIVES

20.2 NOTATION AND PREREQUISITES: THE EXPONENTIAL FUNCTION

20.3 THE EXPONENTIAL OF A MATRIX: ADVANCED TOPICS

20.4 MOTIVATION: ONE-DIMENSIONAL HEAT EQUATION

20.5 SEMI-LINEAR PROBLEMS

20.6 TEST CASE: DOUBLE-BARRIER OPTIONS

20.7 SUMMARY AND CONCLUSIONS

CHAPTER 21: Free and Moving Boundary Value Problems

21.1 INTRODUCTION AND OBJECTIVES

21.2 BACKGROUND, PROBLEM STATEMENT AND FORMULATIONS

21.3 NOTATION AND PREREQUISITES

21.4 SOME INITIAL EXAMPLES OF FREE AND MOVING BOUNDARY VALUE PROBLEMS

21.5 AN INTRODUCTION TO PARABOLIC VARIATIONAL INEQUALITIES

21.6 AN INTRODUCTION TO FRONT-FIXING

21.7 PYTHON CODE EXAMPLE: ADE FOR AMERICAN OPTION PRICING

21.8 SUMMARY AND CONCLUSIONS

CHAPTER 22: Splitting Methods, Part II

22.1 INTRODUCTION AND OBJECTIVES

22.2 BACKGROUND AND PROBLEM STATEMENT: THE ESSENCE OF SEQUENTIAL SPLITTING

22.3 NOTATION AND MATHEMATICAL FORMULATION

22.4 MATHEMATICAL FOUNDATIONS OF SPLITTING METHODS

22.5 SOME POPULAR SPLITTING METHODS

22.6 APPLICATIONS AND RELATIONSHIPS TO COMPUTATIONAL FINANCE

22.7 SOFTWARE DESIGN AND IMPLEMENTATION GUIDELINES

22.8 EXPERIENCE REPORT: COMPARING ADI AND SPLITTING

22.9 SUMMARY AND CONCLUSIONS

PART E: Test Cases in Computational Finance

CHAPTER 23: Multi-Asset Options

23.1 INTRODUCTION AND OBJECTIVES

23.2 BACKGROUND AND GOALS

23.3 THE BIVARIATE NORMAL DISTRIBUTION (BVN) AND ITS APPLICATIONS

23.4 PDE MODELS FOR MULTI-ASSET OPTION PROBLEMS: REQUIREMENTS AND DESIGN

23.5 AN OVERVIEW OF FINITE DIFFERENCE SCHEMES FOR MULTI-ASSET OPTION PROBLEMS

23.6 AMERICAN SPREAD OPTIONS

23.7 APPENDICES

23.8 SUMMARY AND CONCLUSIONS

CHAPTER 24: Asian (Average Value) Options

24.1 INTRODUCTION AND OBJECTIVES

24.2 BACKGROUND AND PROBLEM STATEMENT

24.3 PROTOTYPE PDE MODEL

24.4 THE MANY WAYS TO HANDLE THE CONVECTIVE TERM

24.5 ADE FOR ASIAN OPTIONS

24.6 ADI FOR ASIAN OPTIONS

24.7 SUMMARY AND CONCLUSIONS

CHAPTER 25: Interest Rate Models

25.1 INTRODUCTION AND OBJECTIVES

25.2 MAIN USE CASES

25.3 THE CIR MODEL

25.4 WELL-POSEDNESS OF THE CIRPDE MODEL

25.5 FINITE DIFFERENCE METHODS FOR THE CIR MODEL

25.6 HESTON MODEL AND THE FELLER CONDITION

25.7 SUMMARY AND CONCLUSION

CHAPTER 26: Epilogue Models Follow-Up Chapters 1 to 25

26.1 INTRODUCTION AND OBJECTIVES

26.2 MIXED DERIVATIVES AND MONOTONE SCHEMES

26.3 THE COMPLEX STEP METHOD (CSM) REVISITED

26.4 EXTENDING THE HULL–WHITE: POSSIBLE PROJECTS

26.5 SUMMARY AND CONCLUSIONS

Bibliography

Index

End User License Agreement

List of Tables

Chapter 7

TABLE 7.1 Accuracy of ADE, put option.

TABLE 7.2 Accuracy of ADE, call option.

TABLE 7.3 Stress-testing ADE, put option.

TABLE 7.4 Convection-dominated problems.

TABLE 7.5 Testing the CEV Model, (put option).

TABLE 7.6 Calculating sensitivities.

TABLE 7.7 Early exercise,

,

.

TABLE 7.8 Early exercise,

,

.

TABLE 7.9 Comparison of FDM methods.

TABLE 7.10 Implicit Euler, early exercise.

Chapter 16

TABLE 16.1 Output from steps 1–5; data is

.

List of Illustrations

Chapter 2

FIGURE 2.1 Continuous and discrete spaces.

Chapter 7

FIGURE 7.1 Stencil for fully implicit scheme.

FIGURE 7.2 Crank–Nicolson and fully explicit stencils.

FIGURE 7.3 Trinomial tree model.

FIGURE 7.4 Non-uniform mesh.

Chapter 11

FIGURE 11.1 Region and boundary.

FIGURE 11.2 Boundaries for Heston model

Chapter 12

FIGURE 12.1 Region of integration

D

.

Chapter 13

FIGURE 13.1 Mesh generation.

Chapter 14

FIGURE 14.1 Mesh in (

x, t

) space.

FIGURE 14.2 Special cases.

Chapter 15

FIGURE 15.1 Padé table for

.

Chapter 16

FIGURE 16.1 Motivating divided differences.

FIGURE 16.2 Region R and boundary curve C.

Chapter 17

FIGURE 17.1 Example with three variables.

FIGURE 17.2 Example with two variables.

Chapter 18

FIGURE 18.1 Hopscotch mesh point.

Chapter 19

FIGURE 19.1 Non-uniform mesh.

FIGURE 19.2 Visualisation of ADE process.

Chapter 20

FIGURE 20.1 Price profile.

FIGURE 20.2 Delta profile.

FIGURE 20.3 Gamma profile.

Chapter 22

FIGURE 22.1 Block diagram for software framework.

Chapter 23

FIGURE 23.1 Error handling and extreme values for the error functions.

FIGURE 23.2 Context diagram for Monte Carlo engine.

Chapter 25

FIGURE 25.1 Direction of information flow (two-dimensional case).

FIGURE 25.2 Approximation on the boundary.

Guide

Cover

Title Page

Copyright

Preface

Who Should Read this Book?

Table of Contents

Begin Reading

Bibliography

Index

End User License Agreement

Pages

ii

iii

iv

xix

xx

xxi

xxiii

1

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

129

130

131

132

133

134

135

136

137

138

139

140

141

143

144

145

146

147

148

149

150

151

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

256

257

258

259

260

261

262

263

264

265

266

267

268

269

270

271

272

273

274

275

276

277

278

279

280

281

282

283

284

285

286

287

288

289

290

291

292

293

294

295

296

297

298

299

300

301

302

303

305

306

307

308

309

310

311

312

313

314

315

316

317

318

319

321

323

324

325

326

327

328

329

330

331

332

333

334

335

336

337

338

339

340

341

342

343

344

345

346

347

348

349

350

351

352

353

354

355

356

357

358

359

360

361

362

363

364

365

366

367

368

369

370

371

372

373

374

375

376

377

378

379

380

381

382

383

384

385

387

388

389

390

391

392

393

394

395

396

397

398

399

400

401

402

403

404

405

407

408

409

410

411

412

413

414

415

416

417

418

419

420

421

423

425

426

427

428

429

430

431

432

433

434

435

436

437

438

439

440

441

442

443

444

445

447

448

449

450

451

452

453

454

455

456

457

458

459

461

462

463

464

465

466

467

468

469

470

471

472

473

474

475

477

478

479

480

481

482

483

484

485

486

487

488

489

490

491

492

493

494

495

497

498

499

500

501

502

503

504

505

506

507

508

509

510

511

512

513

514

515

516

517

518

519

520

521

Founded in 1807, John Wiley & Sons is the oldest independent publishing company in the United States. With offices in North America, Europe, Australia and Asia, Wiley is globally committed to developing and marketing print and electronic products and services for our customers' professional and personal knowledge and understanding.

The Wiley Finance series contains books written specifically for finance and investment professionals as well as sophisticated individual investors and their financial advisors. Book topics range from portfolio management to e-commerce, risk management, financial engineering, valuation and financial instrument analysis, as well as much more.

For a list of available titles, visit our Web site at www.WileyFinance.com.

Numerical Methods in Computational Finance

A Partial Differential Equation (PDE/FDM) Approach

 

 

DANIEL J. DUFFY

 

 

 

 

This edition first published 2022

Copyright © 2022 by John Wiley & Sons, Ltd.

Registered office

John Wiley & Sons Ltd, The Atrium, Southern Gate, Chichester, West Sussex, PO19 8SQ, United Kingdom

For details of our global editorial offices, for customer services and for information about how to apply for permission to reuse the copyright material in this book please see our website at www.wiley.com.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, except as permitted by the UK Copyright, Designs and Patents Act 1988, without the prior permission of the publisher. Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with standard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http://booksupport.wiley.com. For more information about Wiley products, visit www.wiley.com.

Designations used by companies to distinguish their products are often claimed as trademarks. All brand names and product names used in this book are trade names, service marks, trademarks or registered trademarks of their respective owners. The publisher is not associated with any product or vendor mentioned in this book.

Limit of Liability/Disclaimer of Warranty: While the publisher and author have used their best efforts in preparing this book, they make no representations or warranties with respect to the accuracy or completeness of the contents of this book and specifically disclaim any implied warranties of merchantability or fitness for a particular purpose. It is sold on the understanding that the publisher is not engaged in rendering professional services and neither the publisher nor the author shall be liable for damages arising here from. If professional advice or other expert assistance is required, the services of a competent professional should be sought.

Library of Congress Cataloging-in-Publication Data is Available:

ISBN 9781119719670 (Hardback)

ISBN 9781119719724 (ePub)

ISBN 9781119719694 (ePDF)

Cover Design: Wiley

Cover Image: © windesign/Shutterstock

Preface

This book is a detailed introduction to the mathematical theory and foundations of ordinary and partial differential equations, their approximation by the finite difference method and applications to computational finance.

Major benefits of the book are:

Step-by-step, incremental build-up of the material.

Examples and algorithms worked out in detail. Opportunity to modify the algorithms and extend them to your own applications.

Modern, state-of-the art numerical schemes for PDEs in finance.

Guidelines on C++ coding (C++11 to C++20); the book is the ideal companion to the author's book

Financial Instrument Pricing Using C++

(second edition, 2018).

The book is structured so that the material can be applied to a range of existing and new application areas.

We resolve a number of outstanding issues and improve several less-than-optimal numerical methods in finance.

We have divided the book into five parts, with each part addressing a single major issue.

Part A (Chapters 1 to 7) introduces the mathematical and numerical analysis concepts that are needed to understand the finite difference method and its application to computational finance. The main reason for writing the chapters is to make the book as self-contained as possible and to introduce and define standardised notation and results that we use in later chapters. Furthermore, the presented material can also be used as a standalone reference.

We realise that some readers will not be familiar with all of the building blocks that are needed to write finite difference schemes for the Black–Scholes PDE; for this reason, Part A was written to resolve this issue. We identify and discuss all the steps to design and implement a finite difference solver for one-factor finance PDEs. To this end, we take an incremental and single responsibility approach by focusing on one major topic in each chapter:

Initial value problems and boundary value problems and their numerical approximation.

Vector spaces, matrix theory and numerical linear algebra.

My first Crank–Nicolson and Alternating Direction Explicit (ADE) methods for the one-factor Black–Scholes PDE.

Finally, Chapter 1 is devoted to major concepts (such as continuity and differentiability) in real analysis that permeate the book, and for this reason it is important to understand them.

Part A can be used by readers with no prior knowledge of partial differential equations or the finite difference method. It can be used as a mini-course or mini-project to learn the material.

Part B (Chapters 8 to 13) discusses a number of rigorous mathematical techniques relating to boundary value problems and initial boundary value problems for elliptic and parabolic partial differential equations in two-space variables. The goal is to identify and elaborate the underlying theory to unambiguously specify these problems before mapping them to a numerical solution, thereby filling some ‘mathematical gaps’ in current practice. In particular, we develop strategies to preprocess and modify a PDE before we approximate it by the finite difference method, thus removing ad hoc and heuristic tricks that are often used to arrive at (hopefully) robust numerical schemes.

The chapters in this part fill a major gap in the application of PDE/FDM to finance. In general, most of the finance literature glosses over the niceties of analysing PDEs mathematically before approximating them using the finite difference method. The new approach resolves many of issues and heuristic approaches. Some new improvements for two-factor PDEs are:

Transform a PDE with a mixed derivative term to one in which this term has been removed (the

canonical PDE

).

Why domain transformation is better than domain truncation in general.

A rigorous set of mathematical techniques (Fichera theory, energy estimates) to discover the correct boundary conditions for finance problems.

The deep relationship between PDEs and stochastic differential equations (SDEs). We discuss formulations and results that are important in calibration applications.

Part B prepares the way for a seamless route from PDEs to robust and understandable finite difference schemes that approximate them. It eliminates much trial-and-error experimentation. In a sense the topics in Part B serve as a reference for the more hands-on topics in later chapters. At the very least, it is important to be aware of the main results.

Part C (Chapters 14 to 17) introduces the mathematical background to the finite difference method for initial boundary value problems for parabolic partial differential equations. It encapsulates in one place all the background information that is needed to construct stable and accurate finite difference schemes for time-dependent problems. The schemes will be applied to one-factor and two-factor finance PDEs in later chapters. The advantage is that the chapters discuss finite difference schemes for generic PDEs that can then be applied to finance PDEs. We also devote two dedicated chapters to Sensitivity Analysis, and we propose at least five methods to compute the derivatives of solutions of initial boundary value problems with respect to underlying parameters. In finance, these are sometimes called option greeks.

The chapters in this part discuss both new as well as established methods to gain a deep understanding of the foundations of the finite difference method and its applications to finance, and beyond:

Defining stability for initial value problems, consistency and the Lax Equivalence Theorem.

Modern stability analysis for initial boundary value problems : discrete maximum principle, convergence.

Six ways to compute sensitivities.

A compact introduction to complex analysis: the Complex Step Method (CSM).

A good working knowledge of the topics in Part C is essential in order to proceed in an effective manner.

Part D (Chapters 18 to 22) introduces a number of modern and popular finite difference methods (approximately six) to approximate the solution of initial boundary value problems for two-factor partial differential equations. To our knowledge, this is the only book that discusses these methods as well as their comparative strengths together with their applications to option pricing and hedging.

In this part we offer a number of robust and accurate schemes for a range of PDEs:

Soviet Splitting (Marchuk, Yanenko, Strang).

Alternating Direction Explicit (ADE) (Saul'yev)

Method of Lines (MOL).

Front-fixing and variational methods for free boundary value problems.

We lay the mathematical foundations of all splitting methods by introducing semi-group theory and generalised exponential functions. In short, these schemes in combination with the PDE preprocessing techniques in Part B open up a world beyond the perennial Crank–Nicolson and Alternating Direction Implicit (ADI) methods.

A good working knowledge of the algorithms in Part D is essential. In particular, the ability to program these algorithms (in C++ for obvious reasons) is ideal. Algorithms should work on paper and in the computer.

Part E (Chapters 23 to 26) is concerned with applications of the techniques from the first twenty-two chapters. We discuss finite difference schemes for one-factor and two-factor, stochastic volatility, and interest problems. We also revisit some earlier chapters with a view to examining them in even more detail or from new perspectives. Finally, we offer tips and guidelines on extending the results in this book to other finance problems.

This part uses most of the mathematical and numerical techniques of the first twenty-two chapters, and we apply them to a range of linear and nonlinear PDEs. For each problem, we can preprocess it using the techniques in Part B before deciding which numerical schemes from Part D to use. In particular, we scope the chapters by addressing the following problems and solutions:

Spread options with domain transformation with Yanenko, Predictor-Corrector and Marchuk two-cycle methods.

Asian option pricing using ADE. Clarification of some issues relating to boundary conditions. Modern ADI methods.

Interest rate models (CIR), Feller condition and energy inequalities. ADE method. Relationship with Heston model.

Monotone schemes (viscosity solution) for two-factor problems with mixed derivatives and applications to Uncertain Volatility Models (UVM).

One-factor and two-factor Hull–White models using ADE and MOL.

Who Should Read this Book?

This book has universal appeal because it is a focused and detailed introduction to the mathematical theory and foundations of ordinary and partial differential equations, their approximation by the finite difference method and subsequent applications to computational finance. It is suitable both as an entry-level introduction as well as a detailed treatment of modern methods as used by industry quants and MSc/MFE students in finance. The topics in the book have major applications to numerical analysis, science and engineering. In fact, most of the PDE/FDM methods have their origins in these fields.

For more information relating to computational finance, including links to resources and the author's online courses, please visit www.datasim.nl.

PART AMathematical Foundation for One-Factor Problems

CHAPTER 1Real Analysis Foundations for this Book

The beginner should not be discouraged if he finds he does not have the prerequisites for reading the prerequisites.

Paul Halmos

1.1 INTRODUCTION AND OBJECTIVES

In this chapter we introduce a number of mathematical concepts and methods that underlie many of the topics in this book. The most urgent attention points revolve around functions of real variables, their properties and the ways they are used in applications. We discuss the most important topics from real analysis to help us in our understanding of partial differential equations (PDEs). A definition of real analysis is:

In mathematics, real analysis is the branch of mathematical analysis that studies the behavior of real numbers, sequences and series of real numbers, and real functions. Some particular properties of real-valued sequences and functions that real analysis studies include convergence, limits, continuity, smoothness, differentiability and integrability.

Real analysis is distinguished from complex analysis, which deals with the study of complex numbers and their functions.

(Wikipedia)

A related branch of mathematics is calculus, which we learn at school:

Calculus, originally called infinitesimal calculus or ‘the calculus of infinitesimals’, is the mathematical study of continuous change, in the same way that geometry is the study of shape and algebra is the study of generalizations of arithmetic operations.

It has two major branches, differential calculus and integral calculus; the former concerns instantaneous rates of change, and the slopes of curves, while integral calculus concerns accumulation of quantities, and areas under or between curves. These two branches are related to each other by the fundamental theorem of calculus, and they make use of the fundamental notions of convergence of infinite sequences and infinite series to a well-defined limit.

(Wikipedia)

In practice, there is a distinction between calculus and real analysis. Calculus entails techniques (and tricks) to differentiate and integrate functions. It does not discuss the conditions under which a function is continuous or differentiable. It assumes that it is allowed to carry out these operations on functions. Real analysis, on the other hand, does discuss these issues and more; for example:

Continuous functions: How do we recognise them and prove that a function is continuous?

The different kinds of discontinuous functions.

Differential calculus from a real-analysis viewpoint.

Taylor's theorem.

An introduction to metric spaces and Cauchy sequences.

In our opinion, these topics are necessary prerequisites for the rest of this book.

Knowledge of vector (linear) analysis and numerical linear algebra is also a prerequisite for computational finance. To this end, we devote Chapters 4 and 5 to these topics. Finally, complex variables and complex functions (which are at the heart of complex analysis) are introduced in Chapter 16. We use the notation to mean ‘for all’ and to mean ‘there exists’.

1.2 CONTINUOUS FUNCTIONS

In this section we are mainly concerned with real-valued functions of a real variable, that is . In rough terms, a continuous function is one that can be drawn by hand without taking the pen from paper. In other words, a continuous function does not have jumps or breaks, but it is allowed to have sharp bends and kinks. Examples of continuous functions are:

(1.1)

We can see that these functions are continuous just by drawing them. The first function is ‘smoother’ than the second function, the latter being similar to a one-factor call or put payoff on the one hand and a Rectified Linear Unit (ReLU) activation function on the other hand (Goodfellow, Bengio and Courville (2016)). Intuitively, a function f is continuous if when , no matter how x approaches p. Alternatively, small changes in x lead to small changes in .

If we formally differentiate the above ReLU function (1.1), we get the famous discontinuous Heaviside function:

(1.2)

A discontinuous function is one that is not continuous. Another discontinuous function is:

Define ; let (integer).

Then taking left and right limits gives different answers, showing that the function is not continuous.

Thus .

1.2.1 Formal Definition of Continuity

The following definition is based on the fact that small changes in x lead to small changes in f (x).

Definition 1.1

Some properties of continuous functions f(x) and g(x) are:

1.2.2 An Example

It can be a mathematical challenge to prove that a function is continuous using the above ‘epsilon-delta’ approach in Definition 1.1. One approach is to use the well-known technique of splitting the problem into several mutually exclusive cases, solving each case separately and then merging the corresponding partial solutions to form the desired solution. To this end, let us examine the square root function:

(1.3)

We show that there exists such that for :

Then:

We now consider two cases:

Case 1 : 

. Then:

Choose .

Case 2:

. Then:

Hence:

Choose .

We have thus proved that the square root function is continuous.

1.2.3 Uniform Continuity

In general terms, uniform continuity guarantees that f (x) and f (y) can be made as close to each other as we please by requiring that x and y be sufficiently close to each other. This is in contrast to ordinary continuity, where the distance between f (x) and f (y) may depend on x and y themselves. In other words, in Definition 1.1 depends only on and not on the points in the domain. Continuity itself is a local property because a function f is or is not continuous at a particular point and continuity can be determined by looking at the values of the function in an arbitrary small neighbourhood of that point. Uniform continuity, on the other hand, is a global property of f because the definition refers to pairs of points rather than individual points. The new definition in this case for a function f defined in an interval I is:

Let us take an example of a uniformly continuous function:

(1.4)

Then

Choose .

In general, a continuous function on a closed interval is uniformly continuous. An example is:

(1.5)

Let . Then:

Choose .

 

An example of a function that is continuous and nowhere differentiable is the Weierstrass function that we can write as a Fourier series:

(1.6)

b is a positive odd integer and .

 

This is a jagged function that appears in models of Brownian motion. Each partial sum is continuous, and hence by the uniform limit theorem (which states that the uniform limit of any sequence of continuous functions is continuous), the series (1.6) is continuous.

1.2.4 Classes of Discontinuous Functions

A function that is not continuous at some point is said to be discontinuous at that point. For example, the Heaviside function (1.2) is not continuous at . In order to determine if a function is continuous at a point x in an interval (a, b) we apply the test:

There are two (simple discontinuity) main categories of discontinuous functions:

First kind

:

and

exists. Then either we have

or

.

Second kind

: a discontinuity that is not of the first kind.

Examples are:

You can check that this latter function has a discontinuity of the first kind at .

1.3 DIFFERENTIAL CALCULUS

The derivative of a function is one of its fundamental properties. It represents the rate of change of the slope of the function: in other words, how fast the function changes with respect to changes in the independent variable. We focus on real-valued functions of a real variable.

Let . Then the derivative of f at x (if it exists) is defined by the limit for :

(1.7)

This limit may not exist at certain points, and it is possible to define right-hand and left-hand limits, that is, one-sided derivatives.

Some results that we learn in high school are:

(1.8)

A composite function is a function that we can differentiate using the chain rule that we state as follows:

(1.9)

A simple example of use is:

More challenging examples of composite functions are:

1.3.1 Taylor's Theorem

Taylor's theorem allows us to expand a function as a series involving higher-order derivatives of a function. We take the Cauchy form (with exact remainder):

(1.10)

and:

We conclude with a discussion of the exponential function. It is the only function that is the same as its derivative. To see this, we use the formal definition (1.7) of a derivative (and noting that ):

We summarise some useful properties of the exponential function:

1.3.2 Big O and Little o Notation

For many applications we need a definition of the asymptotic behaviour of quantities such as functions and series; in particular we wish to find bounds on mathematical expressions and applications in computer science. To this end, we introduce the Landau symbols O and o.

Definition 1.2 (O-Notation).

An example is:

Definition 1.3 (O-Notation).

An example is:

We note that complexity analysis applies to both continuous and discrete functions.

1.4 PARTIAL DERIVATIVES

In general, we are interested in functions of two (or more) variables. We consider a function of the form:

The variables x and y can take values in a given bounded or unbounded interval. First, we say that f (x, y) is continuous at (a, b) if the limit:

exists and is equal to f (a, b). We now need definitions for the derivatives of f in the x and y directions.

In general, we calculate the partial derivatives by keeping one variable fixed and differentiating with respect to the other variable; for example:

We now discuss the situation when we introduce a change of variables into some problem and then wish to calculate the new partial derivatives. To this end, we start with the variables (x, y), and we define new variables (u, ). We can think of these as ‘original’ and ‘transformed’ coordinate axes, respectively. Now define the function z(u, ) as follows:

This can be seen as a function of a function. The result that we are interested in is the following: if z is a differentiable function of (u, ) and u, are themselves continuous functions of x, y, with partial derivatives, then the following rule holds:

(1.11)

This is a fundamental result that we shall apply in this chapter. We take a simple example of Equation (1.11) to show how things work. To this end, consider the Laplace equation in Cartesian geometry:

We now wish to transform this equation into an equation in a circular region defined by the polar coordinates:

The derivative in r is given by:

and you can check that the derivative with respect to is:

hence:

and:

Combining these results allows us to write Laplace's equation in polar coordinates as follows:

Thus, the original heat equation in Cartesian coordinates is transformed to a PDE of convection-diffusion type in polar coordinates.

We can find a solution to this problem using the Separation of Variables method, for example.

1.5 FUNCTIONS AND IMPLICIT FORMS

Some problems use functions of two variables that are written in the implicit form:

In this case we have an implicit relationship between the variables x and y. We assume that y is a function of x. The basic result for the differentiation of this implicit function is:

(1.12a)

or:

(1.12b)

We now use this result by posing the following problem. Consider the transformation:

and suppose we wish to transform back:

To this end, we examine the following differentials:

(1.13)

Let us assume that we wish to find dx and dy, given that all other quantities are known. Some arithmetic applied to Equation (1.13) (two equations in two unknowns!) results in:

where J is the Jacobian determinant defined by:

We can thus conclude the following result.

Theorem 1.1  The functions and exist if:

are continuous at (a, b) and if the Jacobian determinant is non-zero at (a, b).

Let us take the example:

You can check that the Jacobian is given by:

Solving for x and y gives:

You need to be comfortable with partial derivatives. A good reference is Widder (1989).

1.6 METRIC SPACES AND CAUCHY SEQUENCES

Section 1.6 may be skipped on a first reading without loss of continuity.

1.6.1 Metric Spaces

We work with sets and other mathematical structures in which it is possible to assign a so-called distance function or metric between any two of their elements. Let us suppose that X is a set, and let x, y and z be elements of X. Then a metric d on X is a non-negative real-valued function of two variables having the following properties:

The concept of distance is a generalisation of the difference between two real numbers or the distance between two points in n-dimensional Euclidean space, for example.

 

Having defined a metric d on a set X, we then say that the pair (X, d) is a metric space. We give some examples of metrics and metric spaces:

We define the set

X

of all continuous real-valued functions of one variable on the interval [

a

,

b

] (we denote this space by

C

[

a

,

b

])), and we define the metric:

Then (X, d) is a metric space.

n

-dimensional Euclidean space, consisting of vectors of real or complex numbers of the form:

with metric:

Let

be the space of all square-integrable functions on the interval [

a

,

b

]:

We can then define the distance between two functions f and g in this space by the metric:

This metric space is important in many branches of mathematics, including probability theory and stochastic calculus.

Let

X

be a non-empty set and let the metric

d

be defined by:

Then (

X

,

d

) is a metric space.

CHAPTER 2Ordinary Differential Equations (ODEs), Part 1

It is better to solve one problem five different ways, than to solve five problems one way.

George Pólya.

2.1 INTRODUCTION AND OBJECTIVES

In this chapter we introduce a class of differential equations in which the highest order derivative is one. Furthermore, these equations have a single independent variable (which in nearly all applications plays the role of time). In short, these are termed ordinary differential equations (ODEs) precisely because of the dependence on a single variable.

ODEs crop up in many application areas, such as mechanics, biology, engineering, dynamical systems, economics and finance, to name just a few. It is for this reason that we devote two dedicated chapters to them.

The following topics are discussed in this chapter:

Motivational examples of ODEs

Qualitative properties of ODEs

Common finite difference schemes for initial value problems for ODEs

Some theoretical foundations.

In Chapter 3 we continue with our discussion of ODEs, including code examples in C++ and Python.

2.2 BACKGROUND AND PROBLEM STATEMENT

In this section we introduce the very first differential equation of this book. It is a scalar first-order linear ordinary differential equation (ODE), and we shall analyse it from several qualitative and quantitative viewpoints.

Consider a bounded interval where . This interval could represent time or distance, for example. In most cases we shall view this interval as representing time values. In the interval we define the initial value problem (IVP) for an ODE:

(2.1)

where is a first-order linear differential operator involving the derivative with respect to the time variable and is a strictly positive function in . The term is called the inhomogeneous forcing term, and it is independent of . Finally, the solution to the IVP must be specified at ; this is the so-called initial condition.

In general, the problem (2.1) has a unique solution given by:

(2.2)

(See Hochstadt (1964), where the so-called integration factor is used to determine a solution.)

A special case of (2.1) is when the right-hand term is zero and is constant; in this case the solution becomes a simple exponential term without any integrals, and this will be used later when we examine difference schemes to determine their feasibility. In particular, a scheme that behaves badly for the above special case will be unsuitable for more general or more complex problems unless some modifications are introduced.

2.2.1 Qualitative Properties of the Solution and Maximum Principle

Before we introduce difference schemes for (2.1), we discuss a number of results that allow us to describe how the solution behaves. First, we wish to conclude that if the initial value and inhomogeneous term are positive, then the solution should also be positive for any value in . This so-called positivity or monotonicity result should be reflected in our difference schemes (not all schemes possess this property). Second, we wish to know how the solution grows or decreases as a function of time. The following two results deal with these issues.

Lemma 2.1 (Positivity).  Let the operator be defined in Equation (2.1), and let be a well-behaved function satisfying the inequalities:

Then the following result holds true:

Roughly speaking, this lemma states that you cannot get a negative solution from positive input.

You can verify it by examining Equation (2.2) because all terms are positive.

The following result gives bounds on the growth of .

Theorem 2.1  Let be the solution of Equation (2.1). Then:

This result states that the value of the solution is bounded by the input data. In other words, it is a well-posed problem.

We wish to replicate these properties in our difference schemes for Equation (2.1).

For completeness, we show the steps to be executed in order to produce the result in Equation (2.2).

(2.3)

Then from Equation (2.1) we see:

or:

Integrating this equation between and gives:

This style of mathematical analysis will be used in other contexts in this book, for example when transforming convection-diffusion-reaction equations (in particular, the Black–Scholes equation) to adjoint form.

2.2.2 Rationale and Generalisations

The IVP Equation (2.1) is a model for all the linear time-dependent differential equations that we encounter in this book. We no longer think in terms of scalar problems in which the functions in Equation (2.1) are scalar-valued, but we can view an ODE at different levels of abstraction. To this end, we focus on the generic homogeneous ODE with solution :

(2.4)

This equation subsumes several special cases:

The variable

is a square matrix, and then

Equation (2.4)

represents a system of ODEs. This is a very important area of research having many applications in science, engineering, and finance.

The variable

is an ordinary or partial differential operator, and then

Equation (2.4)

represents an ODE in a Hilbert or Banach space.

The variable

is a tridiagonal or block tridiagonal matrix that originates from a semi-discretisation in space of a time-dependent partial differential equation (PDE) using the Method of Lines (MOL) as discussed in

Chapter 20

.

The formal solution of

(2.4)

is:

(2.5)

In other words, we express the solution in terms of the exponential function of a matrix or of a differential operator. In the former case, there are many ways to compute the exponential of a matrix (see Moler and Van Loan (2003)).

The solution of

Equation (2.4)

can be simplified by

matrix

or

operator splitting

of the operator

:

(2.6)

For example, we can split a matrix into two simpler matrices, or we can split an operator into its convection and diffusion components. In other words, we solve Equation (2.4) as a sequence of simpler problems in (2.6). These topics will be discussed in Chapters 18, 22, and 23.

The initial value problem 

(2.1)

was originally used as a model test of finite difference methods in (Dahlquist (

1956

)). The resulting results and insights are helpful when dealing more complex IVPs.

Finally, this chapter and Chapter 3 are recommended for readers who may not be familiar with ODE theory and ODE numerics. It is a prerequisite before moving to partial differential equations.

2.3 DISCRETISATION OF INITIAL VALUE PROBLEMS: FUNDAMENTALS

We now discuss finding an approximate solution to Equation (2.1) using the finite difference method. We introduce several popular schemes as well as defining standardised notation.

The interval or range where the solution of Equation (2.1) is defined is . When approximating the solution using finite difference equations, we use a discrete set of points in where the discrete solution will be calculated. To this end, we divide into equal intervals of length , where is a positive number called the step size