Computational Methods for Quantitative Finance

Similar documents
Lecture 4. Finite difference and finite element methods

1.1 Basic Financial Derivatives: Forward Contracts and Options

AMH4 - ADVANCED OPTION PRICING. Contents

MATH3075/3975 FINANCIAL MATHEMATICS TUTORIAL PROBLEMS

M5MF6. Advanced Methods in Derivatives Pricing

Option Pricing Models for European Options

MASM006 UNIVERSITY OF EXETER SCHOOL OF ENGINEERING, COMPUTER SCIENCE AND MATHEMATICS MATHEMATICAL SCIENCES FINANCIAL MATHEMATICS.

Binomial model: numerical algorithm

Lecture 3: Review of mathematical finance and derivative pricing models

From Discrete Time to Continuous Time Modeling

Chapter 3: Black-Scholes Equation and Its Numerical Evaluation

Computational Finance. Computational Finance p. 1

PDE Methods for the Maximum Drawdown

Economathematics. Problem Sheet 1. Zbigniew Palmowski. Ws 2 dw s = 1 t

Numerical schemes for SDEs

Lévy models in finance

Write legibly. Unreadable answers are worthless.

Math 416/516: Stochastic Simulation

Risk Neutral Valuation

MAFS Computational Methods for Pricing Structured Products

Stochastic Differential Equations in Finance and Monte Carlo Simulations

Pricing Barrier Options under Local Volatility

SPDE and portfolio choice (joint work with M. Musiela) Princeton University. Thaleia Zariphopoulou The University of Texas at Austin

IEOR E4703: Monte-Carlo Simulation

Chapter 5 Finite Difference Methods. Math6911 W07, HM Zhu

Path Dependent British Options

Risk Neutral Measures

MSc Financial Engineering CHRISTMAS ASSIGNMENT: MERTON S JUMP-DIFFUSION MODEL. To be handed in by monday January 28, 2013

MSC FINANCIAL ENGINEERING PRICING I, AUTUMN LECTURE 6: EXTENSIONS OF BLACK AND SCHOLES RAYMOND BRUMMELHUIS DEPARTMENT EMS BIRKBECK

Calibration Lecture 4: LSV and Model Uncertainty

Martingale Pricing Theory in Discrete-Time and Discrete-Space Models

Non-semimartingales in finance

Simulating Stochastic Differential Equations

SYSM 6304: Risk and Decision Analysis Lecture 6: Pricing and Hedging Financial Derivatives

FE610 Stochastic Calculus for Financial Engineers. Stevens Institute of Technology

Numerical Methods in Option Pricing (Part III)

Exercises for Mathematical Models of Financial Derivatives

King s College London

STOCHASTIC INTEGRALS

Monte Carlo Methods in Structuring and Derivatives Pricing

Lecture 11: Ito Calculus. Tuesday, October 23, 12

Definition Pricing Risk management Second generation barrier options. Barrier Options. Arfima Financial Solutions

Basic Concepts in Mathematical Finance

CRANK-NICOLSON SCHEME FOR ASIAN OPTION

( ) since this is the benefit of buying the asset at the strike price rather

Lecture Notes for Chapter 6. 1 Prototype model: a one-step binomial tree

6. Numerical methods for option pricing

Queens College, CUNY, Department of Computer Science Computational Finance CSCI 365 / 765 Fall 2017 Instructor: Dr. Sateesh Mane.

Numerical Methods for Stochastic Differential Equations with Applications to Finance

Stochastic Dynamical Systems and SDE s. An Informal Introduction

The British Russian Option

KØBENHAVNS UNIVERSITET (Blok 2, 2011/2012) Naturvidenskabelig kandidateksamen Continuous time finance (FinKont) TIME ALLOWED : 3 hours

Bluff Your Way Through Black-Scholes

FINANCIAL OPTION ANALYSIS HANDOUTS

Multi-Asset Options. A Numerical Study VILHELM NIKLASSON FRIDA TIVEDAL. Master s thesis in Engineering Mathematics and Computational Science

Continuous Time Finance. Tomas Björk

Project 1: Double Pendulum

Forward Monte-Carlo Scheme for PDEs: Multi-Type Marked Branching Diffusions

Stochastic Differential equations as applied to pricing of options

Hedging Credit Derivatives in Intensity Based Models

EFFICIENT MONTE CARLO ALGORITHM FOR PRICING BARRIER OPTIONS

2.1 Mathematical Basis: Risk-Neutral Pricing

In this lecture we will solve the final-value problem derived in the previous lecture 4, V (1) + rs = rv (t < T )

King s College London

Multiple Optimal Stopping Problems and Lookback Options

BIRKBECK (University of London) MSc EXAMINATION FOR INTERNAL STUDENTS MSc FINANCIAL ENGINEERING DEPARTMENT OF ECONOMICS, MATHEMATICS AND STATIS- TICS

The stochastic calculus

Short-time-to-expiry expansion for a digital European put option under the CEV model. November 1, 2017

Infinite Reload Options: Pricing and Analysis

CONVERGENCE OF OPTION REWARDS FOR MARKOV TYPE PRICE PROCESSES MODULATED BY STOCHASTIC INDICES

1 Mathematics in a Pill 1.1 PROBABILITY SPACE AND RANDOM VARIABLES. A probability triple P consists of the following components:

NEWCASTLE UNIVERSITY SCHOOL OF MATHEMATICS, STATISTICS & PHYSICS SEMESTER 1 SPECIMEN 2 MAS3904. Stochastic Financial Modelling. Time allowed: 2 hours

The Black-Scholes Equation

Financial derivatives exam Winter term 2014/2015

FINITE DIFFERENCE METHODS

CS 774 Project: Fall 2009 Version: November 27, 2009

RMSC 4005 Stochastic Calculus for Finance and Risk. 1 Exercises. (c) Let X = {X n } n=0 be a {F n }-supermartingale. Show that.

Sparse Wavelet Methods for Option Pricing under Lévy Stochastic Volatility models

Partial differential approach for continuous models. Closed form pricing formulas for discretely monitored models

Functional vs Banach space stochastic calculus & strong-viscosity solutions to semilinear parabolic path-dependent PDEs.

TEST OF BOUNDED LOG-NORMAL PROCESS FOR OPTIONS PRICING

Final Exam Key, JDEP 384H, Spring 2006

Lecture 8: The Black-Scholes theory

Monte Carlo Simulations

1 The continuous time limit

Tangent Lévy Models. Sergey Nadtochiy (joint work with René Carmona) Oxford-Man Institute of Quantitative Finance University of Oxford.

Analysis of the sensitivity to discrete dividends : A new approach for pricing vanillas

Stochastic Modelling in Finance

Lecture Note 8 of Bus 41202, Spring 2017: Stochastic Diffusion Equation & Option Pricing

Lecture 17. The model is parametrized by the time period, δt, and three fixed constant parameters, v, σ and the riskless rate r.

Local Volatility Dynamic Models

STOCHASTIC CALCULUS AND BLACK-SCHOLES MODEL

Application of an Interval Backward Finite Difference Method for Solving the One-Dimensional Heat Conduction Problem

Pricing of Barrier Options Using a Two-Volatility Model

An overview of some financial models using BSDE with enlarged filtrations

Drunken Birds, Brownian Motion, and Other Random Fun

The Black-Scholes PDE from Scratch

25857 Interest Rate Modelling

DRAFT. 1 exercise in state (S, t), π(s, t) = 0 do not exercise in state (S, t) Review of the Risk Neutral Stock Dynamics

Analysis of pricing American options on the maximum (minimum) of two risk assets

Transcription:

Preliminaries Pricing by binomial tree method Models, Algorithms, Numerical Analysis N. Hilber, C. Winter ETHZ-UNIZ Master of Advanced Studies in Finance Spring Term 2008

Scope of the course Preliminaries Pricing by binomial tree method Analysis and implementation of numerical methods for pricing options. Models: Black-Scholes, stochastic volatility, exponential Lévy. Options: European, American, Asian, barrier, compound... In this course: Focus on deterministic (PDE based) methods binomial and multinomial trees Finite Difference methods Finite Element methods This course will be continued by the course Monte Carlo methods in autumn 2008.

Preliminaries Pricing by binomial tree method Organization of the course 13 lectures (2 hours) + 12 exercise classes (1 hour). No lectures on March, 27. and May, 1. No exercise class on March, 25. Testat: 75% of solved homework assignments (theoretical exercises + MATLAB programming). Examination: On Thursday, May 29, 10 12. Written, closed-book examination includes theoretical and MATLAB programming problems. Examination takes place on ETH-workstations running MATLAB under LINUX. Own computer will NOT be required.

Preliminaries Pricing by binomial tree method Details of the course I Elementary Pricing 1. Pricing by binomial trees 2. Pricing by Finite Difference Solution of PDEs 3. American options 4. Barrier and Asian contracts II Pricing by Finite Element methods 5. Variational Formulation of BS model 6. Finite Element Methods for infinite horizon problems 7. Time stepping for finite horizon European vanillas 8. Finite horizon American contracts III Pricing in incomplete markets 9. Stochastic volatility models 10. Lévy models

Outline Preliminaries Pricing by binomial tree method Options Stochastic processes Black-Scholes model Preliminaries Options Stochastic processes Black-Scholes model Pricing by binomial tree method Binomial tree model Matlab implementation: Euro1.m Euro9.m

Definition Preliminaries Pricing by binomial tree method Options Stochastic processes Black-Scholes model An option is a contract which gives the right (but not the obligation) to buy or to sell a risky asset at a specified date T in the future (or within a specified period) at a specified price K. T : maturity or expiry date (after T the option is worthless) K: strike or exercise price Options are derivative contracts. Examples of underlying assets (or underlyings): stocks (shares of a company), indices (weighted means of several stocks), bonds, currencies, other options...

Preliminaries Pricing by binomial tree method Options Stochastic processes Black-Scholes model Examples Call: right to buy the underlying Put: right to sell the underlying Exercise styles European: exercise only at maturity T American: exercise at any date before the maturity T (the holder chooses when exercise the option) More complicated, exotic (as opposed to simple vanilla) options: Barrier: depend on particular asset price level(s) attained over a period Asian: depend on the average price of the underlying over a period Lookback: depend on the minimum or maximum asset price over a period ( path-dependent options)

Value of an option Preliminaries Pricing by binomial tree method Options Stochastic processes Black-Scholes model The right without obligations is not given for free: option has a value called premium (do not confuse with the exercise price K!) What is the fair price of an option? It depends on: Assumptions on the market Model for the underlying price Note: the price of standard liquid options is defined by the market (offer-demand equilibrium). Models are mostly needed for valuation of exotic options.

Preliminaries Pricing by binomial tree method Options Stochastic processes Black-Scholes model Modelling assumptions on the market There are no arbitrage opportunities: no gain without initial investment nor risk (no free lunch). There exists a riskless bank account with riskless continuously compounded interest rate r 0: time 0 t $ X e rt X Market is frictionless: there are no transaction costs, interest rates for lending and borrowing are equal, all securities and credits are available at any time and in any volume. All market participants have immediate access to any information; individual trading does not influence the price.

Payoff function Preliminaries Pricing by binomial tree method Options Stochastic processes Black-Scholes model The payoff of an option is its value at the time of exercise. The payoff is a function of the underlying price S at this time. Examples: Call: max(s K, 0) (S K) +. Put: max(k S, 0) (K S) +. Note: the payoff function can be obtained by no arbitrage argument. It does not depend on the model for the underlying price. On the contrary, to find values of the option before the exercise, we have to do some assumptions on the evolution of the asset price.

Preliminaries Pricing by binomial tree method Options Stochastic processes Black-Scholes model Stochastic modelling of the stock price Stock prices in the future are not known: they are modelled by stochastic processes. A stochastic process (S t ) t [0,T ] is a random function of t. Filtered probability space: (Ω, F, P, (F t ) t [0,T ] ). Ω: set of elementary events ω F: σ-algebra of all events (i.e. subsets of Ω) P: probability measure on F (F t ) t [0,T ] (filtration): increasing family of σ-algebras. F t represents the information available up to time t. (S t (ω)) t [0,T ] is a trajectory or sample path of the process.

Preliminaries Pricing by binomial tree method Important definitions Options Stochastic processes Black-Scholes model A stochastic process X is adapted (w.r.t. the filtration) if X t is F t -measurable (notation: X t F t ). It means that the value of X t is revealed at time t. X is a Markov process if, for any bdd Borel function f and s t, E[f(X s ) F t ] = E[f(X s ) X t ]: the future values of X do not depend on the past but only on the present value. An adapted process X is a martingale if (i) E[ X t ] < for all t 0 (ii) E[X s F t ] = X t, for all s t (the best prediction for future values is the present value). X is cadlag if its trajectories X t (ω) are almost surely right continuous and have left limits at all t [0, T ]. French: continu à droite, limite à gauche.

Preliminaries Pricing by binomial tree method Options Stochastic processes Black-Scholes model Brownian motion Normal distribution( N (µ, σ 2 ) has the density f(x) = 1 exp (x µ)2 2πσ 2 2σ 2 ). A stochastic process W is a Wiener process or Brownian motion if W 0 = 0 a.s. W has independent increments: for all t 1 t 2 t 3 t 4, W t4 W t3 W t2 W t1. increments of W are normally distributed: W t+s W t N (0, s). Properties: Wiener process is a Markov process and a martingale. W t N (0, t), E[W t ] = 0, Var W t = t. W has continuous paths.

Preliminaries Pricing by binomial tree method Black-Scholes model Options Stochastic processes Black-Scholes model In the Black-Scholes model, the stock price is given by S t = S 0 e (r σ2 /2)t+σW t where W t is a Brownian motion (under the risk-neutral probability). Risk-neutral means the discounted price e rt S t is a martingale. The value at time t T of a European option with maturity T and payoff H(S) is defined as Due to the Markov property, V t = e r(t t) E[H(S T ) F t ]. V t = V (S, t) = e r(t t) E[H(S T ) S t = S].

Preliminaries Pricing by binomial tree method Example: European call price Options Stochastic processes Black-Scholes model European Call: payoff function H(S) = (S K) +. Let X t = (r σ 2 /2)t + σw t. Call price at time t is: C(S, t) = e r(t t) E[(S T K) + S t = S] = e r(t t) E[(S 0 e X T K) + S t = S] = e r(t t) E[(S 0 e Xt+(X T X t) K) + S t = S] = e r(t t) E[(S t e (r σ2 /2)(T t)+σ(w T W t) K) + S t = S] = e r(t t) E[(Se (r σ2 /2)(T t)+σw T t K) + ] = E[(Se σ2 /2(T t)+σw T t Ke r(t t) ) + ] Let τ = T t (time to maturity). Since W τ N (0, τ), we obtain ) C(S, t) = (Se σ2 /2τ+σx Ke rτ 1 ) + exp ( x2 dx. 2πτ 2τ

Preliminaries Pricing by binomial tree method Options Stochastic processes Black-Scholes model Black-Scholes formula Calculation gives the Black-Scholes formula for European call price: C(S, t) = S N(d 1 ) Ke rτ N(d 2 ), τ = T t, d 1 = log(s/k) + (r + σ2 /2)τ σ, d 2 = d 1 σ τ τ where N(x) is the cumulative distribution function of N (0, 1): N(x) = x ) 1 exp ( y2 dy. 2π 2 Black-Scholes formula in Matlab: [Call, Put] = blsprice(s, K, r, τ, σ, DividendRate)

Preliminaries Pricing by binomial tree method Binomial tree model Matlab implementation: Euro1.m Euro9.m Outline Preliminaries Options Stochastic processes Black-Scholes model Pricing by binomial tree method Binomial tree model Matlab implementation: Euro1.m Euro9.m

Preliminaries Pricing by binomial tree method Binomial tree model Matlab implementation: Euro1.m Euro9.m Model setting We construct a simple discrete time model: M time steps: 0 = t 1 < t 2 < < t M < t M+1 = T, t i = (i 1) t, i = 1,..., M + 1, t = T/M. At each time step there are only two possibilities for the price: S Su with probability p or S Sd with probability 1 p, d < 1 < u. Parameters u, d, and p will be chosen such that the binomial model converges to the Black-Scholes model as M.

Preliminaries Pricing by binomial tree method Binomial tree model Matlab implementation: Euro1.m Euro9.m

Preliminaries Pricing by binomial tree method Binomial tree model Matlab implementation: Euro1.m Euro9.m Choice of parameters u, d, p We equate expectations and variances in binomial and BS models: Binomial BS model E[S i+1 S i ] ps i u + (1 p)s i d = S i e r t Var [S i+1 S i ] p(s i u) 2 + (1 p)(s i d) 2 (ps i u + (1 p)s i d) 2 = (S i ) 2 e 2r t (e σ2 t 1) To close the system we choose a third condition. For instance, ud = 1 (another popular choice is p = 1/2). Solving these equations yields: u = A + A 2 1, d = 1/u, p = er t d u d, where A = 1 2 (e r t + e (r+σ2 ) t ).

Preliminaries Pricing by binomial tree method Binomial tree model Matlab implementation: Euro1.m Euro9.m Option valuation using the binomial tree Forward phase: initializing the tree Starting from S 1 1 = S we can find all nodes Si n, i = 2,..., M + 1, n = 1,..., i of the tree. Backward phase: calculating the option values The values of the option at t M+1 = T are given by the payoff: V M+1 n = H(S M+1 n ) We use the martingale property of the discounted option price: which leads to V i = e r t E[V i+1 V i ] Vn i = e r t (pvn+1 i+1 i+1 + (1 p)vn ) So, we can go back through the tree to find V 1 1 = V (0, S).

Preliminaries Pricing by binomial tree method Binomial tree model Matlab implementation: Euro1.m Euro9.m % EURO1 Binomial method for a European Put. % Unvectorized version. W = zeros(m+1,1); W(1) = S; % Asset prices at time T for i = 1:M for n = i:-1:1 W(n+1) = u*w(n); end W(1) = d*w(1); end % Option values at time T for n = 1:M+1 W(n) = max(k-w(n),0); end % Re-trace to get option value at time zero for i = M:-1:1 for n = 1:i W(n) = exp(-r*dt)*(p*w(n+1) + (1-p)*W(n)); end end disp( Option value is ), disp(w(1))

Preliminaries Pricing by binomial tree method Binomial tree model Matlab implementation: Euro1.m Euro9.m Avoid nested pair of for loops, which requires O(M 2 ) operations. Use instead S M+1 n = d M+1 n u n 1 S, 1 n M + 1. % EURO2 Binomial method for a European Put. % Initial tree computation improved. W = zeros(m+1,1); % Asset prices at time T for n = 1:M+1 W(n) = S*(d^(M+1-n))*(u^(n-1)); end % Option values at time T for n = 1:M+1 W(n) = max(k-w(n),0); end % Re-trace to get option value at time zero for i = M:-1:1 for n = 1:i W(n) = exp(-r*dt)*(p*w(n+1) + (1-p)*W(n)); end end disp( Option value is ), disp(w(1))

Preliminaries Pricing by binomial tree method Binomial tree model Matlab implementation: Euro1.m Euro9.m Eliminate the first two for loops by elementwise operations on vectors. % EURO3 Binomial method for a European Put. % Partially vectorized version. % Option values at time T W = max(k-s*d.^([m:-1:0] ).*u.^([0:m] ),0); % Re-trace to get option value at time zero for i = M:-1:1 for n = 1:i W(n) = exp(-r*dt)*(p*w(n+1) + (1-p)*W(n)); end end disp( Option value is ), disp(w(1))

Preliminaries Pricing by binomial tree method Binomial tree model Matlab implementation: Euro1.m Euro9.m Remove unnecessary computations. The scaling factor e r t in each time step can be accumulated into e rt. Precompute 1 p as q. % EURO4 Binomial method for a European Put. % Partially vectorized version. % Redundant scaling removed. % Option values at time T W = max(k-s*d.^([m:-1:0] ).*u.^([0:m] ),0); % Re-trace to get option value at time zero q = 1-p; for i = M:-1:1 for n = 1:i W(n) = p*w(n+1) + q*w(n); end end W(1) = exp(-r*t)*w(1); disp( Option value is ), disp(w(1))

Preliminaries Pricing by binomial tree method Binomial tree model Matlab implementation: Euro1.m Euro9.m The final O(M 2 ) loop is still dominating. Remove one for loop by working directly with arrays rather than scalars. % EURO5 Binomial method for a European Put. % Vectorized version, uses shifts via colon notation. % Option values at time T W = max(k-s*d.^([m:-1:0] ).*u.^([0:m] ),0); % Re-trace to get option value at time zero q = 1-p; for i = M:-1:1 W = p*w(2:i+1) + q*w(1:i); end W = exp(-r*t)*w; disp( Option value is ), disp(w) value = W;

Preliminaries Pricing by binomial tree method Binomial tree model Matlab implementation: Euro1.m Euro9.m Use the binomial expansion M+1 V1 1 = e rt Ck 1 M pk 1 (1 p) M+1 k V M+1 k, Ck N = N! k!(n k)!. k=1 % EURO6 Binomial method for a European Put. % Uses explicit solution based on binomial expansion. % Unvectorized, subject to overflow. % Option values at time T W = max(k-s*d.^([m:-1:0] ).*u.^([0:m] ),0); % Binomial coefficients v = zeros(m+1,1); for k = 1:M+1 v(k) = nchoosek(m,k-1); end value = exp(-r*t)*sum(v.*(p.^([0:m] )).*((1-p).^([M:-1:0] )).*W) ; disp( Option value is ), disp(value)

Preliminaries Pricing by binomial tree method Binomial tree model Matlab implementation: Euro1.m Euro9.m Individual coefficients Ck N take on some extremely large values: the largest element in v is of order 10 75! rounding errors may arise. Compute V1 1 = M+1 k=1 a kv M+1 k. The coefficients a k satisfy the following recurrence a k = p 1 p M k + 2 a k 1, k 1 Vectorize the computation of v using cumprod. a 1 = (1 p) M % EURO7 Binomial method for a European Put. % Uses explicit solution based on binomial expansion. % Vectorized, subject to underflow. % Option values at time T W = max(k-s*d.^([m:-1:0] ).*u.^([0:m] ),0); % Recursion for coefficients a = cumprod([(1-p)^m,(p/(1-p))*[m:-1:1]./[1:m]]); value = exp(-r*t)*sum(a.*w); disp( Option value is ), disp(value)

Preliminaries Pricing by binomial tree method Binomial tree model Matlab implementation: Euro1.m Euro9.m The first element in a is (1 p) M. If this value drops below 10 325 which is Matlab s realmin*eps threshold, then it underflows to zero. To overcom this underflow problem use logarithms: log(a k ) = M k 1 M k+1 log(i) log(i) log(i) i=1 i=1 i=1 +(k 1) log(p) + (M + 1 k) log(1 p). % EURO8 Binomial method for a European Put. % Uses explicit solution based on binomial expansion. % Vectorized and based on logs to avoid overflow. % Option values at time T W = max(k-s*d.^([m:-1:0] ).*u.^([0:m] ),0); % log/cumsum version csl = cumsum(log([1;[1:m] ])); tmp = csl(m+1) - csl - csl(m+1:-1:1) + log(p)*([0:m] ) + log(1-p)*([m:-1:0] ); value = exp(-r*t)*sum(exp(tmp).*w); disp( Option value is ), disp(value)

Preliminaries Pricing by binomial tree method Binomial tree model Matlab implementation: Euro1.m Euro9.m Certain terms in V1 1 = e rt M+1 k=1 CM k 1 pk 1 (1 p) M+1 k V M+1 k are predictably zero: z {1,..., M + 1} such that V M+1 k = 0, z + 1 k M + 1. % EURO9 Binomial method for a European Put. % Uses explicit solution based on binomial expansion. % Vectorized, based on logs to avoid overflow, and avoids computing with zeros. % cut-off index z = max(1,min(m+1,floor( log((e*u)/(s*d^(m+1)))/(log(u/d)) ))); % Option values at time T W = K - S*d.^([M:-1:M-z+1] ).*u.^([0:z-1] ); % log/cumsum version using cut-off index z tmp1 = cumsum(log([1;[m:-1:m-z+2] ])) - cumsum(log([1;[1:z-1] ])); tmp2 = tmp1 + log(p)*([0:z-1] ) + log(1-p)*([m:-1:m-z+1] ); value = exp(-r*t)*sum(exp(tmp2).*w); disp( Option value is ), disp(value)

Preliminaries Pricing by binomial tree method Binomial tree model Matlab implementation: Euro1.m Euro9.m Reference: Desmond J. Higham, Nine Ways to Implement the Binomial Method for Option Valuation in MATLAB, SIAM Review, 2002. (See lecture web site for the link on this paper and accompanying Matlab files)

Preliminaries Pricing by binomial tree method Binomial tree model Matlab implementation: Euro1.m Euro9.m Improving execution time in Matlab Some useful general rules: Eliminate redundant computations (e.g. precompute a constant expression if it is used many times); Avoid for loops; Work directly on entire arrays or subarrays instead of individual array elements: supply array-valued arguments to Matlab functions; apply elementwise operations such as.* and.ˆ to arrays; exploit the colon notation to access subarrays: W(1:i).

Pricing by Finite Difference Solution of PDEs Pricing by Finite Difference Solution of PDEs N. Hilber, Ch. Winter Lecture 2

Outline Pricing by Finite Difference Solution of PDEs Option prices as solutions of PDEs: Fokker-Planck equation Finite Difference method for the heat equation Pricing by Finite Difference Solution of PDEs Option prices as solutions of PDEs: Fokker-Planck equation Finite Difference method for the heat equation

Pricing by Finite Difference Solution of PDEs Option prices as solutions of PDEs: Fokker-Planck equation Finite Difference method for the heat equation Setup Consider the SDE dx t = b(t, X t )dt + σ(t, X t )dw t, X 0 = x. (2.1) Assume K > 0 such that x, y R, 0 t T (A1) b(t, x) b(t, y) + σ(t, x) σ(t, y) K x y (A2) b(t, x) + σ(t, x) K(1 + x ) (A3) the RV x is independent of the σ algebra generated by W and satisfies E[ x 2 ] < (A1) (A3) for any T 0 (2.1) admits an unique solution (X t ) 0 t T with the properties (X t ) 0 t T is t continuous, (X t ) 0 t T is adapted to the filtration generated by x and W, E[ T 0 X t 2 dt] <.

Setup Pricing by Finite Difference Solution of PDEs Option prices as solutions of PDEs: Fokker-Planck equation Finite Difference method for the heat equation Assume the risky underlying (X t ) 0 t T evolves according to the SDE dx t = b(t, X t )dt + σ(t, X t )dw t, X 0 = x. Assume r(t, x) is a bounded and continuous function modelling the riskless interest rate. Objective: Compute the value of an option with payoff h( ) which is the conditional expectation V t = u(t, X t ) = E [e R ] T t r(s,xs t,x )ds h(x t,x ) F t, (2.2) where Xs t,x t. is the solution of the SDE (2.1) starting from x at time T

Pricing by Finite Difference Solution of PDEs Infinitesimal generator Option prices as solutions of PDEs: Fokker-Planck equation Finite Difference method for the heat equation Solution: characterize u(t, x) as solution of a partial differential equation. We need some auxiliary results. Assume that σ, b in (2.1) are independent of t. Denote by A the differential operator acting on functions f C 2. (Af)(x) = 1 2 σ2 (x)f (x) + b(x)f (x), (2.3)

Pricing by Finite Difference Solution of PDEs Infinitesimal generator Option prices as solutions of PDEs: Fokker-Planck equation Finite Difference method for the heat equation Proposition Assume that σ, b in (2.1) are independent of t. Then the process M t := f(x t ) t 0 (Af)(X s ) ds (2.4) is a martingale with respect to the filtration of W t. In particular, for all t, E [ f(x t ) ] [ t ] = f(x) + E Af(X s )ds. (2.5) 0 Proof. Itô s Lemma, stochastic integral w.r. to W is a martingale.

Pricing by Finite Difference Solution of PDEs Infinitesimal generator Option prices as solutions of PDEs: Fokker-Planck equation Finite Difference method for the heat equation Based on this Proposition, we have Theorem Denote by Xt x the solution of the SDE (2.1) with initial condition X0 x = x. Then for any function f C2, the function t E[f(Xt x )] is continuously differentiable and with A as in (2.3) d dt E[ f(x x t ) ] t=0 = (Af)(x) Remark The operator A is called infinitesimal generator of the diffusion process X x t.

Pricing by Finite Difference Solution of PDEs Option prices as solutions of PDEs: Fokker-Planck equation Finite Difference method for the heat equation Prices of European contracts are moments of the price process Xt x of the form u(x, t) = E [e R ] t 0 r(xx s )ds h(xt x ) (2.6) where h(x) and r(x) are continuous functions of x R. Such moments are solutions of deterministic PDEs, as the following theorem, the so-called Feynman-Kac theorem, shows.

Pricing by Finite Difference Solution of PDEs Feynman-Kac Option prices as solutions of PDEs: Fokker-Planck equation Finite Difference method for the heat equation Theorem Let u(x, t) C 2,1 (R R + ) be a solution of the parabolic Cauchy problem { t u + Au ru = 0 in R R + (2.7) u(x, 0) = h(x) in R with A as in (2.3). Then u(x, t) can be represented as in (2.6), i.e. u(x, t) = E [e R ] t 0 r(xx s )ds h(xt x ). Viceversa, any u(x, t) as in (2.6) which is in C 2,1 (R R + ) solves the deterministic Fokker Planck equation (2.7).

Pricing by Finite Difference Solution of PDEs Option prices as solutions of PDEs: Fokker-Planck equation Finite Difference method for the heat equation This result is still true in a multi-dimensional model and for the case when the coefficient functions b, σ and the discounting factor c depend also on t. For p N consider the system of SDEs dx k t = b k (t, X t )dt + Denote by A the operator p σ kj (t, X t )dw j t, 1 k n. (2.8) j=1 (Au)(x, t) = 1 2 tr[σσ D 2 u] + b, u, (2.9) where D 2 = ( xi x j ) 1 i,j n is the Hessian, σ = (σ ij ) 1 i n,1 j p and, denotes the standard inner product in R n.

Pricing by Finite Difference Solution of PDEs Feynman-Kac (baskets) Option prices as solutions of PDEs: Fokker-Planck equation Finite Difference method for the heat equation Theorem (baskets) (i) If (X t ) t 0 is a solution of (2.8) and u(x, t) : R n R + R has bounded, second order derivatives in x and bounded first order derivatives in t and if r(t, x) : R + R n R is a continuous, bounded function on R + R n, then the process M t := e R t 0 r(s,xs)ds u(x t, t) is a martingale. t 0 e R s 0 r(τ,xτ )dτ ( t u + Au ru) (X s, s)ds

Pricing by Finite Difference Solution of PDEs Option prices as solutions of PDEs: Fokker-Planck equation Finite Difference method for the heat equation (ii) Let u(x, t) C 2,1 (R n [0, T ]) be a solution of the parabolic Cauchy problem { t u + Au ru = 0 in R n R + u(x, T ) = h(x) in R n (2.10) with A as in (2.9). Then u(x, t) can be represented as u(x, t) = E [ e R T t r(s,xs t,x )ds h(x t,x T )]. (2.11)

Pricing by Finite Difference Solution of PDEs Application to the Black Scholes model Option prices as solutions of PDEs: Fokker-Planck equation Finite Difference method for the heat equation Assume for simplicity that no dividends are paid. Dynamics of risky underlying: Geometric Brownian motion ds t = S t (rdt + σdw t ), S 0 = S (2.12) i.e. we have b(s) = rs, σ(s) = σs. The infinitesimal generator A is A =: A BS = 1 2 σ2 S 2 SS + rs S.

Pricing by Finite Difference Solution of PDEs Option prices as solutions of PDEs: Fokker-Planck equation Finite Difference method for the heat equation The discounted price of a European contract with payoff h(s), i.e. V (S, t) := E[e r(t t) h(s T ) S t = S], is equal to a regular solution V (S, t) of the Black Scholes (BS) equation { t V + A BS V rv = 0 in R + [0, T ) V (S, T ) = h(s) in R +, (2.13) where A BS = 1 2 σ2 S 2 SS + rs S.

Pricing by Finite Difference Solution of PDEs Heat equation Option prices as solutions of PDEs: Fokker-Planck equation Finite Difference method for the heat equation By change of variables y(x, τ) := e αx βτ V (e x, T 2τ/σ 2 ), α, β R the Black-Scholes equation can be transformed to the heat equation (see exercise): { τ y xx y = 0 in R (0, 1/2σ 2 T ] y(x, 0) = y 0 (x) in R We first study finite difference method on this simple example. Boundary conditions If the equation is satisfied for x (a, b), we need conditions at x = a and x = b, for all τ. Examples: Dirichlet conditions: y(a, τ) = g a (τ), y(b, τ) = g b (τ). Neumann conditions: x y(a, τ) = g a (τ), x y(b, τ) = g b (τ). Remark If x R, we choose a bounded computational domain (a, b) and impose artificial boundary conditions.

Pricing by Finite Difference Solution of PDEs Discretization of the domain Option prices as solutions of PDEs: Fokker-Planck equation Finite Difference method for the heat equation Computational domain [a, b] [0, τ max ] is replaced by discrete grid: {(x i, τ m )}, i = 0,..., N + 1, m = 0,..., M, where x i are equidistant space grid points with space step size h: x i = a + ih, h x = b a N + 1, and τ m the time levels with time step size k: τ m = mk, k τ = τ max M. Remark It is possible to use variable step sizes x i and τ m : for example, to refine the grid near the irregularities of the solution.

Pricing by Finite Difference Solution of PDEs Solution on the grid Option prices as solutions of PDEs: Fokker-Planck equation Finite Difference method for the heat equation The exact solution y(x, t) is a surface on [a, b] [0, τ max ]: infinitely dimensional object. Computer can work only with finite quantities. Therefore, we represent the solution by its values on the grid: the surface is replaced by (N + 2) (M + 1) points: y(x, t) {y m i = y(x i, τ m )}, i = 0,..., N + 1, m = 0,..., M. The goal is to approximate the values {yi m }. Values of the solution between grid points are then found by some interpolation.

Pricing by Finite Difference Solution of PDEs Difference Quotients (= Finite Differences) Option prices as solutions of PDEs: Fokker-Planck equation Finite Difference method for the heat equation We want to approximate the derivatives of y using only its values on the grid. First, let us consider a function f(x) of one variable. Assume that f is twice differentiable with continuous derivatives; we write f C 2. Then, using Taylor s formula, f (x) = f(x + h) f(x) h + h 2 f (ξ), ξ [x, x + h]. If f i = f(x i ) are the values of f on the grid {x i }, we obtain f (x i ) f i+1 f i h with a remainder that goes to zero as h 0.

Pricing by Finite Difference Solution of PDEs Option prices as solutions of PDEs: Fokker-Planck equation Finite Difference method for the heat equation Notations f (x i ) = f i+1 f i h + O(h) =: (δ + x f) i + O(h) f (x i ) = f i f i 1 + O(h) =: (δx f) i + O(h) h (δ x + f) i and (δx f) i are called one-sided difference quotients of f with respect to x at x i. They are accurate of first order (O(h)). Other examples (valid for more regular functions): f (x i ) = f i+1 f i 1 2h + O(h 2 ) =: (δ x f) i + O(h 2 ) f C 3, f (x i ) = f i+1 2f i + f i 1 h 2 + O(h 2 ) =: (δ 2 xxf) i + O(h 2 ) f C 4, f (x i ) = f i+2 + 4f i+1 3f i 2h + O(h 2 ) =: ( δ + x f) i + O(h 2 ) f C 3.

Pricing by Finite Difference Solution of PDEs Explicit (Euler) finite difference scheme Option prices as solutions of PDEs: Fokker-Planck equation Finite Difference method for the heat equation We replace PDE y τ 2 y x 2 y m+1 i yi m k for m = 0,..., M 1, i = 1,..., N. Initialization: y 0 i = y 0(x i ), i = 0,..., N + 1. For m = 0,..., M 1: = 0 by the set of algebraic equations ym i+1 2ym i + yi 1 m h 2 = 0 y m+1 i = k h 2 y m i 1 + (1 2 k h 2 )y m i + k h 2 y m i+1, i = 1,..., N y m+1 0 = g a (τ m+1 ), y m+1 N+1 = g b(τ m+1 ) (if Dirichlet boundary conditions)

Pricing by Finite Difference Solution of PDEs Neumann boundary conditions Option prices as solutions of PDEs: Fokker-Planck equation Finite Difference method for the heat equation If boundary conditions are specified in Neumann form: y x (a, τ) = g a(τ), y x (b, τ) = g b(τ), τ [0, τ max ] we can approximate the derivatives by one-sided finite differences: y m 1 ym 0 h = g a (τ m ), y m N+1 ym N h = g b (τ m ), m = 0,..., M which gives boundary conditions for the discrete scheme: y m 0 = y m 1 h g a (τ m ), y m N+1 = y m N + h g b (τ m ), m = 0,..., M. Remark We can also use more accurate approximations of y x as, for example, ( δ + x y).

Pricing by Finite Difference Solution of PDEs Implicit finite difference scheme Option prices as solutions of PDEs: Fokker-Planck equation Finite Difference method for the heat equation Here, the space derivative is taken on the time level m + 1: y m+1 i yi m k for m = 0,..., M 1, i = 1,..., N. Initialization: ym+1 i+1 2ym+1 i + yi 1 m+1 h 2 = 0 y 0 i = y 0(x i ), i = 0,..., N + 1. For m = 0,..., M 1: y0 m+1 = g a (τ m+1 ), solve k y m+1 h 2 i 1 + (1 + 2 k )y m+1 h 2 i k y m+1 h 2 i+1 = yi m, i = 1,..., N y m+1 N+1 = g b(τ m+1 ).

θ-scheme Pricing by Finite Difference Solution of PDEs Option prices as solutions of PDEs: Fokker-Planck equation Finite Difference method for the heat equation For a parameter θ [0, 1], θ-scheme is a combination of explicit and implicit schemes: E m i : = ym+1 i yi m k = ym+1 i yi m k [ ] (1 θ)(δxxy) 2 m i + θ(δxxy) 2 m+1 i [ (1 θ) ym i+1 2ym i + yi 1 m h 2 +θ ym+1 i+1 2ym+1 i + yi 1 m+1 ] h 2 θ = 0 = explicit scheme. θ = 1 = implicit scheme. θ = 1/2 = Crank-Nicolson scheme. = 0

Pricing by Finite Difference Solution of PDEs θ-scheme in matrix form Option prices as solutions of PDEs: Fokker-Planck equation Finite Difference method for the heat equation Let us introduce column vectors y m = (y1 m,..., yn m ), E m = (E1 m,..., EN m ) and the tridiagonal N N matrix 2 1. G = 1........... 1 1 2 Then the FD θ-scheme E m = 0 becomes, in matrix form, (I + θ k ) h 2 G y m+1 = (I (1 θ) k ) h 2 G y m. /here, we assume homogeneous Dirichlet boundary conditions/

Notation Pricing by Finite Difference Solution of PDEs Option prices as solutions of PDEs: Fokker-Planck equation Finite Difference method for the heat equation To shorten the notation, let us introduce matrices B = I + θ k h 2 G and C = I (1 θ) k h 2 G. The scheme becomes By m+1 = Cy m. To find y m+1, we have to solve this linear system: y m+1 = B 1 Cy m.

Pricing by Finite Difference Solution of PDEs θ-scheme for some modifications of the PDE Inhomogeneous heat equation: Option prices as solutions of PDEs: Fokker-Planck equation Finite Difference method for the heat equation y τ = 2 y x 2 + f(x, τ) = By m+1 = Cy m + k[θf m+1 + (1 θ)f m ]. where f m = (f m 1,..., f m N ) and f m i = f(x i, τ m ). Inhomogeneous Dirichlet BC: y(a, τ) = g a (τ), y(b, τ) = g b (τ) By m+1 = Cy m + k h 2 [θgm+1 + (1 θ)g m ]. where g m = ( g a (τ m ), 0,..., 0, g b (τ m ) ). Neumann BC: y x (a, τ) = g a(τ), y x (b, τ) = g b(τ) = (B θ k h 2 F )ym+1 = (C+(1 θ) k h 2 F )ym + k h [θgm+1 + (1 θ)g m ]. where g m = ( g a (τ m ), 0,..., 0, g b (τ m ) ), and F contains only two non-zero elements: F ij = 0 except F 11 = F NN = 1.

Pricing by Finite Difference Solution of PDEs Pricing by Finite Difference Solution of PDEs (part 2) N. Hilber, Ch. Winter Lecture 3

Outline Pricing by Finite Difference Solution of PDEs Analysis of the Finite Difference method Finite Difference solution of the Black-Scholes equation Pricing by Finite Difference Solution of PDEs Analysis of the Finite Difference method Finite Difference solution of the Black-Scholes equation

Pricing by Finite Difference Solution of PDEs Consistency of the scheme Analysis of the Finite Difference method Finite Difference solution of the Black-Scholes equation We have replaced continuous PDE by the following FD equations: E m i = 0, i = 1,..., N, m = 0,..., M 1, y 0 i = y 0 (x i ), i = 1,..., N y m 0 = 0, y m N+1 = 0, m = 0,..., M (homogeneous Dirichlet BC) Definition The consistency error Ei m at (x i, τ m ) is the difference operator Ei m with yi m replaced by y(x i, τ m ) where y is the exact solution. Note Consistency error measures the quality of the approximation of the differential operator by finite differences. A scheme is called consistent if its consistency error goes to zero as h, k 0.

Pricing by Finite Difference Solution of PDEs Consistency error Analysis of the Finite Difference method Finite Difference solution of the Black-Scholes equation We want to estimate the consistency errors Ei m width h and time step size k. in terms of mesh Proposition If the exact solution y(x, τ) of the heat equation is sufficiently smooth, then, for m = 1,..., M 1 and i = 1,..., N, we have E m i C(h 2 + k) 0 θ 1, E m i C(h 2 + k 2 ) θ = 1 2. where C depends on the exact solution y and its derivatives.

Pricing by Finite Difference Solution of PDEs Discretization error Analysis of the Finite Difference method Finite Difference solution of the Black-Scholes equation Define ε m, the error vector at time τ m : ε m i = y(x i, τ m ) y m i, 1 i N, 0 m M. The error vectors {ε m } M m=0 satisfy the difference equation or, in explicit form, 1 k B εm+1 1 k C εm = E m ε m+1 = A θ ε m + kb 1 E m where A θ B 1 C is called amplification matrix. Note: the scheme is convergent (in L (0, τ max ; L 2 (a, b)) norm) if sup m h ε m l2 0 as h, k 0.

Pricing by Finite Difference Solution of PDEs Recall on matrix and vector norms Analysis of the Finite Difference method Finite Difference solution of the Black-Scholes equation Let v = (v 1,..., v N ) and M be an N N matrix. We define v l2 := (v 2 1 + + v 2 N) 1/2 M 2 := sup v 0 Mv l2 v l2. Remark If M is symmetric with eigenvalues λ l, 1 l N, then M 2 = max 1 l N λ l. Property For all v and M, we have Mv l2 M 2 v l2. Remark Let f be a function on (a, b) with f(a) = f(b) = 0, and let f = (f 1,..., f N ) be the vector of its values on the grid. Then b f 2 L 2 (a,b) = f 2 (x)dx = a N i=0 xi+1 x i f 2 (x)dx N fi 2 h = h f 2 l 2. i=1

Pricing by Finite Difference Solution of PDEs Consistency + Stability = Convergence Analysis of the Finite Difference method Finite Difference solution of the Black-Scholes equation Proposition For all M N, 1 m M, holds ε m l2 A θ m 2 ε 0 l2 + k m 1 n=0 A θ m 1 n 2 E n l2. Corollary If the stability condition A θ 2 1 holds then, as M, N, the FD scheme converges and, if ε 0 = 0, sup m ε m l2 τ max sup m E m l2.

Stability Pricing by Finite Difference Solution of PDEs Analysis of the Finite Difference method Finite Difference solution of the Black-Scholes equation When the stability condition A θ 2 1 is satisfied? We need some auxiliary results. Lemma The eigenvalues of the tridiagonal matrix X R N N : α β X = γ α......... β. γ α are given by λ X l = α + 2 ( lπ ) βγ cos, l = 1,..., N. N + 1

Pricing by Finite Difference Solution of PDEs Stability (cont.) Analysis of the Finite Difference method Finite Difference solution of the Black-Scholes equation Eigenvalues of B = I + θkh 2 G are given by λ B l = 1+2θ k h 2 +2θ k h 2 cos ( lπ ) = 1+4θ k ( lπ ) N + 1 h 2 sin2 2(N + 1) Eigenvalues of C = I (1 θ)kh 2 G are given by λ C l = 1 4(1 θ) k ( lπ ) h 2 sin2 2(N + 1) Eigenvalues of A θ = B 1 C are given by ( 1 4(1 θ) kh 2 sin 2 lπ ) λ A θ l = λc l 2(N + 1) λ B = ( l 1 + 4θ kh 2 sin 2 lπ ). 2(N + 1)

Pricing by Finite Difference Solution of PDEs Stability of the θ-scheme Analysis of the Finite Difference method Finite Difference solution of the Black-Scholes equation A θ 2 1 l = 1,..., N, λ A θ l 1. Denoting x l = 4kh 2 sin 2 (lπ/2(n + 1)) 0 we can write λ A θ l = 1 (1 θ)x l 1 + θx l = 1 x l 1 + θx l 1. It remains to check that λ A θ l 1, l = 1,..., N. Proposition If 1 2 θ 1, the θ-scheme is stable for all k and h. If 0 θ < 1 2, the θ-scheme is stable if the CFL-condition holds: k h 2 1 2(1 2θ).

Pricing by Finite Difference Solution of PDEs Convergence of the θ-scheme Analysis of the Finite Difference method Finite Difference solution of the Black-Scholes equation Theorem If y(x, τ) is sufficiently smooth (y C 4 ([a, b] [0, τ max ])), then i) for 1 2 < θ 1 or for 0 θ < 1 2 and CFL-condition, sup m h 1 2 ε m l2 C(y)(h 2 + k), ii) for θ = 1 2 (Crank-Nicolson scheme), sup m h 1 2 ε m l2 C(y)(h 2 + k 2 ). Conclusion If the scheme is consistent and stable, then it is convergent with the same order that the consistency error.

Pricing by Finite Difference Solution of PDEs Black-Scholes equation in real price Analysis of the Finite Difference method Finite Difference solution of the Black-Scholes equation Recall that in the BS model European option prices satisfy V t + 1 2 σ2 S 2 2 V V + rs S2 S rv = 0, in R + [0, T ) V (S, T ) = H(S), in R + We denote A BS V = 1 2 σ2 S 2 2 V V + rs S2 S. The coefficients of this Black-Scholes operator are non-constant. The operator degenerates near S = 0.

Pricing by Finite Difference Solution of PDEs Black-Scholes equation in log-price Analysis of the Finite Difference method Finite Difference solution of the Black-Scholes equation To obtain a non-degenerate operator with constant coefficients, we change to log-price: x = log S. It is also convenient to work with time to maturity instead of time: τ = T t. Define v(x, τ) := V (S, t) = V (e x, T τ). Then v solves τ v A BS log v + rv = 0 in R (0, T ) v(0, x) = H(e x ) in R where A BS log denotes the BS operator in log-price: A BS log v = σ2 2 ) v (r 2 x 2 + σ2 v 2 x.

Pricing by Finite Difference Solution of PDEs Initial condition Analysis of the Finite Difference method Finite Difference solution of the Black-Scholes equation Terminal condition for V becomes initial conditions for v. European call: European put:

Pricing by Finite Difference Solution of PDEs Truncation of the domain Analysis of the Finite Difference method Finite Difference solution of the Black-Scholes equation In the European case, v(x, τ) is defined for < x <. For numerical solution, we truncate the domain to ( R, R): τ v R A BS log v R + rv R = 0 in ( R, R) (0, T ), v R (x, 0) = H(e x ) x < R We then need artificial boundary conditions at x = ±R. The simplest choice are homogeneous Dirichlet conditions: v R (±R, τ) = 0 0 < τ < T.

Pricing by Finite Difference Solution of PDEs Estimation of the truncation error Analysis of the Finite Difference method Finite Difference solution of the Black-Scholes equation Let us estimate the difference between v and v R. Theorem Assume that the payoff function is bounded, i.e. there exists M such that H(e x ) M x R. Then with µ := r σ2 2, for all x ( R + µ τ, R µ τ), { ( v(x, τ) v R (x, τ) M exp ( + exp In particular, v(x, τ) v R (x, τ) 0 as R. R µ τ ) x 2 2σ 2 τ R µ τ + )} x 2 2σ 2 τ

Pricing by Finite Difference Solution of PDEs Boundary layer Analysis of the Finite Difference method Finite Difference solution of the Black-Scholes equation The error is large near the boundary: We have to choose R much larger than the values x of interest.

Pricing by Finite Difference Solution of PDEs Asymptotics of the solution Analysis of the Finite Difference method Finite Difference solution of the Black-Scholes equation How to reduce the error near the boundary? We have to choose boundary conditions accordingly to the asymptotics of the solution. For European calls and puts, we have: t, V C (S, t) S=0 = 0, V P (S, t) S = 0. At the complementary sides, we use Call-Put parity: This implies, for all t: S + V P V C = Ke r(t t). V C (S, t) S K e r(t t) S, V P (S, t) K e r(t t) S S 0. Note Asymptotics for v(x, τ) may be obtained by change of variables.

Pricing by Finite Difference Solution of PDEs Asymptotic boundary conditions Analysis of the Finite Difference method Finite Difference solution of the Black-Scholes equation We obtain the following boundary conditions at S min and S max : Dirichlet or Neumann V C (S min, t) = 0 S V C (S min, t) = 0 V P (S min, t) = Ke r(t t) S min S V P (S min, t) = 1 V C (S max, t) = S max Ke r(t t) S V C (S max, t) = 1 V P (S max, t) = 0 S V P (S max, t) = 0

Pricing by Finite Difference Solution of PDEs Discretization Analysis of the Finite Difference method Finite Difference solution of the Black-Scholes equation τ v R A BS log v R + rv R = 0 in ( R, R) (0, T ), v R (x, 0) = H(e x ) x < R For N, M N define (equidistant) grid {(x i, τ m )} in [ R, R] [0, T ]: space grid with mesh width h: x i = R + ih, h = 2R N+1, i = 0,..., N + 1 time grid with mesh width k: τ m = mk, k = T M, m = 0,..., M

Pricing by Finite Difference Solution of PDEs Discretization (cont.) Analysis of the Finite Difference method Finite Difference solution of the Black-Scholes equation Discretize A BS log by second order finite differences: For i = 1,..., N (A BS log h v ) i = 1 σ 2 ) 2 h 2 (v i 1 2v i +v i+1 )+ (r σ2 1 2 2h (v i+1 v i 1 ), where v(τ) = (v 1 (τ),..., v N (τ)) and v i (τ) is an approximation in space to v R (x i, τ). For simplicity, adopt homogeneous Dirichlet boundary conditions: v 0 (τ) = v N+1 (τ) = 0.

Pricing by Finite Difference Solution of PDEs Discretization (cont.) Analysis of the Finite Difference method Finite Difference solution of the Black-Scholes equation Let A h = A BS log h ri R N N. Then (where = τ ) where x = (x 1,..., x N ). v = A h v, v(0) = H(e x ), This is a N N-system of ordinary differential equations. To discretize it, use the θ-scheme. Let w m be an approximation to v(τ m ). We obtain 1 k (wm+1 w m ) = A h (θw m+1 + (1 θ)w m ).

Pricing by Finite Difference Solution of PDEs θ-scheme for Black-Scholes equation Analysis of the Finite Difference method Finite Difference solution of the Black-Scholes equation We obtain the following scheme: Given w 0 = H(e x ) R N, for m = 0,..., M 1 find w m+1 R N such that ( I kθah ) w m+1 = ( I + k(1 θ)a h ) w m, where A h is given by A h = tridiag(α, β, α + ), with α ± = σ2 2h 2 ± 1 (r ), σ2 β = σ2 2h 2 h 2 r.

Pricing by Finite Difference Solution of PDEs Stability analysis Analysis of the Finite Difference method Finite Difference solution of the Black-Scholes equation Denote by λ i,n < 0, 1 i N, the eigenvalues of A h R N N. The scheme is stable if the amplification factors R i (λ i,n k) := 1 + λ i,nk 1 θλ i,n k, 1 i N satisfy R i (λ i,n k) 1, i. These inequalities always hold if 1 2 θ 1 (unconditionally stable). If, however, 0 θ < 1 2, we must have the CFL-condition

Pricing by Finite Difference Solution of PDEs Stability analysis (cont.) Analysis of the Finite Difference method Finite Difference solution of the Black-Scholes equation k 2 λ i,n (1 2θ), 1 i N. Since λ N,N < < λ 1,N < 0, this is equivalent to k 2 λ N,N (1 2θ). By Lemma 2.12 of the lecture notes we have λ N,N = σ2 h 2 r + 1 σ 4 ( ) 2 ( ) h h 2 r σ2 Nπ cos. 2 N + 1

Pricing by Finite Difference Solution of PDEs Analysis of the Finite Difference method Finite Difference solution of the Black-Scholes equation Stability analysis (cont.) We may estimate λ N,N 2 σ2 h 2 r and obtain the CFL-condition k 2h 2 (1 2θ)(2σ 2 + rh 2 ). Example. θ = 0 (explicit Euler). Let T = 1, σ = 0.3, r = 0.05, R = 5, N = 500. Then M T k = 2(N + 1)2 σ 2 + 4R 2 r 8R 2 226 time steps are needed to fullfill the CFL-condition.

Pricing by Finite Difference Solution of PDEs Stability of θ-scheme Analysis of the Finite Difference method Finite Difference solution of the Black-Scholes equation

Summary Pricing by Finite Difference Solution of PDEs Analysis of the Finite Difference method Finite Difference solution of the Black-Scholes equation θ CFL-condition Convergence Remark 0 k 2 λ N,N O(h 2 + k) no linear system has to be solved 1 2 none O(h 2 + k 2 ) linear systems have to be solved 1 none O(h 2 + k) linear systems have to be solved

Pricing American options using Finite Difference method Pricing American options using Finite Difference method N. Hilber, Ch. Winter Lecture 4

Pricing American options using Finite Difference method Outline Black-Scholes Variational Inequality Domain truncation Finite Difference discretization Solution of matrix linear complementarity problems (LCPs) Pricing American options using Finite Difference method Black-Scholes Variational Inequality Domain truncation Finite Difference discretization Solution of matrix linear complementarity problems (LCPs)

Pricing American options using Finite Difference method Black-Scholes Variational Inequality Domain truncation Finite Difference discretization Solution of matrix linear complementarity problems (LCPs) Assumption Black-Scholes market, no dividends (δ = 0): ds t = S t (rdt + σ dw t ) t > 0. American options are options that can be exercised at any time up to the expiration date T. The problem of optimal exercising is equivalent to an optimal stopping problem: denote by T t,t the set of all stopping times with values in the interval (t, T ). Then, with the payoff H(S) = (S K) + (call) or H(S) = (K S) + (put), V am (S, t) = sup τ T t,t E [ e r(τ t) H(Se (r σ 2 2 )(τ t)+σ(wτ Wt) ) ].

Pricing American options using Finite Difference method Black-Scholes Variational Inequality Domain truncation Finite Difference discretization Solution of matrix linear complementarity problems (LCPs) Basic properties of the Value V am (S, t) of an American contract (δ = 0): V am C V am P = V eur C V eur P V am P (S, t) (K S) +, V am C (S, t) (S K) +. As for the European vanilla, there is a close connection between the probabilistic representation of the option s value and a deterministic, PDE based representation of this value.

Pricing American options using Finite Difference method American option as Free Boundary Problem Black-Scholes Variational Inequality Domain truncation Finite Difference discretization Solution of matrix linear complementarity problems (LCPs) There exists a point S f = S f (t) such that VP am (S, t) > (K S) + for S > S f (t) VP am (S, t) = (K S) + for S S f (t)

Pricing American options using Finite Difference method Black-Scholes Variational Inequality Domain truncation Finite Difference discretization Solution of matrix linear complementarity problems (LCPs) American option as Free Boundary Problem (cont.) A priori the boundary S f (t) is not known. Therefore, the problem of calculating VP am(s, t) for S > S f (t) is called free boundary-value problem and S f (t) is called free boundary. The free boundary S f (t) separates R + [0, T ] into the continuation region (hold the option) and the stopping region (exercise the option). As soon the price of the asset reaches S f (t) the holder should exercise the option. The corresponding time instant τ is called stopping time.

Pricing American options using Finite Difference method Black-Scholes Variational Inequality Domain truncation Finite Difference discretization Solution of matrix linear complementarity problems (LCPs) American option as Free Boundary Problem (cont.) Calculated free boundary for a put with maturity T = 1 and strike K = 20.

Pricing American options using Finite Difference method A simple obstacle problem Black-Scholes Variational Inequality Domain truncation Finite Difference discretization Solution of matrix linear complementarity problems (LCPs) Let 1 < α < β < 1. Assume an obstacle ψ such that ψ(x) > 0 for α < x < β, ψ C 2, ψ < 0. The obstacle problem reads: Find u C 1 [ 1, 1] such that u = 0 (then u > ψ) for x ( 1, α) (β, 1) u = ψ (then u = ψ < 0) for x (α, β)

Pricing American options using Finite Difference method A simple obstacle problem (cont.) Black-Scholes Variational Inequality Domain truncation Finite Difference discretization Solution of matrix linear complementarity problems (LCPs) This manifests a complementarity in the sense if u > ψ, then u = 0 if u = ψ, then u < 0 The obstacle problem can be reformulated as: Find u C 1 [ 1, 1] such that u(±1) = 0 and such that u 0 in ( 1, 1) u ψ in ( 1, 1) u (u ψ) = 0 in ( 1, 1)

Pricing American options using Finite Difference method Linear complementarity problem (LCP) Black-Scholes Variational Inequality Domain truncation Finite Difference discretization Solution of matrix linear complementarity problems (LCPs) The finite difference discretization of the obstacle problem proceeds in the usual fashion: with 1 = x 0 < x 1 <... < x i <... < x N < x N+1 = 1 x i = 1 + i x, i = 0, 1,..., N + 1, x = 2/(N + 1), y i u(x i ) : y = (y 1,..., y N ) R N.

Pricing American options using Finite Difference method Black-Scholes Variational Inequality Domain truncation Finite Difference discretization Solution of matrix linear complementarity problems (LCPs) Linear complementarity problem (LCP) (cont.) We approximate the obstacle problem by the LCP Ay b = 0 y ψ ( Ay b ) (y ψ ) = 0 where A = tridiag( 1, 2, 1) ψ = ( ψ(x 1 ),..., ψ(x N ) ).

Pricing American options using Finite Difference method Black-Scholes Variational Inequality Domain truncation Finite Difference discretization Solution of matrix linear complementarity problems (LCPs) Projected Successive Over Relaxation (PSOR) We solve the LCP by the projected SOR iteration: Definition (Projected SOR/Cryer 1971) Given y 0 ψ, for k = 0, 1, 2,..., compute y k+1 from y k via: i) for i = 1,..., n, do ii) y k+1 i ỹi k+1 := 1 ( b i A ii i 1 j=1 A ij y k+1 j N j=i+1 := max ( ψ i, y k i + ω(ỹk+1 i y k i )) if y k+1 y k 2 < ε stop; else: k k + 1. A ij y k j ).

Pricing American options using Finite Difference method Black-Scholes Variational Inequality Domain truncation Finite Difference discretization Solution of matrix linear complementarity problems (LCPs) Remark 1) if ii) is replaced by y k+1 i = y k i + ω(ỹ k+1 i y k i ), then we get the classical SOR for the solution of Ay = b. Step ii) ensures the inequality condition (y ψ). 2) 0 < ω < 2 is a relaxation parameter - the PSOR converges for all these ω. Convergence speed can be optimized for 1 < ω < 2. We turn back to American options. In analogy to the simple obstacle problem, we have the following Theorem.

Pricing American options using Finite Difference method Black-Scholes Variational Inequality Domain truncation Finite Difference discretization Solution of matrix linear complementarity problems (LCPs) Theorem Let v(x, t) be a regular solution of the BS-inequality (g(x) := H(e x )): t v + A BS log v rv 0, in R (0, T ), v(x, t) H(e x ) =: g(x) in R (0, T ), ( t v + A BS log v rv)(g v) = 0, in R (0, T ), v(x, T ) = g(x) in R. Then V am (S, t) = v(log S, t).

Pricing American options using Finite Difference method Black-Scholes Variational Inequality Domain truncation Finite Difference discretization Solution of matrix linear complementarity problems (LCPs) To prepare the FD discretization, we truncate the domain: we restrict x R to x < R <, where R is a truncation parameter, and Ω R = ( R, R). Then v R (x, t) solves t v R + A BS log v R rv R 0 in Ω R (0, T ) v R g in Ω R (0, T ) (v R g)( t v R + A BS log v R rv R ) = 0 in Ω R (0, T ) v R (x, T ) = g(x) in Ω R x v R (±R, t) = 0 in (0, T )