Numerical Methods in Finance
Total Page:16
File Type:pdf, Size:1020Kb
NUMERICAL METHODS IN FINANCE Dr Antoine Jacquier wwwf.imperial.ac.uk/~ajacquie/ Department of Mathematics Imperial College London Spring Term 2016-2017 MSc in Mathematics and Finance This version: March 8, 2017 1 Contents 0.1 Some considerations on algorithms and convergence ................. 8 0.2 A concise introduction to arbitrage and option pricing ................ 10 0.2.1 European options ................................. 12 0.2.2 American options ................................. 13 0.2.3 Exotic options .................................. 13 1 Lattice (tree) methods 14 1.1 Binomial trees ...................................... 14 1.1.1 One-period binomial tree ............................ 14 1.1.2 Multi-period binomial tree ............................ 16 1.1.3 From discrete to continuous time ........................ 18 Kushner theorem for Markov chains ...................... 18 Reconciling the discrete and continuous time ................. 20 Examples of models ............................... 21 Convergence of CRR to the Black-Scholes model ............... 23 1.1.4 Adding dividends ................................. 29 1.2 Trinomial trees ...................................... 29 Boyle model .................................... 30 Kamrad-Ritchken model ............................. 31 1.3 Overture on stability analysis .............................. 33 2 Monte Carlo methods 35 2.1 Generating random variables .............................. 35 2.1.1 Uniform random number generator ....................... 35 Generating uniform random variables ..................... 35 2.1.2 Normally distributed random variables and correlation ............ 37 Convolution method ............................... 37 Box-Muller method ................................ 38 Correlated Gaussian random variables ..................... 39 2 2.1.3 General methods ................................. 41 2.2 Random paths simulation and option pricing ..................... 42 2.2.1 Simulation and estimation error ......................... 42 2.2.2 Variance reduction methods ........................... 45 2.2.3 Option pricing .................................. 48 2.2.4 Application: European down and out barrier option under Black-Scholes .. 49 2.2.5 Application: Bond pricing with the CIR model ................ 49 3 Finite difference methods for PDEs 53 3.1 Reminder on PDEs and the Black-Scholes heat equation ............... 53 3.1.1 Review of PDEs and their classification .................... 53 3.1.2 The Black-Scholes heat equation ........................ 56 Derivation of the Black-Scholes PDE ...................... 56 Reduction of the Black-Scholes PDE to the heat equation .......... 57 Direct solution of the heat equation ...................... 58 Separation of variables and Sturm-Liouville problems ............ 59 3.2 Digression: why are we interested in PDEs? ...................... 59 3.3 Discretisation schemes .................................. 60 3.3.1 Explicit scheme .................................. 62 3.3.2 Implicit scheme .................................. 64 3.3.3 Crank-Nicolson scheme ............................. 64 3.3.4 Generalisation to θ-schemes ........................... 66 A critique of the Crank-Nicolson scheme .................... 67 3.3.5 Exponentially fitted schemes .......................... 67 3.3.6 Multi-step schemes ................................ 68 3.3.7 Non-uniform grids ................................ 69 Direct approach ................................. 69 Coordinate transformation ........................... 69 3.3.8 Stability and convergence analysis ....................... 70 A Fourier transform approach .......................... 70 Application to θ-schemes ............................ 75 3.3.9 Convergence analysis via matrices ....................... 76 A crash course of matrix norms ......................... 76 Convergence analysis ............................... 78 3.4 PDEs for path-dependent options ............................ 82 3.4.1 The American case: Problem class ....................... 82 3.4.2 The Asian case .................................. 82 3 3.5 Solving general second-order linear parabolic partial differential equations ..... 83 3.5.1 Applications to θ-schemes ............................ 84 3.6 Two-dimensional PDEs ................................. 85 3.6.1 θ-schemes for the two-dimensional heat equation ............... 86 Explicit scheme .................................. 87 Implicit scheme .................................. 87 Crank-Nicolson .................................. 87 3.6.2 The ADI method ................................. 88 3.7 Divergence: solving one-dimensional PDEs via eigenfunction expansions ...... 90 3.8 Finite differences for PIDEs ............................... 90 3.8.1 A quick review of SDE with jumps ....................... 90 Poisson, Compound Poisson and L´evyprocesses ............... 90 Stochastic differential equation with jumps .................. 91 L´evyprocesses .................................. 91 3.8.2 The pricing PIDE ................................ 96 3.8.3 Finite differences ................................. 97 Truncating the integral ............................. 97 Finite difference schemes ............................ 98 A working example: the CGMY model ..................... 98 3.9 Numerical solution of systems of linear equations ................... 98 3.9.1 Gaussian elimination ............................... 98 3.9.2 LU decomposition ................................ 100 Solving the system ................................ 101 3.9.3 Cholesky decomposition ............................. 102 3.9.4 Banded matrices ................................. 102 3.9.5 Iterative methods ................................. 103 Jacobi iteration .................................. 104 Gauss-Seidel iteration .............................. 107 Successive Over Relaxation method (SOR) .................. 107 4 Fourier and integration methods 109 4.1 A primer on characteristic functions .......................... 109 4.1.1 Fourier transforms and their inverses ...................... 109 Reminder on Lp spaces ............................. 109 Fourier transforms on Schwartz space ..................... 109 Fourier transforms on L1(R) .......................... 112 4.1.2 Characteristic functions ............................. 114 4 4.1.3 Examples ..................................... 115 Black-Scholes ................................... 115 Poisson processes ................................. 115 Compound Poisson processes .......................... 115 Affine processes .................................. 116 4.2 Pricing using characteristic functions .......................... 117 4.2.1 The Black-Scholes formula revisited ...................... 117 4.2.2 Option pricing with characteristic functions .................. 119 A note on bond pricing ............................. 122 4.3 Pricing via saddlepoint approximation ......................... 123 4.3.1 The Lugannani-Rice approximation ...................... 123 The Gaussian base ................................ 123 Non-Gaussian bases ............................... 124 4.3.2 Pricing with the Lugannani-Rice approximation ................ 124 4.4 Numerical integration and quadrature methods .................... 125 4.4.1 A primer on polynomial interpolation ..................... 125 Lagrange polynomials .............................. 125 Interpolation error ................................ 127 Orthogonal polynomials ............................. 129 Interpolation via splines ............................. 133 4.4.2 Numerical integration via quadrature ..................... 135 Newton-Cotes formulae ............................. 135 Newton-Cotes integration error ......................... 136 Gaussian quadratures .............................. 138 Adaptive quadrature ............................... 141 Numerical integration example ......................... 141 4.4.3 Fast Fourier transform methods ......................... 142 The FFT algorithm ............................... 142 Application to option pricing .......................... 143 4.4.4 Fractional FFT methods ............................. 144 4.4.5 Sine / Cosine methods .............................. 146 Description of the method ............................ 146 Application to option pricing .......................... 147 5 Model calibration 149 5.1 Solving non-linear equations ............................... 150 5.1.1 Bisection method ................................. 151 5 6 5.1.2 Newton-Raphson method ............................ 151 5.1.3 The secant method ................................ 153 5.1.4 The fixed-point algorithm ............................ 153 5.2 Optimisation ....................................... 154 5.2.1 Unconstrained optimisation ........................... 154 5.2.2 Line search methods ............................... 157 5.2.3 Minimisation via the Newton method ..................... 160 5.2.4 Constrained optimisation ............................ 161 Lagrange multipliers ............................... 161 General theory .................................. 161 6 Linear programming and duality 163 6.1 Separation theorems ................................... 163 6.2 Linear Programming Duality .............................. 165 6.3 Application to the fundamental theorem of asset pricing ............... 166 6.4 Application to arbitrage detection ........................... 168 Application to Calls and Puts .......................... 170 6.5 Numerical methods for LP problems