Chapter 0 Goals of this Book and Global Overview

Monte Carlo Methods in Computational Finance

Design and Implementation in C++ (best title??)

What is this Book?

The main goal of this book is to apply the Monte Carlo method to the pricing and hedging of a range of financial instruments such as one-factor and multi-factor assets. We consider both path-independent and path-dependent cases and we discuss how to model instruments with European and American exercise features. Furthermore, we give an introduction on modelling credit derivatives and interest rate products.

This book discusses Monte Carlo simulation from a number of related and inter-dependent viewpoints. We describe the process in a nutshell: first, we are interested in pricing and hedging a range of financial instruments that depend on some underlying quantity. To this end, we describe the underlying quantity by a Stochastic Differential Equation (SDE) that we subsequently approximate using finite difference schemes. Second, we simulate the so-called paths a (large) number of times and then take the average of the values of these paths at the expiry date. Finally, we use these latter values in the payoff functions which we subsequently discount to give the desired price of the instrument.

This book is an attempt to integrate a number of methods and techniques in order to produce a working software system that is able to price and hedge financial instruments. We have tried to as rigorous as possible without repeating theorems and results that have been presented elsewhere. In general, we based the mathematical and finance theory on Glasserman 2004, Cont 2004 and Kloeden 1995 while many of the design blueprints were gleaned from Buschmann 1996, Gamma 1995 and Duffy 2004A. A special feature in the book is the mapping of mathematical structures and processes to C++ classes on the one and the application of design patterns to finance.

Why have we written this Book?

The authors wrote this book in order to show how it is possible to design and implement flexible and efficient C++ software systems that price and hedge a range of financial instruments using Monte Carlo simulation. We have attempted to create an understandable and seamless process, starting with a given financial model, then designing it using the well-known system and design patterns and then finally implementing these design using powerful object-oriented, generic and modular programming techniques that C++ offers.

We believe that this is the first book that discusses how to create well-designed and extendible Monte Carlo software systems using C++.

For whom is this book intended?

We have written this book for those finance professionals who design, develop and apply the Monte Carlo method to pricing a wide range of financial instruments. We assume that the reader has a working knowledge of financial modelling (for example, as discussed in Wilmott 2006 or Hull 2005) as well as hands-on experience of C++ (as discussed in Duffy 2006 and Duffy 2004). Using this book, you can define financial models and integrate then into the C++ software framework.

This book is also useful for MSc and PhD students in financial engineering and related disciplines. Finally, the book could function as a bridge between the IT and financed domains because it demonstrates how C++ code is produced from financial and mathematical models.

Why should I read this Book?

The Monte Carlo is one of the most important ? if not the most important ? numerical techniques for instrument pricing and hedging. The method is robust, is relatively easy to program and it can be used for a wide range of financial instruments. The main drawback of the method is speed of execution because very many simulated paths must be evaluated. A possible workaround is to design our applications in the knowledge that they will run in a high-performance environment (HPC) or to choose for a finite difference solution if response time is a major constraint.

Finally, C++ is the language of choice for many kinds of applications in finance and the combination of C++ and Monte Carlo is a very powerful one indeed. Having skills in these two areas will be an advantage when developing such applications.

The Structure of this Book

There are three major sections or parts in the book. Each part consists of a number of chapters which ? taken together ? deal with a specific aspect of the problems of modelling financial problems using he Monte Carlo method. Part I discusses all the mathematics and finance that are needed for an understanding of how to design and implement a Monte Carlo framework. In Part II we describe how to design a maintainable Monte Carlo engine using state-of-the-art design techniques while in Part III we devote a number of chapters to applications.

In order to keep the book as self-contained as possible we have included a number of chapters in Part IV on topics that support the material in the first three parts of the book:

Part I Financial and Mathematical Foundations

Chapter 1 The Monte Carlo Method in a Nutshell; from Model to C++ Code

Chapter 2 An Introduction to Stochastic Different Equations (SDE)

Chapter 3 Applying Stochastic Different Equations in Finance

Chapter 4 An Introduction to the Finite Difference Method (FDM) for SDE

Chapter 5 Applying the Finite Difference Method in Finance

Chapter 6 Modelling Payoffs and Financial Instruments

Chapter 7 The Foundations of the Monte Carlo Method

Part II Architectural and Detailed Design

Chapter 8 Architectures and Frameworks for Monte Carlo

Chapter 9 Coarse-grained System Patterns

Chapter 10 Combining Object-Oriented and Generic Programming Models

Chapter 11 Detailed Design using the GOF Patterns

Chapter 12 Data Structures and Application in the Framework

Chapter 13 Examples, Test Cases and Applications

Chapter 14 Customising and extending the Framework: the Scenarios

Part III Applications

Chapter 15 Applications involving time-dependent Volatility

Chapter 16 Asians, Barriers and other Path-dependent Problems

Chapter 17 One and two-Factor Stochastic Volatility Models

Chapter 18 Multi-Asset Models

Chapter 19 Early Exercise Features and Instrument Sensitivities

Chapter 20 Presentation, User Interaction and Interoperability

Part IV Supporting Material

Chapter 21 A Review of C++, Advanced Issues

Chapter 22 Statistical Distributions and Random Number Generation

Chapter 23 Mathematical Background for Monte Carlo

Chapter 24 An Introduction to Multi-threaded and Parallel Programming

Chapter 25 Monte Carlo Methods in OpenMP

Chapter 26: Comparing Monte Carlo with other Methods

What this Book does not cover

This book assumes some knowledge of finance; we assume that the reader knows what options and financial instruments are. We also assume that the reader has a working knowledge of C++. In particular, you should be familiar with the following topics:

Familiarity with the object-oriented and generic programming models

Familiarity with fundamental C++ syntax

C++ template classes and functions

Standard Template Library (STL)

Basic design pattern ?awareness?

We assume that the reader has C++ skills that correspond to the topics discussed in Duffy 2004 and Duffy 2006, for example.

Contact, Feedback and more Information

We hope that you enjoy this book as much as we have enjoyed working on it. For feedback, updates and reader questions concerning the book we have a dedicated web site www.datasimfinancial.com. Here you find a forum dedicated to MC and C++.

Good luck with Monte Carlo and C++!

The authors

Daniel J. Duffy

J?rg Kienitz