You are previewing Quantitative Finance.
O'Reilly logo
Quantitative Finance

Book Description

Quantitative Finance: An Object-Oriented Approach in C++ provides readers with a foundation in the key methods and models of quantitative finance. Keeping the material as self-contained as possible, the author introduces computational finance with a focus on practical implementation in C++.

Through an approach based on C++ classes and templates, the text highlights the basic principles common to various methods and models while the algorithmic implementation guides readers to a more thorough, hands-on understanding. By moving beyond a purely theoretical treatment to the actual implementation of the models using C++, readers greatly enhance their career opportunities in the field.

The book also helps readers implement models in a trading or research environment. It presents recipes and extensible code building blocks for some of the most widespread methods in risk management and option pricing.

Web Resource
The author’s website provides fully functional C++ code, including additional C++ source files and examples. Although the code is used to illustrate concepts (not as a finished software product), it nevertheless compiles, runs, and deals with full, rather than toy, problems. The website also includes a suite of practical exercises for each chapter covering a range of difficulty levels and problem complexity.

Table of Contents

  1. Preliminaries
  2. Dedication
  3. Preface
    1. Disclaimer
  4. Acknowledgements
  5. Chapter 1 A brief review of the C++ programming language
    1. 1.1 Getting started
    2. 1.2 Procedural programming in C++
      1. 1.2.1 Built-in data types and the definition and declaration of variables
      2. 1.2.2 Statements, expressions and operators
      3. 1.2.3 Control flow
      4. 1.2.4 Functions
      5. 1.2.5 Dynamic memory allocation
    3. 1.3 Object–oriented features of C++
      1. 1.3.1 Classes
      2. 1.3.2 Composition and inheritance
      3. 1.3.3 Polymorphism
    4. 1.4 Templates
    5. 1.5 Exceptions
    6. 1.6 Namespaces
      1. Figure 1.1
      2. Figure 1.2
      1. Table 1.1
      2. Table 1.2
      3. Table 1.3
      4. Table 1.4
      1. Listing 1.1
      2. Listing 1.2
      3. Listing 1.3
      4. Listing 1.4
      5. Listing 1.5
      6. Listing 1.6
      7. Listing 1.7
      8. Listing 1.8
      9. Listing 1.9
      10. Listing 1.10
      11. Listing 1.11
  6. Chapter 2 Basic building blocks
    1. 2.1 The Standard Template Library (STL)
      1. 2.1.1 Mathematical functions
      2. 2.1.2 Complex numbers
      3. 2.1.3 Strings
      4. 2.1.4 Containers and iterators
      5. 2.1.5 The <algorithm> header
      6. 2.1.6 Streams
    2. 2.2 The Boost Libraries
      1. 2.2.1 Smart pointers
      2. 2.2.2 Functions
      3. 2.2.3 Probability distributions
    3. 2.3 Numerical arrays
      1. 2.3.1 Manipulating vectors, matrices and higher–dimensional arrays
      2. 2.3.2 Linear algebra
    4. 2.4 Numerical integration
      1. 2.4.1 Gaussian quadrature
      2. 2.4.2 Cubature
      3. 2.4.3 The multivariate normal distribution
    5. 2.5 Optimisation and root search
      1. 2.5.1 A simple bisection template
      2. 2.5.2 Newton/Raphson in multiple dimensions
      3. 2.5.3 Brent’s line search and Powell’s minimisation algorithm
    6. 2.6 The term structure of interest rates
      1. 2.6.1 Fixed income terminology
      2. 2.6.2 Term Structure Interpolation
      3. 2.6.3 Implementing interest rate term structures
      4. 2.6.4 Fitting the term structure to the market
      1. Figure 2.1
      2. Figure 2.2
      3. Figure 2.3
      4. Figure 2.4
      1. Table 2.1
      1. Listing 2.1
      2. Listing 2.2
      3. Listing 2.3
      4. Listing 2.4
      5. Listing 2.5
      6. Listing 2.6
      7. Listing 2.7
      8. Listing 2.8
      9. Listing 2.9
      10. Listing 2.10
      11. Listing 2.11
      12. Listing 2.12
      13. Listing 2.13
  7. Chapter 3 Lattice models for option pricing
    1. 3.1 Basic concepts of pricing by arbitrage
      1. 3.1.1 A simple example
      2. 3.1.2 The general single period case
    2. 3.2 Hedging and arbitrage–free pricing in a binomial lattice model
      1. 3.2.1 The one –period case
      2. 3.2.2 Binomial lattices
      3. 3.2.3 The binomial option pricing formula
      4. 3.2.4 Dividend –paying assets in the binomial model
    3. 3.3 Defining a general lattice model interface
    4. 3.4 Implementing binomial lattice models
    5. 3.5 Lattice models for the term structure of interest rates
      1. 3.5.1 General construction
      2. 3.5.2 Concrete models
      1. Figure 3.1
      2. Figure 3.2
      3. Figure 3.3
      4. Figure 3.4
      5. Figure 3.5
      6. Figure 3.6
      7. Figure 3.7
      8. Figure 3.8
      9. Figure 3.9
      10. Figure 3.10
      11. Figure 3.11
      12. Figure 3.12
      13. Figure 3.13
      14. Figure 3.14
      15. Figure 3.15
      1. Listing 3.1
      2. Listing 3.2
      3. Listing 3.3
      4. Listing 3.4
  8. Chapter 4 The Black/Scholes world
    1. 4.1 Martingales
    2. 4.2 Option pricing in continuous time
      1. 4.2.1 The Black/Scholes partial differential equation
      2. 4.2.2 The probabilistic approach
      3. 4.2.3 Time–varying interest rates and dividend yields
    3. 4.3 Exotic options with closed form solutions
      1. 4.3.1 M–Binaries and the “Quintessential Option Pricing Formula”
      2. 4.3.2 M–Binaries with exercise dimension one
      3. 4.3.3 M–Binaries with higher exercise dimensions
      4. 4.3.4 Options on maxima or minima
      5. 4.3.5 Continuous monitoring and the method of images
    4. 4.4 Implementation of closed form solutions
      1. 4.4.1 Representing the deterministic volatility of assets with Black/Scholes–type dynamics
      2. 4.4.2 Prices and hedge sensitivities of options with discrete event dates
    5. 4.5 American options
      1. 4.5.1 The Method of Barone-Adesi and Whaley
      2. 4.5.2 Geske and Johnson’s approximation using compound options
      1. Figure 4.1
      1. Table 4.1
      2. Table 4.2
      3. Table 4.3
      4. Table 4.4
      5. Table 4.5
      6. Table 4.6
      7. Table 4.7
      8. Table 4.8
      9. Table 4.9
      10. Table 4.10
      1. Listing 4.1
  9. Chapter 5 Finite difference methods for partial differential equations
    1. 5.1 The object-oriented interface
    2. 5.2 The explicit finite difference method
    3. 5.3 The implicit finite difference method
    4. 5.4 The Crank/Nicolson scheme
      1. Listing 5.1
      2. Listing 5.2
      3. Listing 5.3
      4. Listing 5.4
      5. Listing 5.5
      6. Listing 5.6
      7. Listing 5.7
  10. Chapter 6 Implied volatility and volatility smiles
    1. 6.1 Calculating implied distributions
    2. 6.2 Constructing an implied volatility surface
    3. 6.3 Stochastic volatility
      1. Figure 6.1
      1. Table 6.1
      2. Table 6.2
      1. Listing 6.1
      2. Listing 6.2
      3. Listing 6.3
      4. Listing 6.4
  11. Chapter 7 Monte Carlo simulation
    1. 7.1 Background
    2. 7.2 The generic Monte Carlo algorithm
    3. 7.3 Simulating asset price processes following geometric Brownian motion
    4. 7.4 Discretising stochastic differential equations
    5. 7.5 Predictor–Corrector methods
    6. 7.6 Variance reduction techniques
      1. 7.6.1 Antithetic sampling
      2. 7.6.2 Control variates
      3. 7.6.3 Optimal control variate weights
    7. 7.7 Pricing instruments with early exercise features
      1. 7.7.1 The regression–based algorithm
      2. 7.7.2 Implementation
    8. 7.8 Quasi-random Monte Carlo
      1. 7.8.1 Generating quasi–random sequences
      2. 7.8.2 Sobol’ sequence construction
      3. 7.8.3 Implementation of quasi–random Monte Carlo
      4. 7.8.4 Randomised quasi–random Monte Carlo
      1. Figure 7.1
      2. Figure 7.2
      3. Figure 7.3
      4. Figure 7.4
      5. Figure 7.5
      6. Figure 7.6
      7. Figure 7.7
      1. Table 7.1
      2. Table 7.2
      3. Table 7.3
      4. Table 7.4
      5. Table 7.5
      6. Table 7.6
      1. Listing 7.1
      2. Listing 7.2
      3. Listing 7.3
      4. Listing 7.4
      5. Listing 7.5
      6. Listing 7.6
      7. Listing 7.7
      8. Listing 7.8
      9. Listing 7.9
      10. Listing 7.10
      11. Listing 7.11
      12. Listing 7.12
      13. Listing 7.13
      14. Listing 7.14
      15. Listing 7.15
      16. Listing 7.16
      17. Listing 7.17
      18. Listing 7.18
      19. Listing 7.19
      20. Listing 7.20
      21. Listing 7.21
      22. Listing 7.22
      23. Listing 7.23
      24. Listing 7.24
      25. Listing 7.25
      26. Listing 7.26
      27. Listing 7.27
  12. Chapter 8 The Heath/Jarrow/Morton model
    1. 8.1 The model framework
    2. 8.2 Gauss/Markov HJM
      1. 8.2.1 Zero coupon bond prices — one –factor case
      2. 8.2.2 Zero coupon bond prices — multifactor case
    3. 8.3 Option pricing in the Gaussian HJM framework
      1. 8.3.1 Pricing a European call option on a zero coupon bond
      2. 8.3.2 Options on coupon bonds
      3. 8.3.3 Caps, floors and swaptions
    4. 8.4 Adding a foreign currency
      1. 8.4.1 Standard FX options
      2. 8.4.2 A “Quintessential Formula” in the multicurrency Gauss/Markov HJM model
    5. 8.5 Implementing closed–form solutions
    6. 8.6 Monte Carlo simulation in the HJM framework
      1. 8.6.1 Simulation of interest rate dynamics in a single currency
      2. 8.6.2 Joint simulation in several currencies
    7. 8.7 Implementing Monte Carlo simulation
      1. 8.7.1 Propagating the state variables and calculating the realisations of financial variables
      2. 8.7.2 Initialising the variance/covariance matrices and state variable drifts
      3. 8.7.3 Options with early exercise features
      1. Table 8.1
      2. Table 8.2
      3. Table 8.3
      1. Listing 8.1
      2. Listing 8.2
      3. Listing 8.3
      4. Listing 8.4
      5. Listing 8.5
      6. Listing 8.6
      7. Listing 8.7
      8. Listing 8.8
      9. Listing 8.9
  13. Appendix A Interfacing between C++ and Microsoft Excel
    1. A.1 The XLW project
    2. A.2 The QuantLib ObjectHandler
      1. Table A.1
      1. Listing A.1
      2. Listing A.2
      3. Listing A.3
      4. Listing A.4
      5. Listing A.5
      6. Listing A.6
      7. Listing A.7
      8. Listing A.8
      9. Listing A.9
  14. Appendix B Automatic generation of documentation using Doxygen
      1. Listing B.1
      2. Listing B.2
  15. References