achdou and pironneau-computational methods option pricing

316

Upload: jerry-zhao

Post on 22-Apr-2015

337 views

Category:

Documents


18 download

TRANSCRIPT

Page 1: Achdou and Pironneau-Computational Methods Option Pricing
Page 2: Achdou and Pironneau-Computational Methods Option Pricing

ComputationalMethods forOption Pricing

Page 3: Achdou and Pironneau-Computational Methods Option Pricing

This page intentionally left blank

Page 4: Achdou and Pironneau-Computational Methods Option Pricing

F R O N T I E R SI N A P P L I E D M A T H E M A T I C S

The SIAM series on Frontiers in Applied Mathematics publishes monographs dealing withcreative work in a substantive field involving applied mathematics or scientific computation.All works focus on emerging or rapidly developing research areas that report on newtechniques to solve mainstream problems in science or engineering.

The goal of the series is to promote, through short, inexpensive, expertly writtenmonographs, cutting edge research poised to have a substantial impact on the solutions ofproblems that advance science and technology. The volumes encompass a broad spectrumof topics important to the applied mathematical areas of education, government, andindustry.

EDITORIAL BOARD

H.T. Banks, Editor-in-Chief, North Carolina State University

Richard Albanese, U.S. Air Force Research Laboratory, Brooks AFB

Belinda A. Batten, Oregon State University

Carlos Castillo-Chavez, Arizona State University

Doina Cioranescu, Universite Pierre et Marie Curie (Paris VI)

Marie Csete, Emory University School of Medicine

Lisa Fauci,Tulane University

Pat Hagan, Bear Stearns and Co., Inc.

Jeffrey Sachs, Merck Research Laboratories, Merck and Co., Inc.

Ralph C. Smith, North Carolina State University

AnnaTsao, AlgoTek, Inc.

1

Page 5: Achdou and Pironneau-Computational Methods Option Pricing

B O O K S P U B L I S H E D IN F R O N T I E R SIN A P P L I E D M A T H E M A T I C S

Achdou.Yves, and Pironneau, Olivier, Computational Methods for Option Pricing

Smith, Ralph C., Smart Material Systems: Model Development

lannelli, M.; Martcheva, M.; and Milner, F.A., Gender-Structured Population Modeling: MathematicalMethods, Numerics, and Simulations

Pironneau, O. and Achdou,Y, Computational Methods in Option Pricing

Day, William H. E. and McMorris, F. R., Axiomatic Consensus Theory ;n Group Choice and Biomathematics

Banks, H.T. and Castillo-Chavez, Carlos, editors, 8/oterror/sm: Mathematical Modeling Applications inHomeland Security

Smith, Ralph C. and Demetriou, Michael, editors, Research Directions in Distributed Parameter Systems

Hollig, Klaus, Finite Element Methods with B-Splines

Stanley, Lisa G. and Stewart, Dawn L, Design Sens/tiV/tyAno/ys/s: Computational Issues of SensitivityEquation Methods

Vogel, Curtis R., Computational Methods for Inverse Problems

Lewis, F. L.; Campos,].; and Selmic, R., Neuro-Fuzzy Control of Industrial Systems with ActuatorNonlinearities

Bao, Gang; Cowsar, Lawrence; and Masters, Wen, editors, Mathematical Modeling in Optical Science

Banks, H.T.; Buksas, M.W; and Lin.T, Electromagnetic Material Interrogation Using ConductiveInterfaces and Acoustic Wavefronts

Oostveen, Job, Strongly Stabilizable Distributed Parameter Systems

Griewank,Andreas, Evaluating Derivatives:Principles andTechniques ofA/gor/thm/c Differentiation

Kelley, C.T., Iterative Methods for Optimization

Greenbaum.Anne, Iterative Methods for Solving Linear Systems

Kelley, C.T., Iterative Methods for Linear and Nonlinear Equations

Bank, Randolph E., PLTMC: A Software Package for Solving Elliptic Partial Differential Equations.Users'Guide 7.0

More, Jorge J. and Wright, Stephen J., Optimization Software Guide

Rude, Ulrich, Mathematical and Computational Techniques for Multilevel Adaptive Methods

Cook, L Pamela, Transonic Aerodynamics: Problems in Asymptotic TheoryBanks, H.T., Control and Estimation in Distributed Parameter Systems

Van Loan, Charles, Computational Frameworks for the Fast Fourier Transform

Van Huffel, Sabine and Vandewalle, Joos, TheTotal Least Squares Problem: Computational Aspects andAnalysis

Castillo, Jose E., Mothemotico/Aspects of Numerical Grid GenerationBank, R. E., PLTMG: A Software Package for Solving Elliptic Partial Differential Equations. Users' Guide 6.0McCormick, Stephen P., Multilevel Adaptive Methods for Partial Differential EquationsGrossman, Robert, Symbolic Computation: Applications to Scientific Computing

Coleman,Thomas F. and Van Loan, Charles, Handbook for Matrix ComputationsMcCormick, Stephen F., Muhigrid Methods

Buckmaster, John D., The Mathematics of Combustion

Ewing, Richard E., The Mathematics of Reservoir Simulation

Page 6: Achdou and Pironneau-Computational Methods Option Pricing

ComputationalMethods forOption Pricing

Yves AchdouUniversite Denis Diderot

Paris, France

Olivier PironneauUniversite Pierre et Marie CurieInstitut Universitaire de France

Paris, France

Society for Industrial and Applied MathematicsPhiladelphia

slam.

Page 7: Achdou and Pironneau-Computational Methods Option Pricing

Copyright © 2005 by the Society for Industrial and Applied Mathematics.

1 0 9 8 7 6 5 4 3 2 I

All rights reserved. Printed in the United States of America. No part of this book maybe reproduced, stored, or transmitted in any manner without the written permission ofthe publisher. For information, write to the Society for Industrial and AppliedMathematics, 3600 University City Science Center, Philadelphia, PA 19104-2688.

Library of Congress Cataloging-in-Publication Data

Achdou.Yves.Computational methods for option pricing /Yves Achdou, Olivier Pironneau.

p. cm.~(Frontiers in applied mathematics)Includes bibliographical references and index.ISBN 0-89871-573-3 (pbk.)

I. Options (Finance)—Prices—Mathematical models. I. Pironneau, Olivier.II.Title. III. Series.

HG6024.A3A26 2005322.64'53'OI5l9--dc22

2005046506

is a registered trademark.EiHJlL

Page 8: Achdou and Pironneau-Computational Methods Option Pricing

To Juliette and Raphael

Page 9: Achdou and Pironneau-Computational Methods Option Pricing

Firm theory, assured significance,Appeared as frauds upon Time's credit bank

Or assets valueless in Truth's treasury.From Sri Aurobindo 's epic, Savitri

Page 10: Achdou and Pironneau-Computational Methods Option Pricing

Contents

List of Algorithms xiii

Preface xv

1 Option Pricing 11.1 Orientation 11.2 A Brief Introduction to Options 11.3 Constant Coefficients. The Black-Scholes Formula 61.4 Monte-Carlo Methods " 81.5 Other Options 151.6 Complement: Binomial Trees 17

2 The Black-Scholes Equation: Mathematical Analysis 232.1 Orientation 232.2 The Partial Differential Equation 242.3 Mathematical Analysis of the Black-Scholes Equation

with Local Volatility 272.4 Barrier Options 432.5 LeVy Driven Assets 442.6 Options on a Basket of Assets 462.7 Stochastic Volatility 48

3 Finite Differences 573.1 Finite Differences in Logarithmic Prices 573.2 Upwinding 713.3 Finite Differences in the Primitive Variables 763.4 Numerical Results 813.5 Which Variable Is Better? 833.6 Options on a Basket of Two Assets 833.7 An Asian Put with Fixed Strike 85

4 The Finite Element Method 954.1 Orientation 954.2 A Generic Problem 964.3 The Black-Scholes Equation with Local Volatility 104

ix

Page 11: Achdou and Pironneau-Computational Methods Option Pricing

x Contents

4.4 A Black-Scholes Equation Solver in C++ 1074.5 A Transparent Boundary Condition 1104.6 Levy Driven Assets 1144.7 Programs for Two-Dimensional Cases 1264.8 Programming in Dimension d > 2 1414.9 High Dimensions: An Introduction to Galerkin Methods

with Sparse Tensor Product Spaces 1424.10 Appendix: The Full Program for Two-Dimensional Black-Scholes . . . .146

5 Adaptive Mesh Refinement 1515.1 The Black-Scholes Equation and Some Discretizations 1525.2 Error Indicators for the Black-Scholes Equation 1565.3 Conclusion 1595.4 A Taste of the Software 1595.5 Results 1655.6 Mesh Adaption for a Put on a Basket of Two Assets 1725.7 Appendix: Proofs 174

6 American Options 1856.1 Introduction 1856.2 The Variational Inequality 1866.3 The Exercise Boundary 1896.4 Discrete Approximations to the Variational Inequality 1926.5 Solution Procedures 1986.6 Results 2086.7 More Complex American Options 209

7 Sensitivities and Calibration 2197.1 Introduction 2197.2 Automatic Differentiation of Computer Programs 2197.3 Computation of Greeks 2237.4 An Introduction to the Calibration of Volatility 2287.5 Finite-Dimensional Differentiable Optimization 2307.6 Application: Calibration on a Basis of Solutions 2347.7 Appendix 236

8 Calibration of Local Volatility with European Options 2438.1 The Least Squares Problem 2438.2 Which Space for TJ and Which Tychonoff Functional? 2458.3 Existence of a Minimizer 2478.4 The Gradient of J 2488.5 The Discrete Problem 2498.6 A Taste of the Program 2518.7 Results 2548.8 A Stochastic Control Approach 257

Page 12: Achdou and Pironneau-Computational Methods Option Pricing

Contents xi

9 Calibration of Local Volatility with American Options 2639.1 The Calibration Problem 2639.2 A Penalized Problem 2659.3 Necessary Optimality Conditions 2689.4 Differentiability 2749.5 Algorithm 2759.6 Results 277

Bibliography 287

Index 295

Page 13: Achdou and Pironneau-Computational Methods Option Pricing

This page intentionally left blank

Page 14: Achdou and Pironneau-Computational Methods Option Pricing

List of Algorithms

Algorithm 1.1 GSL function calls 7Algorithm 1.2 Black-Scholes formula using the GSL 7Algorithm 1.3 Black-Scholes formula by a naive method 8Algorithm 1.4 Pricing by Monte-Carlo 9Algorithm 1.5 Gaussian function using the GSL 12Algorithm 1.6 Variance reduction by control variate 14Algorithm 1.7 European call by binomial tree 19Algorithm 1.8 Binary tree for an American put 20Algorithm 3.1 Euler explicit scheme 66Algorithm 3.2 Crank-Nicolson 88Algorithm 3.3 Time step 89Algorithm 3.4 Matrix assembly 1 89Algorithm 3.5 Matrix assembly 2 91Algorithm 3.6 Right-hand side 92Algorithm 4.1 CN-scheme 107Algorithm 4.2 Time step 108Algorithm 4.3 Matrix assembly 108Algorithm 4.4 Right-hand side 109Algorithm 4.5 Transparent boundary conditions 112Algorithm 4.6 An elementary program 116Algorithm 4.7 x 119

Algorithm 4.8 CGMY 1 120Algorithm 4.9 CGMY 2 122Algorithm 4.10 Two-dimensional Black-Scholes 129Algorithm 4.11 Stochastic volatility 134Algorithm 4.12 Compressed sparse row storage 138Algorithm 4.13 Matrix-vector product 141Algorithm 4.14 Two-dimensional Black-Scholes 146Algorithm 5.1 Euler_scheme 160Algorithm 5.2 Time step 161Algorithm 5.3 Right-hand side 162Algorithm 5.4 Error indicator for the time mesh 164Algorithm 5.5 Refinement strategy 166Algorithm 6.1 Time step 202

XIII

Page 15: Achdou and Pironneau-Computational Methods Option Pricing

XIV List of Algorithms

Algorithm 6.2 Free boundary localization 204Algorithm 6.3 Primal-dual active set algorithm 207Algorithm 7.1 Automatic differentiation 220Algorithm 7.2 AD 221Algorithm 7.3 AD++ 221Algorithm 7.4 A class for an unconstrained minimization problem 232Algorithm 7.5 Computation of the gradient by automatic differentiation 232Algorithm 7.6 Armijo's rule 233Algorithm 7.7 Auxiliary function for Armijo's rule 233Algorithm 7.8 Conjugate gradient with Armijo's rule 233Algorithm 7.9 The ddouble library for automatic differentiation 236Algorithm 7.10 The file ddouble.cpp 238Algorithm 7.11 An example of automatic differentiation 241Algorithm 8.1 Gradient 252Algorithm 8.2 Backward loop: Adjoint problem 252Algorithm 8.3 Formula (8.23) 253Algorithm 9.1 Backward loop for the adjoint problem 276

Page 16: Achdou and Pironneau-Computational Methods Option Pricing

Preface

Mathematical finance is an old science but has become a major topic for numerical analystssince Merton [97], Black-Scholes [16] modeled financial derivatives. An excellent bookfor the mathematical foundation of option pricing is Lamberton and Lapeyre's [85]. Sincethe Black-Scholes model relies on stochastic differential equations, option pricing rapidlybecame an attractive topic for specialists in the theory of probability, and stochastic methodswere developed first for practical applications, along with analytical closed formulas. Butsoon, with the rapidly growing complexity of the financial products, other numerical solu-tions became attractive. Applying the Monte-Carlo method to option pricing is very naturaland not difficult, at least for European options, but speeding up the method by variancereduction may become tricky. Similarly, tree methods are very intuitive and fast but alsorapidly become difficult as the complexity of the financial product grows.

Focusing on the Black-Scholes model, a partial differential equation is obtained byIto's calculus. It can be approximated and integrated numerically by various methods, towhich a very clear and concise introduction may be found in the book by Wilmott, Howison,and Dewynne [117]: the basic idea is to approximate the partial differential equation by asystem of equations with a finite number of unknowns, which may be solved numericallyto obtain a discrete solution. The discrete problems can be computationally intensive.

The aim of this book is neither to present financial models nor to discuss their validity;we must be very modest in this perspective, since our expertise is not here. This book isnot a recipe book either, and although we have tried to be broad, many financial productssuch as bonds are not covered.

The purpose is rather to discuss some modern numerical techniques which we believeto be useful for simulations in finance. We are not going to dwell on Monte-Carlo and treemethods, because these have been studied very well elsewhere (see [60,116]). We essentiallyfocus on the finite difference (Chapter 3) and the finite element methods (Chapter 4) for thepartial differential equation, trying to answer the following three questions:

• Are these methods reliable?

• How can their accuracy be controlled and improved?

• How can these methods be implemented efficiently?

Several applications to financial products with programs in C++ are proposed.In this book, we stress the notions of error control and adaptivity: the aim is to control

a posteriori the accuracy of the numerical method, and if the desired accuracy is not reached,

xv

Page 17: Achdou and Pironneau-Computational Methods Option Pricing

xv i Preface

to refine the discretization precisely where it is necessary, i.e., most often where the solutionexhibits singularities. We believe that mesh adaption based on a posteriori estimates is animportant and practical tool because it is the only existing way to certify that a numericalscheme will give the solution within a given error bound. It is therefore a road for softwarecertification. Mesh adaption greatly speeds up computer programs because grid nodesare present only where they are needed; it is particularly important for American options,because the option price as a function of time and the spot price exhibits a singularity ona curve which is itself unknown. A posteriori error estimates are the subject of Chapter 5,and adaptive methods are also used for pricing American options in Chapter 6.

Controlling the accuracy of a numerical method requires a rather complete mathe-matical analysis of the underlying partial differential equation: this motivates partially thetheoretical results contained in Chapters 2 and 6.

The Black-Scholes model is by many aspects too simple to fit the market prices, andseveral more elaborate models were proposed:

• Assume that the volatility is itself a stochastic process [70, 110, 51 ]. This is discussedin Chapters 2 and 4.

• Generalize the Black-Scholes model by assuming that the spot price is a Levy process[31]. We discuss the pricing of Levy driven options in Chapters 2 and 4.

• Use local volatility; i.e., assume that the volatility in the Black-Scholes model is afunction of time and of the prices of the underlying assets.

In the latter case one has to calibrate the volatility from the market data, i.e., find a volatilityfunction which permits one to recover the prices of the options available on the market. Thismeans solving an inverse problem with a partial differential equation. Inverse problems areused in many fields of engineering: for instance, in the oil industry, people try to recoverunderground properties from seismic data. Such problems are usually ill-posed in the sensethat a very small variation of the data may cause huge changes in the computed volatility.This unstable character of inverse problems is a well-known fact, and the best-known cureis least square with Tychonoff regularization: calling («,-), e/ the prices of a family ofoptions available on the market, a the local volatility function, and (w«(cr)) ie/ the pricescomputed with the local volatility model, the least squares approach solves the minimizationproblem

where /C is a closed subset of a suitable function space W. This problem is ill-posed; theTychonoff regularization replaces by

where || • || is a suitable norm on W. One has to choose properly the space W, the set fC,and the norm || • ||. For that, one has to study first the sensitivity of the options' priceswith respect to the local volatility. Here also the careful analysis of the partial differ-ential equations and inequalities done in Chapters 2 and 6 proves useful. We discuss

Page 18: Achdou and Pironneau-Computational Methods Option Pricing

Preface xvii

volatility calibration with European options and American options. To our knowledge,calibration with American options is not discussed elsewhere. We also treat computationalmethods in order to evaluate the Greeks, i.e., the sensitivity of the options' prices withrespect to various parameters: for that, we describe the method of automatic differentia-tion of computer codes. We think that this idea is also new in the field of computationalfinance.

The book is organized as follows: Chapter 1 contains an introduction to option pricing,and to the numerical methods not based on partial differential equations. Chapter 2 deals withthe mathematical analysis of partial differential equations in finance: it is the cornerstone forthe numerical analysis performed in the rest of the book. Chapter 3 contains the descriptionand the numerical analysis of some finite difference methods. Chapter 4 is devoted tothe finite element method: we insist on practical implementation rather than on numericalanalysis. This chapter is a rather long one, since the finite element method is not too wellknown in finance. We apply the finite element method to many kinds of options, includingLevy driven options, basket options, and the case where the volatility is also a stochasticprocess. We also survey recent works where partial differential equation based methodshave been applied successfully for pricing options on baskets with several assets (say ten ortwenty). In Chapter 5, we discuss a posteriori error estimates and adaptive mesh refinement.American options are studied in the separate Chapter 6, which goes from mathematical andnumerical analysis to computational algorithms. Chapter 7 deals with the use of automaticdifferentiation of computer programs for evaluating the Greeks. It is also an introduction tothe calibration of volatility. In Chapter 8, we describe two ways of calibrating the volatilitywith European options: the first one is based on least squares and Dupire's equation, andthe second one uses techniques of stochastic optimal control. Finally, Chapter 9 is devotedto calibration with American options.

This book is for anyone who wishes to become acquainted with the modern tools ofnumerical analysis for some computational problems arising in finance. Although someimportant aspects of finance modeling are reviewed, the main topic is numerical algorithmsfor fast and accurate computations of financial derivatives and for calibration of parameters.

While some parts of this book are written at a graduate level, this book aims also atbeing useful to Ph.D. students and professional scientists in the field of finance. In particularit contains rigorous results on the mathematical regularity of solutions, on modern algorithmswith adaptive mesh refinement, and on the calibration with European and American optionswhich do not seem to be available anywhere else. In particular, we believe that adaptivemethods are not popular enough in the field of computational finance and that promotingthem is useful.

Except in Chapter 1, the book deals mostly with partial differential equations. Itgoes from mathematical and numerical analysis to practical computational algorithms. Itis application oriented and does not contain any theoretical development which is not usedelsewhere for a practical purpose. The computer programs are given, partially in the bookin order to point out the important ideas, fully on the web site www.ann.jussieu.fr/~achdou.They are written in C++ but do not require a thorough knowledge of the language. Theyrun on most platforms.

Our interest in this topic originated from a numerical challenge posed to us by NicolasDi Ce'sare' and Jean-Claude Hontand at the bank Natexis-Banques Populaires. Later we

Page 19: Achdou and Pironneau-Computational Methods Option Pricing

xviii Preface

offered two courses at the graduate level, one at University Pierre et Marie Curie (Paris 6)for students of numerical analysis wishing to know more about numerical mathematicalfinance, and the other at University Denis Diderot (Paris 7) for teaching numerical methodsto students more familiar with finance and statistics. The book grew out of this experience.

Being computational applied mathematicians we are indebted to a number of col-leagues for their counseling in mathematical finance: H. Berestycki, R. Cont, J. Di Fonseca,L. Elie, N. El Karoui, D. Gabay, M. Lezmi, C. Martini, G Papanicolaou, C. Schwab, andA. Sulem. We thank also C. Bemardi for having revised part of the manuscript. The firstauthor also acknowledges very fruitful cooperation with N. Tchou and B. Franchi. We havealso borrowed some C++ classes from F. Hecht.

Page 20: Achdou and Pironneau-Computational Methods Option Pricing

Chapter 1

Option Pricing

1.1 Orientation

After a brief introduction to options and option pricing, we briefly discuss two pricing meth-ods which will not be used in the other chapters of the book: the Monte-Carlo simulationsand the binomial tree methods. Since this book is devoted to deterministic techniques forpartial differential equations in finance, we shall not dwell on these two methods; however,they are important alternatives used often in practice and so it is necessary to know them toappreciate the advantages (and limitations) of deterministic methods.

1.2 A Brief Introduction to Options

1.2.1 The European Vanilla Call Option

Quoting Cox and Rubinstein [36], a European vanilla call option is a contract giving itsowner the right to buy a fixed number of shares of a specific common stock at a fixed priceat a certain date. The act of making the transaction is referred to as exercising the option:note that the owner of the option may or may not exercise it.

• The specific stock is called the underlying asset or the underlying security. Forsimplicity, we will assume that the fixed number of shares is one. The price of theunderlying asset will be referred to as the spot price and will be denoted by 5 or St.

• The fixed price is termed the strike, the striking price, or the exercise price. We willoften use the notation K for the strike.

• The given date is termed the maturity date, the maturity, or the date of expiration. Itwill often be denoted by T.

The term vanilla is used to signify that this kind of option is the simplest one: thereare more complicated contracts, some of which will be described later.

An option has a value. We wish to solve the following problem: is it possible toevaluate the market price Ct of the call option at time t, 0 < t < T?

1

Page 21: Achdou and Pironneau-Computational Methods Option Pricing

Chapter 1. Option Pricing

1.2.2 Option Pricing: The Black-Scholes Model

Definitions. Before describing the model, let us recall very briefly some notions of prob-ability: Let £2 be a set, A a or-algebra of subsets of £2, and P a nonnegative measure on £2such that P(Q) = 1. The triple (£2, A, P) is called a. probability space.

Recall that a real-valued random variable X on (£2, A, P) is an ,4-measurable real-valued function on £2; i.e., for each Borel subset B of R, X~1(B) e A Also, a rea/-valued stochastic process (Xt)t>o on (£2, .4, P) assigns to each time t a random variableXt on (£2, .4, P). The process Xt is continuous if for P-almost every u> € £2, the functionf H-> X, (co) is continuous. More generally, it is possible to define similarly random variablesand stochastic processes with values on separable complete metric spaces, for example,finite-dimensional vector spaces.

Recall that afiltration Ft = (.4,)/>o is an increasing family of <r-algebras At\ i.e., fort > r, we have AT C At C A. The a -algebra At usually represents a certain past historyavailable at time?.

A stochastic process (X,),>o is Ft-adapted if for each t > 0, Xt is At-measurable.Following, e.g., [85], we will consider only filtrations Ft such that for all t > 0, At

contains the set jV of all the subsets A e A with P(A) = 0.For a given stochastic process Xt on (£2, A, P), it is possible to construct a filtration

Ft — (At)t>o by taking At as the smallest a-algebra such that Xr for all r < / andall the negligible subsets of A for P are At -measurable (we say that At is the a-algebragenerated by (XT)T<, and by A/")- The obtained filtration is called the natural filtration ofthe process Xt.

For a filtration F, = (At)t>o, we call stopping time a random variable r with value inR+ U {+00} such that, for all t, the event {r < t} e At.

For a filtration Ft(At)t>o, an F,-adapted stochastic process (Af,),>o is called a mar-tingale if

• E(|M,|) <+oo,

• for all T < /, E(M,|Fr) = Mr.

Notions on Ito's stochastic integral and stochastic differential equations are necessaryfor the following. We refer the reader, for example, to [79, 85, 104, 48].

The Black-Scholes Model. The Black-Scholes model [16, 97] is a continuous-timemodel involving a risky asset (the underlying asset) whose price at time t is 5, and a

2

For that, we have to make assumptions on the market: we assume that the transactionshave no cost and are instantaneous and that the market rules out arbitrage; it is impossibleto make an instantaneous benefit without taking any risk.

Pricing the option at maturity is easy. If ST is the spot price at maturity, then theowner of the call option will make a benefit of (5j- — K)+ = max(£7 — K, 0) by exercisingthe option and immediately selling the asset. Thus, assuming that there is no arbitrage, thevalue of the call on the expiration date is

Page 22: Achdou and Pironneau-Computational Methods Option Pricing

1.2. A Brief Introduction to Options

risk-free asset whose price at time / is 5,°: the evolution of Sf is found by solving theordinary differential equation

3

where r ( t ) is an instantaneous interest rate. Setting S® = 1, we find that

For simplicity, we suppose here that r is constant.The Black-Scholes model decomposes the return on the asset ^- as a sum of a

deterministic term jjidt (hence ^JL is an average rate of growth of the asset price), called thedrift, and a random term which models the price variations in response to external effects.More precisely, the Black-Scholes model assumes that the price of the risky asset is asolution to the following stochastic differential equation:

where Bt is a standard Brownian motion on a probability space (£2, A, P), i.e., a real-valuedcontinuous stochastic process whose increments are independent and stationary, with BQ = 0P-almost surely, E(B/) = 0, and E(5r

2) = t. It can be proved that, in the limit 8t ->• 0,the law of Bt+st — Bt is a Gaussian random variable with zero mean and variance St. Wecall Ft the natural filtration associated to Bt. Here at is a real process adapted to Ft. Thenumber a, is called the volatility. It is assumed that 0 < g_ < at < a for all t e [0, T].

The accurate mathematical meaning of (1.1) can be found in [79, 85, 104,48].For simplicity here, we assume that at is constant: at = a,Q<t<T. The value of

5, can be deduced from that of Bt by

Pricing the Option. The Black-Scholes model yields a formula for pricing the optionat t < T. There are many ways to derive formula (1.4)-(1.5). We choose to follow thearguments of Harrison and Pliska [67] (see also Bensoussan [12]), presented in the book byLamberton and Lapeyre [85]: Girsanov's theorem tells us that there exists a probability P*equivalent to P such that the price 5, satisfies the stochastic differential equation

where Wt — Bt + JQ ^-ds is a standard Brownian motion under P*. In other words,

under probability P*, the discounted price St = Ste~rt satisfies dSt = aStdWt, so it is amartingale; see [79, 85,104,48].

Then, it can be proved that it is possible to simulate the option by a self-financedportfolio containing Ht shares of the underlying asset and H® shares of the risk-free asset,i.e., to find a pair of adapted processes H® and Ht such that

Page 23: Achdou and Pironneau-Computational Methods Option Pricing

Chapter 1. Option Pricing4

and

Then since arbitrage is ruled out, the option's price must be given by

It is also possible to see that for a self-financed portfolio, one has

This implies that //,° -f HtSt is a square integrable martingale under P", and from (1.3), wehave

The essential argument for proving that the option can be simulated by a self-financedportfolio is a representation theorem for Brownian martingales, which states that for everysquare integrable martingale Mt for the filtration F,, there exists an adapted process H, suchthat^M, = HtdWt andE*(/#r

2dr) < +00.All the arguments above can be generalized when a, = cr(St, t) and when r, = r(r),

with, for example, r and a continuous functions such that 5 h-> So-(S, t) is a Lipschitzregular function of 5 with a Lipschitz constant independent of t, and a is bounded fromabove and away from 0 uniformly in t, and the Black-Scholes formula is

When the volatility at is a function of t and 5,, we will speak of local volatility. TheBlack-Scholes model with uniform coefficients is often too rough to recover the pricesof the options on the market, so a current practice is to calibrate the volatility surface(5, t) (->• a(S, 0 to fit the market prices.

Remark 1.1. The argument used in the original paper by Black and Scholes [16] andpresented in the book by Wilmott, Howison, andDewynne [117] is slightly different. Afterpostulating that Ct = C(St, t\ one constructs an instantaneously risk-free portfolio withone option and A, shares of the underlying asset: the choice of A, is called hedging. Fromltd's formula, the hedging factor A, is shown to be

Then one obtains a partial differential equation for C, with the infinitesimal generator of theMarkov process St. Finally (1.5) is obtained. This remark shows why precisely computingthe derivatives ofC is important.

Page 24: Achdou and Pironneau-Computational Methods Option Pricing

1.2. A Brief Introduction to Options

1.2.3 Other European Options

European Vanilla Put Options. A wide variety of contracts can be designed. Analogousto the vanilla call options are the vanilla put options: quoting [36], a European vanilla putoption is a contract giving its owner the right to sell a share of a specific common stock(whose price is St at time t) at a fixed price K at a certain date T. It is clear that the valueof the put option at maturity is

_5

Using the Black-Scholes model for pricing the put option, we obtain

The Put-Call Parity. Subtracting (1.7) from (1.5), we obtain that

which yields

since the discounted price e hr(T)dr St is a martingale under P*. The relation (1.8) is calledthe put-call parity.

Dividends. Pricing options on assets which yield dividends will be discussed in Chapter 2.

General European Options. Let Q° : R+ -> R+ be a function bounded on the boundedsubsets of M+ and such that ^p is bounded as S -> +00. It is possible to design a contractthat gives its owner the payoff Q°(Sr) at maturity T. The function Q° is called the payoffJunction. Following the arguments above, the value of this option at maturity is Q°(Sr),and at time t, 0 < t < T, the value of the option is

For example, the cash or nothing call option, with strike K, is the right to buy the asset at theprice ST — E if ST > K at. maturity T. The payoff function of this option is Q° (5) = Els>K.Similarly, the cash or nothing put option is the right to sell the asset at the price ST + E ifST < K at maturity T. Its payoff function is Q°(S) = E\S<K-

Barrier Options. A barrier option with payoff Q° and maturity T is a contract whichyields a payoff Q°(Sr) at maturity T, as long as the spot price St remains in the interval(a(t), b(t)} for all time t e [0, T]. For simplicity, we assume that a and b do not depend ontime. The option is extinguishable in the sense that its value vanishes as soon as St leavesthe interval (a,b). With the Black-Scholes model, one obtains a formula for the option'sprice:

where the expectation is computed under the risk neutral probability.

Page 25: Achdou and Pironneau-Computational Methods Option Pricing

Chapter 1. Option Pricing

European Options on a Basket of Assets. Consider a basket containing / assets, whoseprices Sj,, i = 1, . . . , / , satisfy the system of stochastic differential equations

6

where B\t,..., Bjt are 7 independent standard Brownian motions under probability P, andwhere the correlation coefficients p,)7 satisfy Pij = py,,, 1 < i < j < I. The process

, * , (Bit + Y~V,,, pi j B n ) is a standard Brownian motion, soV1+£;/.A?, }f

For a function Q° : (IR+)7 —>• R+, the European option on this basket of assets ofmaturity T and payoff Q° can be exercised at t = T for a payoff of Q°(S\r, • •., 5/7-).

As for the options on a single asset, it is possible to find a risk neutral probability P*under which the price of the option is

1.3 Constant Coefficients. The Black-Scholes Formula

Calling Q(S, t) thepriceof an option with maturity T and payoff function Q°, and assumingthat r and a are constant, the Black-Scholes formula is

and since under P*, WT — Wt is a centered Gaussian distribution with variance T — t,

When the option is a vanilla European option (noting C the price of the call and P the priceof the put), a more explicit formula can be deduced from (1.13). Take, for example, a call

where

Page 26: Achdou and Pironneau-Computational Methods Option Pricing

1.3. Constant Coefficients. The Black-Scholes Formula 7

Finally, introducing the upper tail of the Gaussian function

and using the new variable x + a \/T — t instead of x, we obtain the Black-Scholes formula.

Proposition 1.1. When a and r are constant, the price of the call is given by

and the price of the put is given by

where d\ and d2 are given by (1.15) and N is given by (1.16).

Remark 1.2. Ifr is a Junction of time, (1.15) must be replaced by

Remark 1.3. For vanilla barrier options with constant volatility, and when b = oo ora = 0 (see the paragraph on barrier options above), there are formulas similar to (1.17)and (1.18); see, for example, [117].

The Black-Scholes Formula Programmed with the GSL. There is a function in the GNUScientific Library (GSL) [59] for computing N(d): it is based on approximate formulasthat can be found in Abramowitz and Stegun; see [1]. The GSL is a very nice publicdomain package written in C for scientific computing. It includes programs for specialfunctions, linear algebra, approximate integration, fast Fourier transform, polynomials andinterpolation, random variables, etc. Here, we shall make use of two of these.

ALGORITHM i.i. GSL function calls.int gsl_sf_erf_Q_e (double x, gsl_sf_result * result);double gsl_sf_erf_Q(double x);

The program for computing a vanilla European call is as follows.

ALGORITHM 1.2. Black-Scholes formula using the GSL.// file exactBSgsl.cpp

#include <iostream>#include<gsl/gsl_sf_erf.h>using namespace std;

// .' Call premiumdouble Call(double S, double K, double r, double Vol, double theta)

Page 27: Achdou and Pironneau-Computational Methods Option Pricing

Chapter 1. Option Pricing

// !S: Stock price -- K: Strike -- r: riskless interest rate// !Vol: volatility -- theta: time to maturity

{if(S>0)

{double standard_deviation= Vol*sqrt(theta);double dl = (log(S/K)+r*theta)/standard_deviation

+ 0. 5*standard_deviatiort;

double d2 = dl - standard_deviation;return S*gsl_sf_erf_Q(-dl) - K*exp(-r*theta)* gsl_sf_erf_Q(-d2);

}else

return 0;

}

int main{){ cout«Call (111, 100, 0 .1, 0 .1,1) «endl;}

On Linux machines (and cygwin and MacOS X) this is compiled, linked, and executedby

g++ -c exactBSgsl.cppg++ exactBSgsl.o -Igsl. . . /a.out

Remark 1.4. The program below also computes the value of the Black-Scholes formula.Integrals are replaced by sums on quadrature points. The reader can check that this is muchslower than with the GSL, which uses special Junctions.

ALGORITHM 1.3. Black-Scholes formula by a naive method.double BSformula(double t, double S, double sig, double r, double K){ double dS=0.01, sig2=2*sig*sig*t, r2=r*t-sig2/4, aux=0;

for(double Sp=0.001; Sp<500; Sp+=dS)aux += ((K-Sp)>0?K-Sp:0)*exp(-pow(log(Sp/S)-r2,2)/sig2)*dS/Sp;

return aux * exp(-r*t)/sqrt(8*atan(l)*t)/sig;

}

1.4 Monte-Carlo MethodsFor a complete survey of Monte-Carlo methods in finance, a good reference is the book byGlasserman [60]. The book by Lyuu [91] also contains a lot of practical information.

1.4.1 Numerical Random Variables

In the C-library stdl ib. h, there is a function rand () which returns an integer value (oftype long int) uniformly distributed in [ 0 , RAND__MAX]. To obtain a Gaussian randomvariable one does the following.

8_

Page 28: Achdou and Pironneau-Computational Methods Option Pricing

1.4. Monte-Carlo Methods

is a Gaussian random variable N(0, 1) (with zero mean value, unit variance, and density1 _*2 /—-j=-e i ). Therefore x\f8t may be used to simulate Wt+st — Wt.V2jr

The C program (with a touch of C++) which uses these two ideas for S, and Ct is asfollows.

ALGORITHM 1.4. Pricing by Monte-Carlo.

#include <iostream>^include <math.h>^include <stdlib.h>#include <fstream.h>using namespace std;

const int M=500; // nb of time steps of size dtconst int N=50000; // nb of stochastic realizationconst int L=40; // nb of sampling point for Sconst double K = 100; // the strikeconst double left=0, right=130; // the barriersconst double sigmap=0.2, r=0.1; // vol., rateconst double pi2 =8*atan(l), dt=l./M, sdt =sqrt(dt), eps=l.e-50;const double er=exp(-r);

double gauss();double EDOstoch(const double x, int m) ;double EDOstoch_barrier(const double x, int m,const double Smin, const double Smax);double payoff(double s) ;

double gauss()

{return sqrt (eps-2 . *log (eps+rand() / (double)RAND_MAX) )*cos (randO *pi2/RAND_MAX) ;

}

double EDOstoch(const double x, int m)

{double S= x;for(int i=0;i<m;i++)S += S*(sigmap*gauss()*sdt+r*dt);

return S; // gives S(x, t=m*dt)

}

double EDOstoch_barrier(const double x, int m,const double Smin, const double Smax)

{

First make the change of scale

so that w e [0, 1].Now let wi, W2 be two independent random variables uniformly distributed in [0, 1];

then

9

Page 29: Achdou and Pironneau-Computational Methods Option Pricing

10 Chapter 1. Option Pricing

if ((x<=Smin)||(x>=Smax))return -1000;

double S= x;for(int i=0;i<m;i++)

{if ( (S<=Smin) | | (S>=Smax))

return -1000;S += S*(sigmap*gauss()*sdt+r*dt) ;

}return S;

}

double payoff(double s){ if(s>K) return s-K; else return 0,-}

int main( void )

{ofstream ff ("stoch.dat");for(double x=0. ;x<2*K;x+=2*K/L)

{ // sampling values for x=S

double value =0;double y,S ,-for(int i=0;i<N;i++)

{S=EDOstoch(x,M);

// S=EDOstoch_barrier(x,M, left, right); //for barrier optionsdouble y=0;if (S>= 0)y = er*payoff(S) ;

value += y;

}ff « x «"\t" « value/N « endl;

}return 0;

}

The program stores the result in a file called stoch.dat in a format that gnuplotcan use for graphics (see www.gnuplot.org). For barrier options, one has just to replacethe line EDOstoch(x,M) ; by EDOstoch-barrier ( x , M , left, right);. InFigure 1.1, we have plotted the price of the vanilla call option with payoff K = 100 oneyear to maturity, as a function of ^. The prices have been computed using Algorithm 1.4.In Figure 1.2, we have plotted the price of the barrier vanilla call option one year to maturitywith a = 0, b = 130 in Algorithm 1.4.

Project 1.1. Adapt the Monte-Carlo program above to compute a basket option with twoassets and run some tests. Implement one variance reduction method (see below) to speedup the program.

One can estimate the accuracy of the Monte-Carlo method by using the law of largenumbers.

Page 30: Achdou and Pironneau-Computational Methods Option Pricing

1.4. Monte-Carlo Methods 11

Figure 1.1. Computation of the call price one year to maturity by using the Monte-Carlo algorithm above. The curve displays C versus S. It has been obtained from the file"stoch.dat," which contains the values shown in Table 1.1, by using the public domainprogram gnuplot (and the command plot "stoch .dat" w 1).

Table 1.1. Content of the file stoch. dat generated by Algorithm 1.4. For claritywe have broken the single column into 5, so the numbers must be read left to right and downas usual.

0 0 0 0 0~0 0 0 0 7.02358e-05

0.00657661 0.0295531 0.0975032 0.298798 0.7483561.54013 2.77273 4.62055 7.06252 9.7359313.1792 17.1289 21.1632 25.7196 30.101635.0933 39.847 44.8094 49.4797 54.705959.5088 64.5122 69.5124 74.3284 79.438784.3937 89.3514 94.3428 99.6568 104.677

Theorem 1.2 (central limit). Let x be a random variable with probability density p,expectation E(JC), and variance

The approximation

satisfies, for all c\ < 0 < c%,

where P(y e Y) stands for the probability that y belongs to Y.

Page 31: Achdou and Pironneau-Computational Methods Option Pricing

12. Chapter 1. Option Pricing

Figure 1.2. The price of a barrier vanilla call option one year to maturity (K =100, a = 0, b = 130, a = 0.2, r = 0.1), computed by the Monte-Carlo method.

1.4.2 Random Variables Using the GSL

Users should know that rand () is never perfect and that after many calls there is someperiodicity in the answer. There are dedicated libraries which do a better and quicker job inthe case of Gaussian variables. The GSL [59] implements a number of different functionsto generate random variables. We give below a better implementation of the C-functiongauss () by the GSL with a slight modification in that it returns a Gaussian variable ofvariance dt instead of variance 1.

ALGORITHM 1.5. Gaussian function using the GSL.

ttinclude <gsl/gsl_rng.h>

^include <gsl/gsl_randist.h>

const gsl_rng_type *Tgsl=gsl_rng_default;

gsl_rng_env_setup();

gsl_rng *rgsl=gsl_rng_alloc(Tgsl);

double gauss (double dt) { return gsl_ran_gaussian(rgsl, dt) ; }

1.4.3 Variance Reduction

From the central limit theorem we see that the accuracy of the Monte-Carlo method forsimulating the expectation of X is controlled by ^/vai(X)/N. Thus the computing time fora given accuracy € behaves like vaJ}W. Therefore, any change of variables which decreasesa will be valuable.

There are several such transformations but no really general technique.

Page 32: Achdou and Pironneau-Computational Methods Option Pricing

1.4. Monte-Carlo Methods 13

Control Variates. To compute E(X) with a better precision one may instead computeE(X - X ' ) , where X' is a random variable with E(X') known and var(X - X') < var(X).Indeed E(X) = E(X - X'} + E(X') and E(X - X') will be known with better precision.To achieve var(X — X') < var(X') one must choose X' "close" to X. The difficulty is tochoose X'\ we present below a method proposed in Glasserman [60].

Obviously, the problem of estimating the mean X of a random variable X with variancevar(X) can be shifted to that of estimating the mean Z of Z = X — b(Y — F), for a givenconstant b, and for any given random variable Y for which Y is known.

A quick calculation shows that

is minimized when

where {X,-}7 (resp., {F,-1?) is a set of n samples of X (resp., Y}. Then

To apply this idea to the pricing of a European vanilla call at time t = 0 by Black-Scholesformula (1.5), we take

Let [SiY[ be n samples of ST obtained by integrating (1.1); then C0 = E*(Xr) = E*(Zr)with ZT = XT- b(YT - E*(Fr)), which yields

As seen in Figure 1.3, the convergence of the Monte-Carlo method is much improvedwith b chosen as above, when K -C SQ, and not so much otherwise (see Glasserman [60]).

Antithetic Variates. Consider the stochastic ordinary differential equation with a changeof sign in the term containing the Brownian motion and the process f, given by

Then

Page 33: Achdou and Pironneau-Computational Methods Option Pricing

14 Chapter 1. Option Pricing

Figure 1.3. Errors on the price of the vanilla call option one year to maturity(K = 100, r = 0.1, CT = 0.2) with the standard Monte-Carlo method and with variancereduction methods.

A Program. The control variates (variable Y below) and the antithetic variates (variableZ below) are implemented and compared to the standard Monte-Carlo method.

ALGORITHM 1.6. Variance reduction by control variate.int main( void )

{const int M=100;const int N=10000;

////

nb of time steps of size dtnb of stochastic realization

since the function x \-> (x — K)+ is monotone and the two variables St and 5, are negativelycorrelated. Therefore we have obtained a new process with the same expectation and witha smaller variance. To simulate S~ one reuses the same random variables used for 5,, sothe additional operation count is small. Note that this technique needs a monotone payofffunction.

because 5, and 5, have the same law, and

Page 34: Achdou and Pironneau-Computational Methods Option Pricing

1.5. Other Options 1_5

const int L=100; // rub of sampling point for 5const double K = 100, sigmap=0.2, r=0.1;const double dt=l./M, sdt =sqrt(dt), er = exp(r);double X, Y, Z;ofstream ff("comp.dat");for(double x=70.;x<130;x+=2*K/L)

{double meanY=x*er, meanX =0,meanZ=0, barY=0;double varX=0, varY=0, Exy=0;for(int i=0;i<N;i++)

{double Sl=x,S2= x;for(int ii=0;ii<M;ii++)

{double y = sigmap*gauss()*sdt;51 += SI*(y+r*dt);52 += S2*(-y+r*dt);

}Y = SI; Z =(phi_T(Sl)+phi_T(S2))/(2*er);X = phi_T(Sl)/er;meanX += X; meanZ += Z; barY+=Y;Exy+=X*Y; varX+=X*X; varY+=Y*Y;

}meanX /=N; meanZ /= N; barY/=N;varX = varX/N - meanX*meanX;varY = varY/N-2*meanY*barY + meanY*meanY;Exy = Exy/N - meanX*barY;double b = Exy/varY, C=meanX -b*(barY-meanY);double exact = Call(x, K, r, sigmap, 1.);ff « x «"\t" « meanX-exact« '\t'

« meanZ-exact «'\t' «C-exact «endl;

}return 0;

}

1.5 Other Options

1.5.1 American Options

An American vanilla call (resp., put) option is a contract giving its owner the right to buy(resp., sell) a share of a specific common stock at a fixed price K before a certain date T.More generally, for a payoff function Q°, the American option with payoff Q° and maturityT can be exercised at any t < T, yielding the payoff Q°(St). In contrast to Europeanoptions, American options can be exercised anytime before maturity. Since the Americanoption gives its owner more rights than the corresponding European option, its price shouldbe higher.

Consider, for example, an American vanilla put: if Pt were less than K — St, then onecould buy a put and a share of the underlying asset and immediately exercise the option,making a risk-free immediate benefit of K — St — Pt > 0; this is ruled out by the no-arbitrageassumption, so we see that Pt > K — St. More generally, the value at time t of an Americanoption with payoff Q° is always larger than Q°(St).

Page 35: Achdou and Pironneau-Computational Methods Option Pricing

16 Chapter 1. Option Pricing

Using the notion of strategy with consumption, the Black-Scholes model leads to thefollowing formula for pricing an American option with payoff Q°: under the risk neutralprobability,

where 77,r denotes the set of stopping times in [t, T] (see [85] for the proof of this formula).For an American vanilla put, with a and r constant, this gives

It can be seen that for an American vanilla call, the formula (1.25) coincides with(1.5), so American and European vanilla calls have the same price. This means that anAmerican vanilla call should not be exercised before maturity.

For a Monte-Carlo simulation of an American option, one performs the same type ofMonte-Carlo simulation as for European options but then takes the sup for all times r e [t, T]so as to obtain a realization of Pt. Then by doing this N times and taking the average, oneobtains Pt for one value of S. In practice this is quite expensive and one may prefer binomialtrees (see below) or finite difference or finite element methods (see Chapter 6).

Project 1.2. Program a Monte-Carlo method for American options. Study the influence ofN: plot the results. Apply a method of variance reduction and program it (see, for example,Lapeyre and Sulem [87]|

1.5.2 Asian Options

A typical example of an Asian option is a contract giving its owner the right to buy anasset for its average price over some prescribed period. Depending on how the average iscomputed, there can be many kinds of Asian options. For example, one can use arithmeticaveraging

or geometric averaging

A simple example of an Asian option is the call (resp., put) with floating strike whichgives its holder the right to buy (resp., sell) the underlying asset at A(T) at maturity T. Atmaturity, the price of the call (resp., put) option is (SV — AT)+ (resp., (Sr — AT}-).

Another example is that of a call (resp., put) which gives its holder the right to buy(resp., sell) the underlying asset at K — AT + ST at maturity T, for a fixed strike K. Atmaturity, the price of the call (resp., put) option is (AT — K)+ (resp., (K — AT)-). Suchan option is termed Asian option with fixed strike.

More generally, for a function Q°\ M+ -> R+, it is possible to define the Asian optionwith payoff Q°(ST,AT).

Page 36: Achdou and Pironneau-Computational Methods Option Pricing

1.6. Complement: Binomial Trees 17

The Black-Scholes model yields the formula

for the price of the Asian option at time /, where the expectation is computed under therisk neutral probability. A Monte-Carlo simulation to price an Asian option with arithmeticaveraging is as follows.

• SQ given, set A — 0.

• For(r = 0;t < T; t = t + 8t)

- call the random generator to simulate Wt+&t - Wt;

- compute St+st = S,(l + r8t + Wt+St - Wt);

- doA = A + £(St + St+St).

• Compute e~rTQ°(S, A).

• Repeat the above to obtain M values and average them.

Another class of Asian options involves the extremal values of the asset price fort < T: they are called lookback options. The floating strike lookback call has a payoffof (Sr — mino<T<r ST)+, whereas the lookback put has a payoff of (maxo<T<r ST — ST)+.Similarly, the fixed strike lookback call (resp., put) has a payoff of (maxo<T<r 5r — K)+(resp., (K — mino^T^r Sr)+). One can also define lookback options on averages. For afunction Q° : ]R+ -> R+, for m? = mino<r<r ST and Mj = maxo<r<r Sr, it is possible todefine Asian options with payoff Q°(ST, AT, mT, MT), and the price of the option at t is

1.6 Complement: Binomial Trees

The second most popular numerical method for pricing options is akin to Bellman's dynamicprogramming and uses a tree of possible events, the so-called binomial option pricing model.It leads to quite a good numerical method which is also easy to understand.

1.6.1 The Tree for S

Consider the very simple situation where the underlying asset (i.e., Sn = St, t = n8t) canevolve in only two ways:

• either it goes up by a factor u > 1: Sn+i = uSn with probability p, or

• it goes down by a factor d < 1: Sn+i = dSn with probability 1 — p.

So if we denote by S™ one of the possible values of 5 at stage n, at the next stage we canhave

Page 37: Achdou and Pironneau-Computational Methods Option Pricing

18 Chapter 1. Option Pricing

Note that at n = 0, SQ is known; then at n = 1, Si € {wSo, ̂ -$b}, at n — 2, 52 6{«2So, udSo, d2So} with probability p2, 2p(l — p), (1 — p)2, and so forth.

At n = 2 the mean value of 5? is

The factor 2 is because the middle state can be reached either by So -> U$Q ->• wdSo or bySQ -> dSo —>• udSo with the same probabiUty p(\ — p).

Similarly, the variance of 52 is

After N steps, we have

the state &• = uN~jdj occurring with probability ( JN ) p N ~ j ( l - p)j, where (}

N) =are the binomial factors.

The problem now is to see what are the conditions necessary on d, u, p for Sn —^ 5,with t = nSt, N = T/St ->• CXD, and dS, = 5,(rd/ + adWt).

Note first that the expectation of Sn+i knowing Sn is (up + d(\ — p})Sn, and itsvariance is

When dS/ = S,(rd/ + ardWt), under the risk neutral probability P*, the mean andvariance of 5, are Sne

rSt and S2le

(-2r+a )St, and therefore it is necessary that

r&t

and

We have two equations for three variables, so there remains to add a third arbitraryequation: a popular choice is

which implies

Another choice is

which yields

and

Page 38: Achdou and Pironneau-Computational Methods Option Pricing

Since the values C# are known from the payoff function, this recurrence can be used withdecreasing n.

Notice that it is not necessary to store all the intermediate values, and one can use thesame memory for C™ and C™+1.

ALGORITHM 1.7. European call by binomial tree.

double binomial(const double SO)

{double disc = exp(-r*dt);double u = (1+sqrt(exp(sigmap*sigmap*dt)-1))/disc;double d=(1-sqrt(exp(sigmap*sigmap*dt)-1))/disc, p=0.5;

S[0] = SO;for(int m=l; m<M; m++){

for(int n=m; n>0; n--)S[n] = u*S[n-l] ;

S[0] = d*S[0] ;}for(int n=0,-n<M,-n++)

C[n] = S[n] >K?S[n] -K:0 ;for(int m=M- l ;m>0 ;m- - )

for(int n=0; n<m,-n++)C[n] = (p*C[n+l] + (l-p) *C[n] )*disc;

return C [0];

the expected value of Cn+\ knowing Cn = C™ is pC^ff- + (1 - p)C™+1, so the analogueto (1.5) is

It is not difficult to see that Cn — (Sn — K)+ att = n8t also has only two possible changes,a growth or a decrease, and that a two-stage change "up-down" is the same as a "down-up."Thus let C™, m = 0 , . . . , n, be the possible values of Cn. Because C™ increases to C^1

with probability p or decreases to C™+1 with probability 1 — p,

Although (1.27) could be programmed directly, it is much faster to give a name to theintermediate states of S and C and use a backward induction relation.

Let S™ = dmun-mS0 be the mth possible value of Sn. Then

1.6. Complement: Binomial Trees 19

1.6.2 The Tree for C

By definition, the price of the European vanilla call option can be approximated by

Page 39: Achdou and Pironneau-Computational Methods Option Pricing

20 Chapter 1. Option Pricing

Figure 1.4. Results for the call price one year to maturity by using the binomialtree method with p = 0.5 and 500 time steps. The curve displays C versus S. It hasbeen obtained by Algorithm \ .7. For comparison we have also plotted the results with astochastic method using only 500 samples (the dashed line).

void main() {for(int i=0;i<nx;i++){ double x=(2.*K*i) /nx ;

cout « "C_0("«x«")

}}

= "«binomial (x) «endl;

In Figure 1.4 we have plotted the price of a vanilla call option with strike K = 100one year to maturity, as a function of the spot price. The prices have been computed by thebinomial tree method of Algorithm 1.7.

Remark 1.5. Note that the algorithm has O(M2) operations and can be slow for large M.There are implementations which are O(M) (see, e.g., [91]).

Trees can be used for pricing American options; see [36, 117, 91]. The principle isthe same but in the backward induction one must check that the expected profit is higherthan the current one Soun~mdm. An American put can be implemented as follows.

ALGORITHM 1.8. Binary tree for an American put.double binomial(const double SO)

{double disc = exp(-r*dt);double u = (1+sqrt(exp(sigmap*sigmap*dt)-1))/disc;double d=(1-sqrt(exp(sigmap*sigmap*dt)-1))/disc, p=0.5;

Page 40: Achdou and Pironneau-Computational Methods Option Pricing

1.6. Complement: Binomial Trees 21

S[0 ] = SO; urn [0] =1; d u [ 0 ] = l ;for( int m=l ; m<M; m++){

for( int n=m; n>0; n - - )S[n] = u*S[n-l] ;

S [0 ] = d*S[0] ;um[m] =u*um[m-l] ; du [m] =d*du [m-1] /u;

}for(int n=0/n<M;n++)

P[n] = S[n] >K?0 :K-S[n ] ;for( int m = M - l ; t n > 0 ; m - - )

for(int n=0; n<m;n++){ P[n] = (p*P[n+l] + ( l -p )*P[n] ) *disc;

double gain=K-SO*um[m]*du[n];// pow(u,m-n) *pow(d,n) /

i f ( P [ n ] < a u x ) P[n]=gain;

}return P [ 0 ] ;

}

Notice that to save computing time, um and dm are precomputed and stored andum~ndn is written as um(d/u)n. There are ways to reduce the computing time by elimina-tions of trivial branches in the algorithms, but the method remains inherently O(M2), i.e.,slow for large values of M.

Project 1.3. Study the influence of the choice ofp, u, d on the results. Plot a convergencecurve for the Li-norm of the error as a function of St. Present the results of error estimations(search the literature, [87] in particular). Study the case of American options and adapt theprograms to the case where a depends on S. Adapt the programs to the case of a dividendpaying stock (see §2.3).

Page 41: Achdou and Pironneau-Computational Methods Option Pricing

This page intentionally left blank

Page 42: Achdou and Pironneau-Computational Methods Option Pricing

Chapter 2

The Black-ScholesEquation: MathematicalAnalysis

2.1 OrientationThe Black-Scholes model introduced in Chapter 1 gives the option prices as expectationsof random variables computed from the solution to a stochastic differential equation.

Ito's calculus allows the derivation of a partial differential equation of parabolic typefor such mean quantities. We shall first recall how the partial differential equation associatedto the Black-Scholes model is derived; then we shall study it in detail by variational methodsand solve the following problems:

• What are the conditions for the parabolic problem to be well-posed?

• What are the qualitative properties of the solutions to the parabolic boundary valueproblems? In particular, is there a singularity at the origin 5 = 0? What is theregularity of the solutions? Is there a comparison principle between solutions tothe partial differential equation?

Next, we consider the price of a vanilla European option as a function of the strike Kand of maturity T, for a fixed spot price: it turns out this function is a solution to a partialdifferential equation in the variables K and T, known as Dupire's equation [41]. We willuse this equation later for calibration.

The chapter ends with similar considerations for other options:

• barrier options,

• basket options,

• options with stochastic volatilities,

• options built on LeVy processes.

The Black-Scholes model involves a risk-free asset whose price 5° satisfies the dif-ferential equation dS° = r(t)S°, and a risky asset under a probability P and a filtrationFt, whose price St satisfies the stochastic differential equation dSt = St(^dt + crdBt),where Bt is a standard Brownian motion. Here the volatility a may depend on time and on

23

Page 43: Achdou and Pironneau-Computational Methods Option Pricing

2.2 The Partial Differential Equation

2.2.1 Infinitesimal Generator of the Diffusion Process

It is possible to relate the function 0 in (2.1) to the solution of a parabolic partial differentialequation. The operator corresponding to this partial differential equation appears in a naturalway in the following result.

Proposition 2.1. Assume that the functions cr(S, t) and r(t) are continuous nonnegativeand bounded, respectively, on R+ x [0, T] and [0, T], and that S h-> Sa(S, t) is Lipschitzcontinuous with a constant independent of t. Then, for any function u : (5,0 (->• u(S,t)continuous in R+ x [0, T], Cl-regular with respect to t and C2-regular with respect to S inR+ x [0, T), and such that \Sj&\ < C(l + 5) with C independent of t, the process

is a martingale under Ft, where L, is the differential operator

The differential operator Lt is called the infinitesimal generator of the Markov process St.

Proof. From the assumptions on r and CT, we know that 5, is a square integrable process,i.e., E*(S,2) < +00. Thanks to Ito's formula,

24 Chapter 2. The Black-Scholes Equation

the price of the underlying asset, i.e., a = a(St, /). We assume that the functions a(S, t)and r(0 are continuous nonnegative and bounded, respectively, on R+ x R+ and R+, andthat S i-> Sa(S, /) is Lipschitz continuous with a constant independent of t, which ensurethe existence and uniqueness of a square integrable 5,. As seen in Chapter 1, under theBlack-Scholes assumption, there exists a probability P* equivalent to P (the risk neutralprobability) such that W, = Bt + /0' ^-^-ds is a standard Brownian motion, and the priceof a European option with payoff PQ and maturity T is given by

(Ft is the natural filtration of Wt). In the case of vanilla calls and puts with constant interestrate r, we have

Page 44: Achdou and Pironneau-Computational Methods Option Pricing

2.2. The Partial Differential Equation 25

which yields, from the definition of M,,

Therefore, M, is a martingale, because from the assumptions on a and u,

andE*(Mr|F,) = Mr.

Theorem 2.2. Assume that a and r are continuous nonnegative and bounded, and thatS i-» Scr(S, t) is Lipschitz continuous with a constant independent oft. Consider a functionP : R+ x [0, T] -» R, continuous in R+ x [0, T] and Cl-regular with respect to t andC2-regular with respect to S in R+ x [0, T), such that |S|j|<C(l+S) with C independentoft. Assume that P satisfies

and

then, with <f> given by (2.1), we have <j) = P.

Proof. Aoolvine Pronosition 2.1 to u — P. the solution to (2.3X (2.4 Y we eet

which is exactly the desired result.

The problem (2.3), (2.4) is a backward-in-time parabolic boundary value problem,with a terminal Cauchy condition. Henceforth, we shall refer to (2.3) as the Black-Scholesequation. We are going to study in detail a weak formulation of the boundary value problem.Before that, we give some considerations on the asymptotics of the solutions to (2.3), (2.4)for large values of 5, and on the Black-Scholes equation written in the variables (log(S), ?)•

2.2.2 Vanilla Options: Behavior for Extremal Values of S

We give here heuristic considerations which will be fully justified in §2.3. For simplicity,we assume that the interest rate r is constant. By construction we have that

Furthermore if the financial model is reasonable, the call option should always be less thanthe underlying asset: Ct < St. Applied at S = 0 this gives C(0, t) = 0 for all t. Then theput-call parity implies P(0, t) = Ke~r(T~t}.

On the other hand, when S is very large, the put option becomes useless, so we expectP(S, 0 to vanish as 5 -> oo, and by the put-call parity, C « S - Ke~r(T~t}.

Page 45: Achdou and Pironneau-Computational Methods Option Pricing

26 Chapter 2. The Black-Scholes Equation

From a mathematical point of view, it is important to understand that the behavior ofP or C for small and large values of 5 need not be imposed in order to have a well-posedproblem. We shall see later that along with the Black-Scholes partial differential equation,the terminal condition at T and a very weak growth condition for large values of S (namely,C(5, 0 is negligible compared to e*1^ (5) for any rj > 0) suffice to determine completelythe price of the option. Similarly, in the numerical simulations, it will not be necessary toimpose explicitly the value of the option at S = 0.

2.2.3 The Black-Scholes Equation in Logarithmic Prices

We consider the vanilla European call. It is convenient to set

Notice that

So, for a call, (2.3) becomes

The advantage of (2.7) is that it has constant coefficients, so we shall be able to recast it intothe heat equation, after suitable changes of variables.

We set <p(x, 0) = \lr(x, 6}eae+bx, with b = \ - £ and a = -r - ^b2. We obtainthat \jr satisfies

and the growth of ty at infinity is known thanks to (2.7). Therefore,

because

is the fundamental solution to (2.7). This representation formula is another way of obtain-ing (1.17).

Page 46: Achdou and Pironneau-Computational Methods Option Pricing

2.3 Mathematical Analysis 27

2.3 Mathematical Analysis of the Black-Scholes Equationwith Local Volatility

We consider the Black-Scholes equation for a European option with a local volatility, i.e., ais a function of 5 and t, and with a variable interest rate. In this section, it will be convenientto replace the time variable t by the time to maturity T — t; doing so, we get a forwardparabolic equation: for S > 0 and t e (0, T],

with the Cauchy data

where PQ is the payoff function.

Remark 2.1. It is easy to see that for all a e R, b € R, the function P(S, t) = aS+be~ fo r^dT is a solution to (2.9), and it is also clear that such a junction cannot satisfy theCauchy condition (2.10) when PQ is not an affine function.

Dividends. Discretely paid dividends cause jumps on the price of the underlying asset:if a dividend D is paid at time to maturity t, then the process S, satisfies

because arbitrage is ruled out. On the other hand, the option price must not jump at t,because the option's owner does not get any benefit from the dividend, and because thedividend and date are known in advance. Therefore, the pricing function P(S, t) (here t isthe time to maturity) should satisfy

This means that the pricing function jumps at t: one has to integrate (2.9) in the time interval(0, t), implement the jump condition (2.11), and integrate again (2.9) till the next dividend.This means that, when using a discrete method to compute P with a subdivision (t{);€{O,...,M}of the time interval [0, T], then the date of a discretely paid dividend should coincide withsome t{, so that (2.11) above can be implemented.

Note that if, for each time t, the asset pays out a dividend q(t)Stdt in dt, then theequation becomes

This equation is of the same nature as (2.9), and if q is sufficiently well behaved, then (2.12)does not imply any additional mathematical difficulties.

Thus, in most cases, we will assume that q = 0, and that there are no discretely paiddividends.

Page 47: Achdou and Pironneau-Computational Methods Option Pricing

28 Chapter 2. The Black-Scholes Equation

Strong Solutions to (2.9), (2.10). The Cauchy problem (2.9), (2.10) has been very muchstudied: it is proved, for example, in [55] that if

• the function (S, t) t->- Scr(S, t) is Lipschitz continuous on R+ x [0, T] (this conditioncan be weakened by considering only Holder regularity),

• the function a (5, t) is bounded on R+ x [0, T] and bounded from below by a positiveconstant,

• the function t (->• r(t) is bounded and Lipschitz continuous (this assumption can berelaxed),

• the Cauchy data PQ satisfies 0 < Po(S) < C(l + 5) for a given constant C,

then there exists a unique function P € C°(R+ x [0, T]), C1-regular with respect to t inR+ x (0, r] and C2-regular with respect to S in R+ x (0, T], which is solution to (2.9), (2.10)and which satisfies 0 < P(S, t) < C'(l + S) for a given constant C'.

The function P is called a strong solution to the Cauchy problem. In what follows,we present the concept of weak solutions to (2.9), (2.10), which is fundamental for thedevelopment of many numerical methods presented in this book.

General Orientation. In what follows, we are going to present mathematical results aboutthe Cauchy problem (2.9), (2.10): the concept of weak solutions to parabolic equations, asin [90, 21], will be central. The idea behind it is that there is a natural energy associated to(2.9). This leads us to introduce a suitable Sobolev space (the space of functions for whichthe above-mentioned energy is defined), and to define the concept of weak solutions to (2.9),(2.10). Then the abstract theory of [90] will yield the existence and uniqueness of such a weaksolution, yet without giving much information on its regularity. The next step will consist inobtaining regularity results depending on the regularity of the payoff function. We will alsopresent the weak maximum principle, which will permit us to compare various solutions to(2.9), and to obtain bounds and qualitative results. For instance, the put-call parity will beproved as a consequence of the maximum principle. Finally, we shall treat the case of anoption on a basket of assets, showing that the theory extends very naturally to this case.

Note also that in addition to being a very general mathematical tool, the weak orvariational formulation to (2.9), (2.10) will be the ground for the finite element method forthe numerical approximation of (2.9), (2.10).

2.3.1 Some Function Spaces

We denote by L2 (R+) the Hilbert space of square integrable functions on R+, endowed withthenorm||u||L2(K+) = ( j ^ v ( x ) 2 d x ) ^ and the inner product (u, uOz,2(R+) = L v(x)w(x)dx.Calling £>(R+) the space of the smooth functions with compact support in R+, we knowthat £>(R+) is dense in L2(R+).

Let us introduce the space

Page 48: Achdou and Pironneau-Computational Methods Option Pricing

2.3 Mathematical Analysis 29

It is clear that the functions of W vanish at x — 0. The space W endowed with the norm\\w\\w = ||^||L2(E+) is aHilbert space, whichis topologically isomorphic to L2(R+)- ThusW is separable.

Lemma 2.3. The space £>(R+) is dense in W.

Proof. Consider a function w e W: w(x) = f* (j)(s)ds, with 0 e L2(R+). We know thatD(E+) is dense in L2(R+), so we can find a sequence of functions (<pm)m^, <Pm € £>(R+),converging to 0 in L2(R+). Therefore, the sequence (wm)m€N : Wm(x) = JQ <j>m(s)dsconverges to w in W. The function wm is smooth but its support may not be compact in R+.Let us modify it slightly by introducing a smooth nonnegative function \fr on R+, with totalmass 1, and supported in the interval (1,2), and by setting, for a small positive parameter e,(f)m € ( x ) = <j)m(x) — e\lf(€x} JR (f>m(s}ds: this function is contained in £>(R+) and its total

mass is 0. Now, if wm^(x) = f* (f)m^(s)ds,

and JTO \}s2(€s)ds < j, so choosing m large enough, then € small enough, ||u> — tu m i e l lwcan be made as small as desired. The result is proved. U

Lemma 2.4 (Hardy's inequality). Ifw e W, then ^ e L2(R+), and

Proof. From Lemma 2.3, it is enough to prove (2.14) forw e D(R+). Clearly, lljll^d^.) =

L -^(/Q w'(s)ds)2dx, and integrating by parts, we obtain that

where the last estimate comes from the Cauchy-Schwarz inequality.

From Lemma 2.4, we can define the space V:

It is clear that a function v e V is continuous on R+, for xv is continuous on [0, +00).

Lemma 2.5. We have the identity

where the derivative must be understood in the sense of the distributions on

Page 49: Achdou and Pironneau-Computational Methods Option Pricing

30 Chapter 2. The Black-Scholes Equation

Proof. A function v e L2(R+) satisfies xv e W if and only if £(xv) e L2(R+), by thedefinition of W. This is equivalent to x^ e L2(R+) because

From Lemma 2.5, we can endow V with the inner product (v, w)v = (v, w) +(x j±, x^j), and with the Euch'dean norm \\v\\v = -V(v, v)v, and one can check easily thatV is a Hilbert space.

Lemma 2.6. TTze space ^(M+) is dense in V.

Proof. A function v e V if and only if xv e W. Using Lemma 2.3, let (u;w)m€N be asequence of functions in 2?(R+) converging to xv in W. The functions vm = ^ belong to£>(R+), and converge to v in L2(R+) by Lemma 2.4. Furthermore, * ̂ = ^ - ^. Thefirst term of this sum converges to j^(xv) in L2(R+), whereas the second one converges tov in L2 (R+). Therefore, x *jf converges to x £ in L2 (R+).

Lemma 2.7 (Poincare's inequality). I f v e V , then

which yields the desired estimate.

From Lemma 2.7, we see that the seminorm \v\v = ||^^||L2(R+) is m fact a normon V, which is equivalent to || • ||y. In the same manner, using the density of T>(R+) inL2(R+), one can prove the following result.

Lemma 2.8. I f w e L2(R+), then the function v, v(x) = j J^ w(s)ds belongs to V, andthere exists a positive constant C independent of w such that \\v\\y < \\w\\ L2(R+).

We denote by V the topological dual space of V. For simplicity, we also denote by(•, •) the duality pairing between V and V, and we define || • || y> by

Using the Cauchy-Schwarz inequah'ty on the left-hand side of this identity, we deduce that

Proof. From Lemma 2.6, it is enough to prove (2.17) for v e £>(R+): we have

Page 50: Achdou and Pironneau-Computational Methods Option Pricing

2.3 Mathematical Analysis 31

2.3.2 The Weak Formulation of the Black-Scholes Equation

Let us multiply (2.9) by a smooth real-valued function </> on R+ and integrate in S on R+.Assuming that integrations by parts are permitted, we obtain

This leads us to introduce the bilinear form at,

We make some assumptions on a and r: we assume that the coefficients a and r > 0are continuous (only for simplicity), and that a is sufficiently regular so that the followingconditions make sense.

Assumption 2.1.

1. There exist two positive constants, g_ and Zf, such that for all t e [0, T] and allSeR+ ,

2. There exists a positive constant Ca such that for all t e [0, T] and all S e

Lemma 2.9. Under Assumption 2.1, the bilinear form at is continuous on V; i.e., thereexists a positive constant /u such that for all v, w € V,

Page 51: Achdou and Pironneau-Computational Methods Option Pricing

32 Chapter 2. The Black-Scholes Equation

Proof. If u, w € V, then using (2.17), (2.20), (2.21) and calling R = maxf€|0.r] r(0,

which yields (2.22) with

It is possible to associate with the bilinear form a, the linear operator A,: V -> V;for all v, w e V, (A,i>, w) = at(v, w). The operator A, is bounded from V to V.

We define C°([0, T]; L2(R+)) as the space of continuous functions on [0, T] withvalues in L2(R+), and L2(0, 7; V) as the space of square integrable functions on (0, T)with values in V. Assuming that PQ e L2(R+), and following [90], it is easy to write aweak formulation for (2.9), (2.10).

Weak Formulation of (2.9), (2.10). Find P e C°([0, T}\ L2(R+)) n L2(0, T; V), suchthat |f e L2(0, 7; V), satisfying

In order to apply the abstract theory of Lions and Magenes [90], we need the followingestimate.

Lemma 2.10 (Garding's inequality). Under Assumption 2.1, there exists a nonnegativeconstant X such that for all v e V,

Proof. If v e V, then using (2.17), (2.20), (2.21) and calling R = max,e[0,r] r(f),

where X = (R + a + Caa)2/(CT2). This achieves the proof.

Page 52: Achdou and Pironneau-Computational Methods Option Pricing

2.3 Mathematical Analysis 33

Theorem 2.11. If PQ e L2(R+), and under Assumption 2.1, ?/ze weak formulation (2.23),(2.24) /i«5 a unique solution, and we have the estimate, for all t, 0 < t < T,

With Assumptions 2.1 and 2.2, it is possible to prove what is called a smoothingeffect: the solution to (2.23), (2.24) belongs to D at any time t > 0, for any Cauchy dataPQ € L2(R+). More precisely, Assumptions 2.1 and 2.2 ensure that

• the domain of A, is D, which is dense in L2(R+) and independent of t;

• we have the Garding's inequality (2.25);

• if At = At + A/, there exists a constant L such that

Proof. The proof is given in [90]. The estimate (2.26) is obtained by taking v = P(t)e 2Xt

in (2.24), using (2.25) and integrating in time between 0 and t.

Note that Theorem 2.11 applies for any European option with a payoff function inL2(R+), in particular to vanilla puts. It does not apply to vanilla calls, and we will comeback to this later.

2.3.3 Regularity of the Weak Solutions

If the interest rate, the volatility, and the payoff are smooth enough, then it is possible toprove additional regularity for the solution to (2.23), (2.24).

Calling At the unbounded operator in L2(R+),

it can be checked that for all / e [0, T] and for A. given in Lemma 2.10, the domain of At + A.is

Assumption 2.2. There exist a positive constant C and 0 < a. < 1 such that for allti,t2 € [0, T] and S € M+,

With these three facts, we can apply a general result of Kato on parabolic evolution equations(see [98, Theorem 5.6.8] and [25]) and obtain the following result.

Page 53: Achdou and Pironneau-Computational Methods Option Pricing

34 Chapter 2. The Black-Scholes Equation

Theorem 2.12. Under Assumptions 2.1 and 2.2, for all s, 0 < / < T, the solution P of(2.23), (2.24) satisfies P e C°([t, T]: D) and %- e C°([t, T]: L2(R+)), and there exists aconstant C such that for all t, 0 < t < T,

If PQ € D, then the solution P of (2.23), (2.24) belongs to C°([0, T}\ D} and |f €C°([0, T]- L2(R+)).

Remark 2.2. Note that for the second part of Theorem 2.12, it is possible to relax Assump-tion 2.2.

Let us give a mild regularity result when PQ e V.

Proposition 2.13. If Assumption 2.1 is satisfied and if PQ e V, then the solution to (2.23),(2.24) belongs to C°([0, T]; V) n L2(0, T; D), |f e L2(0, T; L2(E+)), anJ f/iere exists anonnegative constant A. such that the estimate

Proof. Consider first the case when the coefficients of (2.9) satisfy Assumptions 2.1 and2.2: calling <2 = ff and taking the derivative of (2.9) with respect to 5, one obtains in thesense of distributions

holds.

and by multiplying by 5, we obtain with W = SQ

which can be written in the shorter form

where Bt is given by

Under Assumption 2.1, Bt is a linear operator from V to V, bounded uniformly with respectto t, and it is possible to prove Garding's inequality: there exists a nonnegative constant A.such that, for all v e V,

Page 54: Achdou and Pironneau-Computational Methods Option Pricing

2.3 Mathematical Analysis 35

Under the assumptions of Theorem 2.12, the terms in (2.33) belong to L2(0, T\ V), so it ispossible to take the duality product with W(S, t}e~2Kt and to integrate in time. One obtains

With some technical arguments that can be skipped, it is possible to prove that the estimate(2.30) holds if P0 e V and if the volatility satisfies only Assumption 2.1. Indeed,

• D is a dense subspace of V so it is possible to approximate P0 in V by a sequence offunctions Po,e e D;

• forp>l large enough, it is possible to approximate the interest rate r by nonnegativesmooth functions re, uniformly bounded and such that re -> r in Lp((0, T));

it is possible to approximate the volatility a by nonnegative smooth functions cre,obeying Assumption 2.1 uniformly and Assumption 2.2 with a constant C€, and suchthat ae -» a and Sf| -> Sff in Z/(o>), for all compact a> of E+ x [0, T] and forall p < +00.

We call P€ the solution to the Black-Scholes equation with payoff PO,O interest ratere, and volatility a€. Thanks to (2.30), it is possible to extract a subsequence still calledPe that converges weakly * in L°°(0, T; V) and weakly in L2(0, T; D) and such that ^converges weakly in L2(R+ x (0, T)). The limit satisfies (2.30) a.e. in t. On the otherhand, by passing to the limit as e -> 0, one sees that the limit of Pe must satisfy (2.9) in thesense of distributions and (2.10). Therefore, the limit is the unique solution P to (2.23),(2.24).

Remark 2.3. As a consequence of Proposition 2.13, the solution to (2.23), (2.24) is contin-uous if Assumption 2.1 is satisfied and PQ e V.

Note that Proposition 2.13 and Remark 2.3 apply to a European vanilla put: indeed,

2.3.4 The Maximum Principle

We are going to give a maximum principle for weak solutions of (2.9). The solutions of(2.9) may not vanish for 5 —*• +00. Therefore, we are going to state the maximum principlefor a class of functions much larger than V; see [102] for a reference book on the maximumprinciple. We define

and using Garding's inequality, and the fact that W = S|j, we find (2.30), i.e.,

Note that the polynomial functions belong to V.

Page 55: Achdou and Pironneau-Computational Methods Option Pricing

36 Chapter 2. The Black-Scholes Equation

We are going to use the truncation method of Stampacchia. With this aim, we define,for v € V, u+(S) = u(S)l,,(S)>o-

Lemma 2.14. I f v e V , then v+ e V and %*(S) = ^(S)lv(S)>o-

In the same manner u_(5) = -v(S)\v(S)<o and %^(5) = --g(S)lV(S)<o-

Theorem 2.15 (weak maximum principle). Let u(S, t) be such that for all positive num-bers €,

• ue-€l°z2(S+2) £ C°([0, T]- L2(R+)) n L2(0, T; V),

. |^-elog2(S+2) € L2(R+ x (Q> r))>

• M|»=O > Oae.,

• |^ + A,M > 0 fin f/ie .sen^e of distributions);

then u >0a.e.

Proof. Consider the function H(s) = ^s2, (its derivative is H'(s) = —s..), and for twopositive parameters z and ^, the function

wnere

It is easy to see that V e C°([0, T7]; R), and for all t, \HO > 0. We have also ^r(O) = 0.Assume that

to L2(0, T; V) and is such thatL^O, r;R)anda.e.,

with

in this case, belongs

Therfore

Calling we have

Page 56: Achdou and Pironneau-Computational Methods Option Pricing

2.3 Mathematical Analysis 37

We choose two values Si < 1 and £2 > 1 such that, for S e (0, Si) U (£2, +00),4rmaxR+x|0,ri |cr2 + Saff - r < ±| log(S)|. We define Si = (0, Si) U (S2, +00) and<S2 = [Si,S2]:

But 4T maxs

Then, for z large enough, we have for all x e V,

with a > 0. With these choices of (, and z, (2.35) implies

and for all t e [0, T], ^r(r) = 0, i.e., w > 0.

Remark 2.4. /? is possible to generalize Theorem 2.15: /or example, with Assumption 2.1,consider the weak solution to (2.9), (2.10) given by Theorem 2.11, vwY/z PQ e £2(^+) #«^PO > 0. We /lave P > 0 a.e. and for that we do not need any further assumptions on ^,because we can approximate PQ by a smooth function PQ^ e V, use Proposition 2.13 thenTheorem 2.15 for the solution to (2.9) with Cauchy data PQ,€, and finally pass to the limitas e ->• 0.

2.3.5 Consequences of the Maximum Principle

Various Bounds. The maximum principle is an extremely powerful tool for proving esti-mates on the solutions of elliptic and parabolic partial differential equations.

Proposition 2.16. Under Assumption 2.1, let P be the weak solution to (2.9), (2.10), withPQ € L2(E+) a bounded function, i.e., 0 < PQ < P0(S) < ~PQ. Then, a.e.

Proof. We know that /V~ /o r^dl and P0e~ /o r(T)dT are two solutions of (2.9). Therefore,we can apply the maximum principle (see Remark 2.4) to both P — PQC~ -/o r^dr and-fye-flr(r)dr _p f j

Page 57: Achdou and Pironneau-Computational Methods Option Pricing

38 Chapter 2. The Black-Scholes Equation

Remark 2.5. In the case of a vanilla put option: Po(S) — (K — S)+, and Proposition 2.16just says that 0 < P(S, t) < Ke~ J°r(r)dr, which is certainly not a surprise for people witha background in finance.

For the vanilla put option as in Remark 2.5, we have indeed more information.

Proposition 2.17. Under Assumption 2.1, let P be the weak solution to (2.9), (2.10), -withP0(S) = (K- S)+:

and

Proof. Observe that the function Ke~ /o r ( T ) d r - S is a solution to (2.9) and apply themaximum principle to P(S, 0 - (Ke~ /d r^dT - 5). We have Ke~ /o r^d* - S < P(S, tThen (2.37) is obtained by combining this estimate with the one given in Remark 2.5.

Remark 2.6. Note that we have not imposed (2.38) a priori. Similarly, when we look fordiscrete solutions either by finite differences or by finite elements, it will not be necessaryto impose (2.38) as a boundary condition.

The Super-Replication Principle. Take two European put options with the same maturityand two different payoff functions PQ and Q0. Call P(S, t) and Q(S, t) their respectiveprices, which both satisfy (2.9). One easy consequence of the maximum principle is that,if for all 5, P0(S) < Qo(S), then for all t and S, P(S, t) < Q(S, t). This is called thesuper-replication principle in the finance community.

The Put-Call Parity. Take again a vanilla put option as in Remark 2.5, and consider thefunction C(5, /) given by

From the fact that P and 5 - Ke~ Jo r^>dT satisfy (2.9), it is clear that C is a solution to(2.9) with the Cauchy condition C(0, 5) = (5 - K)+. This is precisely the boundaryvalue problem for the European vanilla call option. On the other hand, from the maximumprinciple, we know that a well-behaved solution (in the sense of Theorem 2.15) to thisboundary value problem is unique. Therefore, we can deduce the price of the call optionfrom that of the put option: we recover the put-call parity seen in Chapter 1 and also wellknown to people trained in finance.

Convexity of P in the Variable 5

Assumption 23. There exists a positive constant C such that

Page 58: Achdou and Pironneau-Computational Methods Option Pricing

2.3 Mathematical Analysis 39

Proposition 2.18. Under Assumptions 2.1 and 2.3, let P be the weak solution to (2.9),(2.10), where PQ e V is a convex function such that ^j$- has a compact support. Then, forall t > 0, P(S, t) is a convex function of S.

Proof. Assume first that the coefficients of (2.9) also satisfy Assumption 2.2, and thatPQ e P(R+), so by Theorem 2.12, Q = 520 e C°([0, T]; L2(R+)). Deriving twice (2.9)with respect to S, and multiplying by S2,

Thanks to Assumptions 2.1 and 2.3, a maximum principle analogue to Theorem 2.15 applies,because Q satisfies (2.41) and Q\t=Q > 0. Therefore Q > 0, which says that jjr > 0 forall t e [0, T] and a.e. in S.

To prove the result for nonsmooth coefficients and Cauchy data, we approximatePO by a smooth convex function with compact support, we approach the coefficientsby ones satisfying Assumption 2.2, and we pass to the limit as in the proof of Proposi-tion 2.13. D

As a consequence, we see that under Assumptions 2.1 and 2.3, the price of a vanillaEuropean put option is convex with respect to S, and thanks to the call-put parity, this isalso true for the vanilla European call.

Remark 2.7. The assumption of the compact support of ^^ in Proposition 2.18 can ofcourse be relaxed.

More Bounds. We focus on a vanilla put, i.e., the solution to (2.9), (2.10) with Po(S) =(K — S)+. It is possible to compare P with prices of vanilla puts with constant volatilities.

Proposition 2.19. Under Assumption 2.1, we have, for all t e [0, T] and for all x > 0,

where P_ (resp., P) is the solution to (2.9), (2.10) with a = g_, (resp., a).

Proof. Consider the difference E = P — P. It satisfies £|,=o = 0 and

because P is convex. Then, the maximum principle leads to the upper bound in (2.42) andthe lower bound is obtained in the same manner.

Localization. Again, we focus on a vanilla put. For computing numerically an approxi-mation to P, one has to limit the domain in the variable S, i.e., consider only S e (0, S)for S large enough, and impose some artificial boundary condition at S = S. Imposing

Page 59: Achdou and Pironneau-Computational Methods Option Pricing

40 Chapter 2. The Black-Scholes Equation

that the new function vanishes on the artificial boundary, we obtain the new boundary valueproblem

with the Cauchy data P(S, 0) = (K — S)+ in (0, 5). The theory of weak solutions appliesto this new boundary value problem, but one has to work in the new Sobolev space

The results in §2.3.1, §2.3.2, and §2.3.3 can be transposed to problem (2.43). The questionis to estimate the error between P and P. For that, we use a version of the maximumprinciple adapted to (2.43), the proof of which is omitted for brevity.

Proposition 2.20. Let u(S, t) be a function such that

then u > 0 in [0, S] x [0, T].

Proposition 2.21. Under Assumption 2.1, the error max/e[0 r] Se[0,5] \P(S* 0 ~~ P(S, 01decays faster than any exponential exp(-nS) (rj > 0) as S —*• oo.

Proof. From Proposition 2.20, we immediately see that P > P in (0, 5) x (Q,T), becauseP(S, 0 > P(S, t) =_0._ On the other hand, from Proposition 2.19, P < P, which im-plies that P(S, f) < P(S, /). Call 7t(S) = max,e[0,r] P(S, t), and consider the functionE(S, 0 = TT - P(S, t) + P(S, t). It is easy to check that the function E satisfies theassumptions of Proposition 2.20, so n(S) > P — P in [0, 5] x [0, T]. At this point, wehave proved that

But ;r(5) can be computed semiexplicitly by the Black-Scholes formula (1.18), and it iseasy to see that for all rj > 0, lim^^ 7r(5)e'?'s = 0. Therefore, max/e[0<T]i5e[0,5] I P(S, 0 —P(S, 01 decays faster than any exponential exp(—^5) as 5 —> oo.

2.3.6 Du pi re's Equation

We reproduce the arguments in [6].

Page 60: Achdou and Pironneau-Computational Methods Option Pricing

2.3 Mathematical Analysis 41

We consider a vanilla European call, subject to the Black-Scholes equation with localvolatility,

where we have supposed that the underlying asset yields a distributed dividend.Let us call G ( S , t , t j , T ) the Green's function, i.e., the solution to

As a function of T and £, G satisfies the adjoint equation (see [55])

To obtain (2.46), it suffices to rewrite (2.45) in the abstract form

where L(S, t) stands for the Black-Scholes operator. This implies that for any smoothfunction 0(5, t), ijs(f, T) compactly supported in R+ x R, and calling £(5, t) a solution toL(5, t)T$(S, 0 = 0(5, 0, we have

On the other hand,

From the two previous identities, we get that -Lr(£, T)G(5, t, £, T) - (Ss <8> <5,)(£, T),which is exactly (2.46).

Page 61: Achdou and Pironneau-Computational Methods Option Pricing

42 Chapter 2. The Black-Scholes Equation

The price of the call (solution to (2.44)) is given by the representation formula

so it is possible to compute the derivatives of C with respect to K:

From the adjoint equation (2.46), we deduce

and integrating twice with respect to K, we obtain

Following Dupire [41], we assume that all the terms on-the left-hand side of (2.50)decay when K tends to +00, so A(T) = B(T) = 0. We have obtained that fixing the datet and the spot price 5, the price of the European vanilla call satisfies the partial differentialequation

with respect to the strike K and the maturity T. This equation is a forward parabolic equationresembling very much (2.44). It is known as Dupire's equation in the finance literature. Weshall see later that (2.50) is very useful when trying to calibrate the local volatility from theprices of options on the market. Indeed, if the options for all strikes and maturities wereon the market, then C(K, T) would be known for all K and T, and the local volatility in(2.44) would be given by (2.51), and, at least formally,

Dupire versus Black-Scholes. It is interesting to compare P (S, 0, K, T) as a function ofK, obtained either by solving numerically Dupire's equation or the Black—Scholes equations(in the variables 5 and t) for different strikes K, for a given volatility function. To do so, wecompute several vanilla European puts by solving the Black-Scholes equations (in the vari-ables S and 0 for different values of K, and we plot K i-> P (S,0, K, T) and compare to theplot of the K h-> v(S, 0, K, T) solution to Dupire's equation (in the variables K and T); theresults are shown in Figure 2.1. We see that there is a noticeable difference for large values ofK, but this is due to the localization in Dupire's equation at K = 2S(K = 105, for instance,would have given a better result). In Chapter 4, we propose a better boundary condition forlocalizing, which applies when the local volatility is constant for large values of S.

Page 62: Achdou and Pironneau-Computational Methods Option Pricing

2.4. Barrier Options 43

Figure 2.1. P(S, 0, K, 7") ver5W5 K (S is fixed) for a family of European vanillaputs with a constant volatility computed by Dupire's equation, the Black-Scholes formula,and finite differences for the Black-Scholes partial differential equation.

2.4 Barrier Options

As seen in Chapter 1, barrier options are options for which the right to exercise disappearsout of a subregion of IR+ x (0, T} (the option becomes worthless out of this region).

The boundary of this region is called a knockout boundary. The knockout boundarymay or may not depend on time. Consider the case when the boundary does not depend ontime: for example, a double knockout option is an option (a put or a call) which becomesworthless if the price of the underlying asset either rises to an upper barrier $2 or falls belowa lower value S\ > 0.

In (Si, £2) x (0, T), the price of the option satisfies the Black-Scholes equation(possibly with local volatility), and we have the boundary conditions

P(Sl,t) = P(S2,t) = 0.

If the volatility is constant, then it is possible to compute the price P semiexplicitly by themethod of the images (see Wilmott, Howison, and Dewynne [117], for instance). In othercases, numerical computation is needed, and one can rely on a weak formulation: calling£2 = (Si, S2), and defining

we can reproduce the arguments of §2.3.2, except that the space V is now defined as theclosure of X>(£2) into V (where U(Sl} is the space of smooth functions with compact supportin £2).

which is a Hilbert space with the norm

Page 63: Achdou and Pironneau-Computational Methods Option Pricing

44 Chapter 2. The Black-Scholes Equation

Note that if Si ^ 0 (i.e., no lower constraint), then

called HQ(&) in the mathematical literature.On the contrarv. if Si = 0. then

With these modifications, all the arguments in § 2.3.2 can be carried over to the presentcase.

If the barrier depends on time, then the boundary value problem can be seen as aparabolic problem in a domain which is not a cylinder in R+ x (0, T). In the simple cases,the mathematical analysis of such problems can be done by finding a change of variableswhich maps the noncylindrical domain to a cylindrical one, but this is beyond the scope ofthe present book.

2.5 Levy Driven Assets

To improve the modeling one may consider assets described by exponentials of Le'vyprocesses, i.e., processes that have stationary independent increments; see, for example,[26,43,42, 44, 92], the book by Cont and Tankov [30], and the references therein.

For a Le'vy process Xt on a filtered probability space with probability P*, the Levy-Khintchine formula says that there exists a function ty : R -> C such that

and

for a, or € R and a measure v on R* such that JK min(l, y2)v(dy) < +00. The measure vis called the Levy measure of X.

We consider the price of a financial asset St modeled as a stochastic process on afiltered probability space with probability P. There exists an equivalent probability P*under which the discounted price is a martingale. If St is modeled as an exponential of aLevy process, we have, under P*,

and the correction parameter c is chosen such that the mean rate of return on the asset isrisk neutrally r, i.e., e(c+z^)f = E*(ex'). The fact that the discounted price is a martingaleis equivalent to

Page 64: Achdou and Pironneau-Computational Methods Option Pricing

2.5. Levy Driven Assets 45

and to

We will assume also that L,,>{ e2yv(dy) < oo, so the discounted price is a square integrable

martingale.Consider an option with payoff P0 and maturity T: its price at time t is

and it can be proved, if the payoff function PQ is in the domain of the infinitesimal generatorof the semigroup (see [13]) when a > g_ > 0, and [99, 33] without this assumption, that Pis the solution to the partial integrodifferential equation

We shall assume that the Levy measure has a density k(y)dy, so (2.56) becomes, replacingt by the time to maturity,

Many choices are possible for k(y):

• The variance Gamma processes

where rjn and rjp are positive and r]p is smaller than 1/2.

The CGMY processes are a generalization of the variance Gamma processes

where 0<Y<2andO<G,2<M.

A simpler choice is Merlon's model with Gaussian jump in log price with LeVy density(see [321)

Page 65: Achdou and Pironneau-Computational Methods Option Pricing

46 Chapter 2. The Black-Scholes Equation

If the volatility is positive, it is possible to develop a theory on weak solutions to (2.57); see[95]. We will not cover this in the present book. When the volatility is 0, it is also possibleto use semigroups (see [95]), but depending on k the semigroup may not be analytic. Inthis case, the notion of viscosity solutions (see [37]) is useful (see [32, 33, 99]), and itis possible to prove that even with nonsmooth payoffs, the function given by (2.55) is aviscosity solution to (2.57).

Remark 2.8. Of course, it is possible to consider options on Levy driven assets withbarriers; see [33].

2.6 Options on a Basket of AssetsWe focus on a basket (see §1.2.3) containing two assets, whose prices are 5i and 52, but allthat follows can be generalized. We assume that the prices of the underlying assets obey asystem of stochastic differential equations:

is clearly positive definite. Exactly as for the one-asset case, it is possible to study the weaksolutions of (2.61). Noting Q = R+ and introducing the Hilbert space

where W\+t and W2t are two independent standard Brownian motions. For simplicity, weassume that a\ and 02 are positive constants, but generalization to functions a\(S\, S2, 0and (72(5i, 52, 0 can be considered. The parameter p is the correlation factor: — 1 < p < 1.Also for simplicity, we assume that the interest rate r of the risk-free asset is constant.

Consider a European option on this two-asset basket, whose payoff function is PQ (5i, 52).As for the options on a single asset, it is possible to find a probability P* under which theprice of the option is

One can apply the two-dimensional Ito's formula, and find the partial differential equationfor the price of the option P(Si, S2, 0- replacing the time with the time to maturity,

The tensor 3,

Page 66: Achdou and Pironneau-Computational Methods Option Pricing

2.6. Options on a Basket of Assets 47

with the norm

one can check the following properties:

• The space T)(.Q) of smooth and compactly supported functions in Q is dense in V.

• V is separable.

• The serninorm | • \v defined by \v\2v = H^lrll^co) + H^lf-ll^g) is in fact a norm

on V equivalent to || • \\v because ||u||i2(g) < 2\v\v.

Among the usual payoff functions, we can cite, for a put,

Note that the payoff functions given by (2.64) and (2.65) belong to L2(Q), which is not trueif PQ is given by (2.66). In what follows, we are going to outline the theory of the weakformulation to (2.61), which applies for P0 e L2(Q).

We introduce the bilinear form

One can prove that there exist two positive constants g_ < a and a nonnegative constant Xsuch that for all i>, w € V,

and

Assuming that P0 e L2(Q), the weak formulation of (2.61) consists in finding

P e C°([0, T]; L2(Q)} D L2(0, T; V) such that ^f e L2(0, T; V), satisfying

The machinery of §2.3.2 applies and it is possible to prove that if PQ e L2(Q), the problem(2.70), (2.71) has a unique solution P and we have the estimate, for all t, 0 < t < T,

Page 67: Achdou and Pironneau-Computational Methods Option Pricing

48 Chapter 2. The Black-Scholes Equation

Furthermore, analyzing the domain of the operator in (2.61), one can prove that

• for all t > 0, P € C°([t, T]- D) n C l ( [ t , T}\ L2(Q)), where

• if PQ € D, then P e C°([0, T]; D) n C'tfO, T]; L2(0));

• if PO e V, then P e C°([0, T]; V) n L2(0, T; D).

Also, it is possible to prove a maximum principle analogue to Theorem 2.15. This isthe main tool for establishing that if P0 is given by (2.64) or by (2.65), then P(Si, 0, r) =(Ke~rt - SO+ and P(0, S2, 0 = (/s^'7"' - S2)+.

Naturally, there may be barrier options on baskets of several assets. For two assetsand a barrier independent of time, pricing the option then amounts to solving the boundaryvalue problem

for a domain Si of R^_. We restrict ourselves to domains whose boundaries are locallythe graph of Lipschitz continuous functions. Then, the Sobolev space to work with is theclosure of T>(&) in the space (v e L2(ft); SI^T e L2(£2); 52^ € L2(Q)} equipped withthe norm

If the domain is complex, simulations need some efforts, and computing techniques enablingone to describe the domain, like the finite element method, must be used.

2.7 Stochastic VolatilityWe consider a financial asset whose price is given by the stochastic differential equation

where fj,Stdt is a drift term, (Wt) is a Brownian motion, and (a,) is the volatility. Thesimplest models take a constant volatility, but these models are generally too coarse tomatch real market prices. A more realistic model consists in assuming that (cr,) is a functionof a mean reverting Orstein-Uhlenbeck process:

Page 68: Achdou and Pironneau-Computational Methods Option Pricing

2.7. Stochastic Volatility 49

where a, m, and ft are positive constants, and where (Z,) is aBrownian motion. As explainedin [51], the law of Y, knowing F0 is A/"(m + (Y0 - m)e~al', £(1 - e~2at)}. Therefore, mis the limit of the mean value of Yt as t -> +00, and £ is the characteristic time of mean

o2reversion. The parameter a is called the rate of mean reversion. The ratio ^- is the limit ofthe variance of Yt as / -> +00. For convenience, we introduce the parameter v

with the terminal condition P(S, y, T) = h(S). The function y(S, y, t) can be chosenarbitrarily.

The no-arbitrage argument can be summarized as follows: We look for the pricingfunction P by trying to construct a hedged portfolio of assets. It is not sufficient to hedgeonly with the underlying asset because there are two independent sources of randomness:dWt and dZt. So the idea is to take a self-financing hedged portfolio containing at sharesof the underlying asset, one option with expiration date TI whose price is

The Brownian motion Z, may be correlated with Wt: it can be written as a linear combinationof (W,) and an independent Brownian motion (Z,),

where the correlation factor p lies in [—1, 1].Consider a European derivative on this asset, with expiration date T and payoff

function h(Sj}. Its price at the time t will depend on t, on the price of the underlyingasset St, and on Yt. We denote by P(S,, Y,, t) the price of the derivative, and by r(t) theinterest rate. By using the no-arbitrage principle and the two-dimensional Ito's formula, itis possible to prove that there exists a function y such that the pricing function P satisfiesthe partial differential equation

where

and bt options with a larger expiration date T2 > T\ whose price is

The value of the portfolio is ct. The no-arbitrage principle yields that for t < T\,

Page 69: Achdou and Pironneau-Computational Methods Option Pricing

50 Chapter 2. The Black-Scholes Equation

The two-dimensional Ito formula permits us to write dP,(1) and dP,{2) as combinations ofdt, dWt, and dZt. The left-hand side of (2.80) does not contain dZ, so

From the last equation and since the left-hand side of (2.80) does not contain dW,, we havealso

Comparing the dt terms in (2.80) and substituting the values of a, and b,, we obtain that

In the equation above, the left-hand side does not depend on TI and the right-hand side doesnot depend on T\, so there exists a function of g(S, y, t) such that

Choosing to write g(S, y, t) = a(y — m) + y3A.(5, y, t) permits us to make the infinitesimalgenerator of the Orstein-Uhlenbeck process appear explicitly in the last equation and toobtain (2.78), so that as explained in [51], we can group the differential operator in (2.78)as follows:

The premium term is the market price of the volatility risk: the reason to decompose Aas in (2.79) is that, in the perfectly correlated case (| p \ = 1), it is possible to find the equationsatisfied by P by a simpler no-arbitrage argument with a hedged portfolio containing onlythe option and shares of the underlying assets. In this case, the equation found for P is

The term ^TT-T^ is called the excess return-to-risk ratio.

Page 70: Achdou and Pironneau-Computational Methods Option Pricing

2.7. Stochastic Volatility 51

Finally, with (2.78), the Ito formula, and (2.79)

but it is also possible to make other choices; see [51, 74]. A closed form for the price of avanilla call has been given in [70] for /(y) = \y\ and A = Ay2.

The partial differential equation is studied in [5,3]. Here, we focus on the case (2.83),and for simplicity we consider only p — 0. Note that only in the other case, we may haveto impose in addition the condition

where rj is a parameter such that 0 < rj < 1, because it can be seen very easily that if(y-m)2

A = 0, then the function e ^ satisfies (2.78), and we want to avoid such a behavior forlarge values of y. The parameter rj will not be important for practical computations, becausein any case, we have to truncate the domain and suppress large values of y.

With the notation r(f) = r(T - t), y(t) = y(T - t), and A(0 = A(T - t) the newunknown u satisfies the degenerate parabolic partial differential equation

so we see that the function y is the contribution of the second source of randomness dZ, tothe risk premium.

There remains to choose the function /. In [110], E. Stein and J. Stein have consideredthe case when

where

To obtain a forward parabolic equation, we work with the time to maturity, i.e., T — t ->• t.Also, in order to use a variational method, we make the change of unknown

Page 71: Achdou and Pironneau-Computational Methods Option Pricing

52 Chapter 2. The Black-Scholes Equation

or, by expanding A and by denoting by Ct the linear partial differential operator

A(u)

we obtain

We denote by Q the open half plane Q = R+ x R. Let us consider the weightedSobolev space V:

This space with the norm

is a Hilbert space, and it has the following properties:

1. V is separable.

2. Calling T)(Q) the space of smooth functions with compact support in Q, T)(Q) c Vand T>(Q) is dense in V.

3. V isdenseinL2(0.

The crucial point is point 2, which can be proved by an argument due to Friedrichs (Theorem4.2 in [58]). We also have the following lemma.

Lemma 2.22. Let v be a function in V. Then

so the seminorm

is in fact a norm in V, equivalent to \ \ \ • \ \ |.

We call V the dual of V. For using the general theory, we need to prove first thefollowing lemma.

Page 72: Achdou and Pironneau-Computational Methods Option Pricing

2.7. Stochastic Volatility 53_

Lemma 2.23. The operator v —> jSSff is continuous from V into V.

Proof. Call X and Y the differential operators

The operators X and Y are continuous operators from V into L2(Q) and their adjoints are

Consider the commutator [X, Y] = XY — YX: it can be checked that

Therefore, for v € V and w e T>(Q),

and from (2.92), there exists a constant C such that

To conclude, we use the density of T>(Q) into V.

Lemma 2.23 implies the following proposition.

Proposition 2.24. Assume that r is a bounded function of time and that y is bounded bya constant. The operator £,t is a bounded linear operator from V into V with a constantindependent oft.

We need also a Girding inequality.

Proposition 2.25. Assume that r is a bounded function of time and that y is bounded by aconstant P. Assume that a > ft; then there exist two positive constants C and c independentoft and two constants 0 < 771 < 772 < 1 such that, for rj\ < 77 < r\i and for any v e V,

From Propositions 2.24 and 2.25, we can prove the existence and uniqueness of weaksolutions to the Cauchy problem with (2.89).

Page 73: Achdou and Pironneau-Computational Methods Option Pricing

54 Chapter 2. The Black-Scholes Equation

Theorem 2.26. Assume that a > ft and that rj has been chosen as in Proposition 2.25.Then, for any u0 e L2(0), there exists a unique u in L2(0, T: V)nC°([0, T]\ L2(Q}), with|f e L2(0, T; V) such that, for a.e. t e (0, T),

and

The mapping UQ^U is continuous from L2(Q) to L2(0, T\ V) n C°([0, T]; L2(Q)}.

v2Remark 2.9. 77ze ratio |y w exactly the ratio between the rate of mean reversion and theasymptotic variance of the volatility. The assumption in Theorem 2.26 says that the rateof mean reversion should not be too small compared with the asymptotic variance of thevolatility. This condition is usually satisfied in practice, since a is often much larger than

al

the asymptotic variance £-.

It is possible to prove a maximum principle similar to Lemma 2.14: as a consequence,in the case of a vanilla put, we see that the weak solution to Theorem 2.26 yields a solutionto (2.82) with a financially correct behavior.

Proposition 2.27. Assume that the coefficients are smooth and bounded, and that a > ft.IfP0(S, y) = (K - S)+, then the Junction

where u is the solution to (2.99), (2.100) with UQ = e(l l?) JL$~ P0, satisfies

and we have a put-call parity.

In [3], it is shown that the domain of Ct does not depend on t; more precisely, thefollowing result is proved.

Theorem 2.28. If for all t, r(t) > 0, the domain Dt of Ct does not depend on t: D, = D.Moreover, if there exists a constant TO > 0 such that r(?) > ro a.e., and if jjjj- > 2,

2 "

then for well-chosen values of ri (in particular such that 2 jir)(\ — rj) > 1),

Then we can prove stronger regularity results on the solution to (2.99), (2.100).

Page 74: Achdou and Pironneau-Computational Methods Option Pricing

2.7. Stochastic Volatility 55

Theorem 2.29. Assume that there exists £, 0 < f < 1, such that y e Cf ([0, T], L°°(0)and r is a Holder function of time with exponent £. Assume also that r (t) > rofor a positiveconstant rg and that |y > 2. Then for rj chosen as in Proposition 2.25 and Theorem 2.28,i/UQ belongs to D defined by (2.102), then the solution of (2.99), (2.100) given by Theorem2.25 belongs also to ̂ ((O, T); L2(0) n C°([0, T]; D) and satisfies the equation

for each t € [0, T].Furthermore, for UQ e L2(Q), the weak solution of (2.99), (2.100) given by

Theorem 2.26 belongs also to CI((T, T); L2(0)) n C°([r, 71]; D) for all T > 0 and we/uzve f^f ||f (OllL2(Q) + I IAM(Ol lL2( G ) < 7/or r > 0.

Project 2.1. Adapt the Monte-Carlo program in §1.4 to compute

1. a European put with a stochastic volatility model;

2. a basket put option with two assets.

Run some tests with realistic data in both cases. Implement a variance reduction method tospeed up the program.

Page 75: Achdou and Pironneau-Computational Methods Option Pricing

This page intentionally left blank

Page 76: Achdou and Pironneau-Computational Methods Option Pricing

Chapter 3

Finite Differences

Historically (see Lax and Richtmyer [88], Richtmyer and Morton [105], and Courant,Friedrichs, and Lewy [35]), the finite difference method is the first family of local methodsfor discretizing partial differential equations. Arguably, it can be attributed to Richardsonin the beginning of the twentieth century. We are going to present several finite differenceschemes for solving (2.9). There are many choices:

1. Should it be done in the actual price variable S or should we use the logarithmic price?

2. Should we use a method explicit in time?

3. Should the first order terms be upwinded?

To answer these we must first make sure that the question is understood. So we introducefirst the simplest explicit scheme, then discuss two implicit schemes. As we shall see, auniform mesh in logarithmic price is not the most accurate and efficient choice, so we willintroduce a third scheme in the primitive variable with different proofs.

3.1 Finite Differences in Logarithmic Prices

3.1.1 Basic Estimates from Taylor Expansions

Lemma 3.1. Let u be a C4 function defined on a closed bounded interval I o/R. Then, forz and h such that z, z + h, z — h e /,

Proof. A Taylor expansion gives

57

Page 77: Achdou and Pironneau-Computational Methods Option Pricing

58 Chapter 3. Finite Differences

with 0,0' € (0, 1). Adding the two identities above,

It is equally easy to establish the following result.

Lemma 3.2. Let u be a C2 function defined on a closed bounded interval I ofR. Then, forz and h such that z, z + h e 7,

and ifu is C*-regular,

3.1.2 Euler Explicit Scheme

Performing the chanee of variables x = loe S.t = T — t. leads to an equation of the form

We have seen in the previous chapter that this partial differential equation has a semi-analytical solution (2.7) when the volatility and the interest rate are constant.

Localization. For simplicity, we assume that r and a are smooth functions, asymptoticallyconstant when x is large. Consider, for example, a put of strike K. Let XQ be a real numbersuch that — XQ <3C log K <3C XQ and let ty(x, t) be a function such that

1. ifr(x,t) = Ke-&r(T}dr - ex in [-00, -*0] x [0, T],

2. ifr(x, 0 = 0 in [JCQ, oo] x [0, T],

3. \ff is smooth.

Ifu is only C2-regular, then for all z in the interior of I,

The conclusion is straightforward.

Remark 3.1. It can be proved in the same manner that ifu is only C*-regular, then forand h such that z, z + h, z — h e I,

Page 78: Achdou and Pironneau-Computational Methods Option Pricing

3.1. Finite Differences in Logarithmic Prices 59

Setting <p = u — \js, one obtains

and lim^i^oo (p(x, t} — 0, with a fast decay (see Proposition 2.21 for a partial justification).This permits us to truncate the domain in the variable x.

Choose x > XQ, and consider the boundary value problem

Discretization with the Euler Explicit Scheme. Given two positive integers N and M,we set h = -j^ and At = |^, and we consider the real numbers

The points (Xj, tm) are the nodes of a uniform grid in the rectangle [—x, x] x [0, T].Using Lemmas 3.1 and 3.2, we may consider the explicit scheme:Find<p™, m e {1, . . . , M}, j e {1, . . . , N}, such that

for 0 < m < M, 1 < j < N, and

where a™ = a(Xj, tm), P? = P(xjt O, rm = r(tm), and ff is either f ( X j , tm) or anapproximation of it.

It is crucial to understand that the value <p™ is not (p(Xj, tm); it is an approximation of<p(*j, tm} for well-chosen values of parameters h and At.

For 0 < m < M, the values {(pf+l}o+1 can be computed from (3.7) in an explicitmanner from {^?}^+1. This is why this scheme is called an explicit scheme.

Abstract Results on Finite Difference Schemes. Let us reformulate what we have doneso far in a general abstract setting with the following notation: let us call

the operator which maps a function 0 to its values at the nodes of the grid,

the boundary value problem (3.6), and

the space of unknowns after discretization.

Page 79: Achdou and Pironneau-Computational Methods Option Pricing

60 Chapters. Finite Differences

We write

the discrete system (3.7). SoQh.&t is obtained by taking the values of Q at (N + 2) x (M+l)points related to the nodes of the grid: Qh,At — Ih,At(Q)-

Remark 3.2. In the case of the boundary value problem (3.6),

and

With the Euler explicit scheme (3.7), (3.8), £/,,A, = /A,A/(£) = (,?7)o<;<A'+i,o<m<Af. where

and

Definition 3.3. The scheme £h,At(<Ph,&t) = h,&t(G} is said to be consistent for approx-imating C((p} = Q if there exists a functional space W (containing smooth functions oftand x), such that Ih, A/ and //,, Ar ° £ are well defined on W and, for all </> € W,

The error £^,A/ ° J/J.AJ (</>) — A,Ar ° £(#) is called the consistency error of the scheme. Ifthe scheme is consistent, let kt and kx be the largest nonnegative numbers such that, for anysmooth function 0, there exists a positive constant C(0) with

then the scheme is said to be of order kx with respect to the variable x, and kt with respectto the variable t.

Definition 3.4. We denote by \\ • \\ a family (depending on M and N) of norms onK(#+2)x(M+i) The scheme £A;A,(<pAjA,) = Ih,&t(G) is said to be stable with respect to thenorms \\ • \\ if there exists a constant C independent ofh and At such that ||£^A, || < C.

Page 80: Achdou and Pironneau-Computational Methods Option Pricing

3.1. Finite Differences in Logarithmic Prices 61

Definition 3.5. The scheme £/,, A/(#>/,, Ar) = lh^t(Q) is said to be convergent with respectto the norms II • II if

provided <p is smooth enough.

Theorem 3.6. Denote by \\ • \\ a family (depending on M and N) of norms on ]j£(Ar+2)x(M+1))

such that || • || < C|| • \\ocfor a constant C independent of M and N. If the schemeA,Ar(<Pfc,A/) = Ih,&t(G) is consistent and stable with respect to the norms || • ||, then it isconvergent. If the scheme £/,,A/(<P/Z,A?) — Ih,&t(G) is of order k, (resp., kx) with respect tot (resp., x) and stable with respect to the norms \\ • \\, and if(p is smooth enough, then for aconstant C(cp) independent ofh and Af,

Proof. Calling £h,At the consistency error for <p, we have (ph,At ~ h,&t(<P) — £/j Ar&.A*-The stability of the scheme implies that \\(ph,At — Ih,&t(<P)\\ < l l£ / i ,Ar l l for a constant Cindependent of h and At. The consistency of the scheme tells us that for <p smooth enough,linift^.o,Ar->o l l£ / i ,Ar l l = 0- The previous two observations yield the convergence.

The proof of the second assertion is done in the same manner. D

Consistency of the Euler Explicit Scheme. Calling €™ the entries of the consistency error£h A/ » we have

From Lemmas 3.1 and 3.2, we know that if <p e C°([0, T]; C4[-x,x]) UC2([0, T];C°r-jc, jcl), then

Therefore, the Euler explicit scheme is of order one with respect to t and of order two withrespect to x.

Stability of the Euler Explicit Scheme. For simplicity, we focus on the case when thecoefficients cr, ft, and r are constant. The general case will be treated completely in §3.3.Let us consider a family of norms || • || on R^+2, such that, for a constant C independent of

Page 81: Achdou and Pironneau-Computational Methods Option Pricing

62 ChapterB. Finite Differences

Af, || • || < C\\ • Hoc. For this norm, we define the norm || • || on R<t f+2)x<M+i) .

From the proof of Theorem 3.6, we have to estimate \\Ch A ,£/, ,A/ll» and since 6™ =e^+1 = e°=0, 0 < m < Af, 1 < j < N, it is enough to find a condition on A/ and h suchthat

with V°A, = {V € V/,,A/; u™ = <+1 = y°=0, 0 < m < M, 1 < j < N}, holds for aconstant C" independent of At and /z.

Notation. For V e V^0A/\{0}, let us call

We have

where A e Ryvxyv is the tridiagonal matrix

With the notation defined above,

Lemma 3.7. For all V e Vf^t\[Q}, we have, for U = C^V,

Recall that we have, for any matrix B € RN*N,

where p(B) is the spectral radius of B, i.e.,

and where ||fi|| = supVeRAr ^p^- From the previous lemma, we see that a necessary con-dition for (3.11) is that p(l — At A) is less than or equal to 1.

It is possible to find the spectrum of the matrix A as follows.

Page 82: Achdou and Pironneau-Computational Methods Option Pricing

3.1. Finite Differences in Logarithmic Prices 63

Lemma 3.8. / / f t ^ —qr-, we have

Remark 3.3. As a consequence of Lemma 3.8, we see that if a2 = 2, ft — 0, r = 0, ?/ien?/ze matrix A is symmetric and we have the discrete Poincare inequality

Theorem 3.9. For the scheme to be stable in norm \\ • \\, a necessary condition is that

or

Proof. From (3.13) and Lemma 3.8, we see that, if ^- > ft,

| | /-AfA|| > p ( l - A f A ) = max | l -AfA. / |/=!,..., N

Therefore, from Lemma 3.7, a necessary condition for (3.11) is that ||7 — Af A|| < 1, andwe obtain (3.16) in the case 2- > \ft\.

Thus,

Therefore, a necessary condition for (3.11) is (3.17).If 2- = | ft |, the matrix A has one eigenvalue, r + p-, so the claim holds in this

case.

Remark 3.4. The condition (3.16) was first found by Courant, Friedrichs, and Lewy [35]for similar problems. For that reason, it is classically called a CFL condition.

Page 83: Achdou and Pironneau-Computational Methods Option Pricing

64 Chapters. Finite Differences

The CFL condition (3.16) is quite restrictive. Indeed, it says that for small values of h,At must scale like h2, which means that the number of time steps must scale like the squareof the number of steps in the *-direction. In practice, the CFL condition is responsiblefor very long CPU times when refining the grid in the ^-variable. For this reason, explicitschemes are seldom used for parabolic problems, except when the dynamic of the solutionis very fast and justifies a very fine time discretization.

We have given a necessary condition for stability. To find a sufficient condition, wehave to compute or estimate the norm || / — At A \\. For example, if we choose for the normin R^"1"2: -4= || • ||2, then we have to estimate ||7 — AtA\\2'. we see that

and we see that if At is small enough compared to h2, then ||7 — AfA||2 < 1, so theCFL condition gives the correct scaling for a sufficient stability condition. Note that itis possible (but really tedious) to compute exactly ||7 — Af A||2, since ||7 — AMU2 , =p((I — At A)T(I - At A)), and (7 — Af A)r(7 — AtA) is a pentadiagonal matrix withconstant coefficients on the diagonals (except for the first and last diagonal coefficients), soa necessary and sufficient stability condition in the norm || • \\2 can be derived.

Remark 3.5. Note that if ft = 0, then the matrix A is symmetric, and we have ||7 — A f A | J 2 =p (I — At A), so the necessary condition (3.16) is also sufficient for the stability in the 2-norm.

Remark 3.6. Replacing rm<p™ by rm+1<p™+l in (3.7) still enables us to compute <p™+l in anexplicit manner. This choice improves (often only slightly) the stability of the scheme.

Convergence. From (3.9) and Theorem 3.9, we see that if the stability condition (3.11)holds and if <p is smooth enough, i.e., if <p e C°([0, T]; C4([-x, *]))nC2([0, T]; C°([-Jc, *])),then

Note that, for vanilla options, for example, <p cannot be so regular, because <po does not evenbelong to C2([—Jc, Jc]). In order to obtain the convergence, one must first approximate (poby a smooth function (fa (such that <PQ(±X) = 0), then solve the boundary value problem

For each 6 > 0, one can choose (fa in order to have

Page 84: Achdou and Pironneau-Computational Methods Option Pricing

3.1. Finite Differences in Logarithmic Prices 65

Then one approximates <p by the Euler explicit scheme and obtains (f>h,Ai- If the CFLcondition (3.11) is satisfied, then it follows from the stability analysis that

Finally, we have

since <p is smooth enough, and h and At can be chosen small enough so that ||<^,A/ —Ih,At(<f>)\\ < £• From this, (3.19), and (3.20), we see that lim^A^o \\<Ph,At -h,&t((p}\\ - 0.It is also possible to find rates of convergence in weaker norms.

Exercise 3.1. Modify the scheme (3.7), (3.8) to discretize the new boundary value problemobtained by replacing the second line of (3.6) by (p(—x, t) = 0; |^(x, t} = g(t). Todiscretize ff (*, t), one can use Lemma 3.2. Analyze the stability and the consistency of thescheme.

Exercise 3.2. Prove the following assertion: let u be a C* function defined on a closedbounded interval I ofR. Then, for z and h such that z, z — h, z — 2h e /,

Exercise 3.3. Deduce from Exercise 3.2 a new second order scheme for the boundary valueproblem in Exercise 3.1.

Exercise 3.4. We consider the variable coefficients boundary value problem "in divergenceform" (we assume that 0 < a* < a(x) < a* < +00 andO < a* < a(x) < a* < +00)

Propose a scheme for (3.23) based on approximating

by

using a centered finite difference method to approximate f~(*/±i)-Prove that if a is smooth enough, then this scheme is second order accurate with

respect to x.

Page 85: Achdou and Pironneau-Computational Methods Option Pricing

66 Chapter3. Finite Differences

ALGORITHM 3.1. Euler explicit scheme.#include <iostream>#include <math.h>^include <stdlib.h>^include <fstream.h>#include<gsl/gsl_sf_erf. h>using namespace std;

const int NT=10000; // number of time stepsconst int NX=201; // nb of space intervalsconst int L=200; // val max of xconst int K = 100; // strikedouble sigmap=0.2, r=0.1;double * u=new double [NX] ;double phi_T(double s){ if(s>K) return s-K; else return 0;}void PDEfiniteDiff()

{double dx= (double) L/(double) (NX-1) , dt = l . /NT, t=0;for(int i=0 ; i<NX; i++)

u[i] = phi_T(i*dx); // final condition

for(int j=0;j<NT;j++)

{t+=dt;for(int i=l;i<NX-l;i++)

{double x=i*dx;u[i] += (0.5*sigmap*x*sigmap*x*(u[i+l]-2*u[i]+u[i-l])/dx/dx

+r*x*(u[i+l] -u[i] )/dx-r*u[i] ) * dt;

}u[NX-l]=L-K*exp(-r*t) ;u [ 0 ] = 0 ;

}}

int mainO

{ofstream ff("fd.dat");PDEfiniteDiff () ,-double dx= (double) L/(double) (NX-1) ,-for(int i=0; i<NX;i++)

{double x=i*dx;ff« x« "\t" « u[i]«endl;

}}

We have plotted in Figure 3.1 the price of the vanilla call option computed withAlgorithm 3.1.

3.1.3 The Euler Implicit Scheme

We have seen above that the Euler explicit scheme becomes much too slow when the meshis fine because stability requires Af = O(h2).

Page 86: Achdou and Pironneau-Computational Methods Option Pricing

3.1. Finite Differences in Logarithmic Prices 67

Figure 3.1. The price of the European vanilla call option with K = 100, a =0.2, r = 0.1 one year to maturity computed by Euler's explicit scheme and by the Black-Scholes formula.

One idea is to modify the scheme in the following way:Find (pf, m e {0, . . . , M}, j e {0, . . . , N + 1}, satisfying (3.8), and, for 1 < m < M,

l<j<N,

In order to obtain ( < p ™ , . . . , #>$)r from (<p™ l,..., <p™ 1)r, one has to solve a nontrivialsystem of linear equations with N unknowns. This is why the method is called implicit.

The Euler implicit scheme (3.24), (3.8) can be recast in the abstract form as

Consistency of the Euler Implicit Scheme. Calling e™ the entries of the consistencyerror £h,&t* we have

Page 87: Achdou and Pironneau-Computational Methods Option Pricing

68 Chapters. Finite Differences

From Lemmas 3.1 and 3.2, we know that (3.9) holds if

Therefore, the Euler implicit scheme is of order one with respect to t and of order two withrespect to jc.

Stability of the Euler Implicit Scheme. For simplicity, we assume here that the coeffi-cients are constant. We take the norm

It is enough to show that (3.11) is satisfied. For V e V^^MO}, let us call

At each time step, one has to solve the system of linear equations

where A € ]&"*" is the tridiagonal matrix introduced in §3.1.2.

Lemma 3.10.

• The matrix I + At A is invertible.

and the Euler implicit scheme (3.24) is stable in the norm \\

Proof. Let W be a vector in RN: we have from Remark 3.3

Therefore Wr (7+Af A) W > ||W|l2» which implies that/+Af A is invertible. Furthermore,if(/ + AfA)W = F, then

which implies estimate (3.26). For all V e Vj£A/\{0}, we have

thus

Page 88: Achdou and Pironneau-Computational Methods Option Pricing

3.1. Finite Differences in Logarithmic Prices 69

Remark 3.7. The Euler implicit scheme (3.24) is unconditionally stable in norm \ • \\ withrespect to At.

Convergence of the Euler Implicit Scheme. It is possible to replicate the argumentsused for Euler's explicit scheme, and prove that the Euler implicit scheme is convergent innorm || • ||.

Exercise 3.5. Using Exercise 3.2, prove that the Gear scheme

is second order with respect to both t and x. This is a two-step scheme, so it is not possibleto use it for j = 1. Analyze the stability of this scheme.

3.1.4 The Crank-Nicolson Scheme

One of the best one-step implicit schemes is the Crank-Nicolson scheme:Find <pf, m e {0,. . . , M}, j e {0, . . . , N + 1}, satisfying (3.8), and, for 1 < m < M,

l<j<N,

As we shall see, it is more accurate than Euler's schemes and has the same kind of stabilityas the Euler implicit scheme. Indeed, the Crank-Nicolson scheme (3.30), (3.8) can be recastin the abstract form

where

with

Page 89: Achdou and Pironneau-Computational Methods Option Pricing

70 Chapters. Finite Differences

and [A,A,(0)]y = 0;m if j = 0, j = N + 1, or m = 0,

for m = 1, . . . , M, 1 < j < N.

Consistency of the Crank-Nicolson Scheme. From Lemmas 3.1 and 3.2, we know thatif the solution to (3.6) is smooth enough, then the consistency error scales like A/2 + h1.Therefore, the Crank-Nicolson is of order two with respect to both x and t.

Stability of the Crank-Nicolson Scheme. We assume that the coefficients a, ft, and rare constant, and we keep the notation as for the Euler schemes. It is enough to show that(3.11) is satisfied. For V e VjA,\{0}, let us call U = £j~A, V and Um = (u^,..., w^) r ,Vm = ( v ™ , . . . , u™) r . At each time step, one has to solve the system of linear equations

where A has been introduced in §3.1.2.

Lemma 3.11. The matrix I + ^ A is invertible, and

Proof. We leave the first point to the reader.For the second point, we have that

Therefore, for W €

which proves the desired result, because A + AT is positive definite; see (3.27). D

Page 90: Achdou and Pironneau-Computational Methods Option Pricing

3.2. Upwinding 71

Thanks to Lemma 3.11, we have

which implies that

and Lemma 3.11 implies that

The Crank-Nicolson scheme is stable with respect to || • ||, unconditionally with respect toh and At, and convergence is proved as in §3.1.2.

Exercise 3.6. For 9, 0 < 9 < I, consider the scheme

One recovers Eider's implicit scheme for 0 = 1, Ruler's explicit scheme for 0 = 0,and the Crank-Nicolson scheme for Q = \-

Studvine the stability of this scheme consists of considering the seauence given bv

where A has been introduced in £3.1.2. Prove that the scheme is unconditionally stable assoon as 0 > ^ (the proof is similar to that for the Crank-Nicolson scheme and relies on thefact that A + AT is positive definite; see (3.27)).

3.2 Upwinding

Let us assume that the coefficients a, ft, and r are constant and discuss the stability of theEuler implicit scheme:

Find (pf, m e {0,..., M}, j € {0,..., W + 1}, satisfying ^ = (f>0(Xj), 0 < j <N + 1, p™ = 0$+1 = 0, 0 < m < M, and, for 1 < m < M, 1 < j < N,

with respect to || • ||oo: l|V||oo = maxo<m<Mmaxi<;<Ar \v™\. For that, we need a fewadditional notions on matrix analysis; for a vector V e R^, the notation V > 0 (resp.,V < 0) means that all the components of V are nonnegative (resp., nonpositive).

Page 91: Achdou and Pironneau-Computational Methods Option Pricing

72 Chapters. Finite Differences

Definition 3.12. A matrix B e RNxN is an M-matrix if there exists a diagonal matrix Dwith positive diagonal entries such that

An M-matrix is the right product of a strictly diagonal dominant matrix by an in vertiblediagonal matrix, so it is invertible. The M-matrices are an important class of matrices,because they have monotonicity properties.

Lemma 3.13 (discrete maximum principle). Let F e ~RN be a vector such that F > 0.Let B e RNxN be an M-matrix. Then V = B~1F > 0.

Proof. By easy algebraic manipulations, it is enough to prove the result when the matrix Bis diagonal dominant, i.e., D = 1^. Let IQ be the index such that u,0 = min; Vj. We have

because the off-diagonal coefficients of B are nonpositive, which implies

Therefore vio > 0, from the third property in (3.39).

Corollary 3.14. The entries of the inverse of an M-matrix are all nonnegative.

Proof. Let B be an M-matrix and Kj = ((B'^ij,..., (B~l)Nj)T the ;th column of B'1.

We have BKj = F/, where Fj = (<5(,,)[<,<#. Lemma 3.13 implies that K > 0.

Exercise 3.7. Let a matrix B e MNxN be invertible and such that

Prove that Lemma 3.13 holds for B.

Let us consider the scheme (3.38). If |/J| < ^-, then the matrices A and I + At A areM-matrices and we have the following stability estimate.

Page 92: Achdou and Pironneau-Computational Methods Option Pricing

3.2. Upwinding 73

Lemma3.15. If\ft\ < £, then \\(I + AfArMloo < 1-

Proof. Consider the system of linear equations (/ + Af A)£7 = V. Let ymax, (resp., Vmin)be the vector whose components are all equal to max;=i,. ,# Vj (resp., min;=1 # Vj). Itcan be easily checked that

where £ is a vector whose components are all nonpositive. Therefore U — 1+*Af Vmax < 0.

Similarly, one can prove that U — 1+*Af Vmin > 0. Therefore,

which ends the proof.

In fact, we have proved the following slightly stronger result.

Lemma 3.16. Assume that \ft\ < ^- and that rnin;-=0i...,^+i <p^ = 0. Then (<p™);i/n given by(3.38) satisfy

If the condition \ft\ < ^- is not fulfilled, then the scheme may not be monotone;i.e., oscillations in the ^-variable may appear (see the numerical example below), and||(7 + A/A)"1 ||oo may be larger than 1. In this case, the scheme becomes unstable in the|| • 11 oo norm. So, if a2 is much smaller than ft, then step h needs to be very small.

Remark 3.8. Note that it is quite important to obtain nonnegative values ofcp since cp standsfor a price!

Remark 3.9. For European options, the volatility is often not small compared with r, so thescheme (3.38) is most often stable. For Asian options or options with stochastic volatility,we shall see that some diffusion coefficients in the partial differential equation may vanishcompletely, so the scheme (3.38) will be unstable in the || • ||oo norm.

One way to cure these instability phenomena is to use an alternative discretizationfor the term -£ff (xjt tm), i.e., assuming that ft > 0, _ff *<*/>'•^-rt*;-^ so the schemebecomes

Such a discretization of — P^(XJ, tm) is called an upwind discretization, because —ft canbe interpreted as a velocity, and the new discretization takes information upstream and notdownstream. On the contrary, the scheme (3.38) is called centered.

Page 93: Achdou and Pironneau-Computational Methods Option Pricing

74 Chapters. Finite Differences

With the upwind discretization, the Euler implicit scheme reads

The matrices B and I + Affi are M-matrices, independent of Af and h, and the Eulerimplicit scheme (3.40) is always stable in the norm || • H^, because of the following lemma.

Lemma 3.17. The matrix B satisfies \\(I + AfB)"1!!^ < 1.

Proof. The proof is left to the reader.

Such a gain in stability has a cost: indeed, thanks to Lemmas 3.1 and 3.2, one canprove that the scheme (3.40) is first order in the variables t and x, so it is less accurate thanthe scheme (3.38).

Remark 3.10. The idea of using upwind schemes originates from computational fluiddynamics, where convective effects usually dominate diffusion.

An Example. We consider the steady state boundary value problem

with ft > 0. The solution to (3.42) is

If 2§r -4C 1, u(x) is very close to 0, except in a small neighborhood of x = 1 ofdiameter 0(y) (this zone is called a boundary layer); see Figure 3.2. Let us consider thetwo discretizations (3.38) and (3.40) of (3.42), with At = oo. It is possible to computeexplicitly the discrete solutions given by these two schemes (the calculations are a bit long)and to see that the centered scheme produces oscillations, whereas the upwind schemegives a qualitatively correct solution. In Figure 3.3, we have plotted the solutions given bythree schemes: the centered scheme, the upwind scheme, and the downwind scheme (i.e.,upwinding has been used in the wrong direction): we observe that the centered scheme is

Page 94: Achdou and Pironneau-Computational Methods Option Pricing

3.2. Upwinding 75

Figure 3.2. The solution of (3.42} for a2 =0.09, r = 1, j8 = 10: the solutionvanishes outside a boundary layer.

figures..), solutions given oy three schemes for a" = U.UU2!), r = 1, p = 1U,and N = 100. Le/Jf: upwind scheme (zoom); center: centered scheme; right: downwindscheme. Only the upwind scheme gives a qualitatively correct result.

Figure 3.4. Solutions given by three schemes for a2 = 0.09, r = 1, ft = 10,and N = 1000. Left: upwind scheme (zoom); center: centered scheme; right: downwindscheme.

unstable in the norm || • H^ when the grid step is larger than the boundary layer, and thatupwinding in the wrong direction produces a disaster.

Remark 3.11. If the grid is sufficiently fine, i.e., if^<£l, then all the schemes will end upgiving the correct result. This is the case for the results plotted in Figure 3.4. In the limitwhen h —» 0, the centered scheme is more accurate since it is of order two.

Page 95: Achdou and Pironneau-Computational Methods Option Pricing

76 Chapters. Finite Differences

One has to remember that upwind schemes are safer but less accurate than centeredschemes, and that they should be used when transport phenomena dominate diffusion.

It is possible to use second order upwinding, by making use of the second order finitedifference formula in Exercise 3.2: assuming that ft > 0, this leads to discretizing the term-P$(Xj, tm) by -£[-<p(xj+2, tm} + 4<p(Xj+i, tm) - 3<p(Xj, fm)] , so the Euler implicitscheme becomes

for j < N — 1. This formula cannot be applied aij = N — l, and one can use, for instance,a first order scheme there, or something else. Although the matrix obtained with (3.44)cannot be an M-matrix (note that it has four nontrivial diagonals instead of three before),we see that the diagonal term is increased compared to a center scheme, so the stability isimproved. Of course, it is possible to use the Crank-Nicolson scheme for time stepping,and obtain a second order scheme in both t and x.

3.3 Finite Differences in the Primitive Variables

We consider a European put whose price satisfies the Black-Scholes equation

with the Cauchy data

where PQ is the payoff function. We truncate the domain in the 5 variable, so (3.45) holdsin (0, T] x (0, 5), and we must add a boundary condition at the artificial boundary 5 = S:for example, we impose the Dirichlet condition

We suppose that the coefficients a and r are smooth enough and we make the assumptions(2.40) and (2.41).

Consider two integers M and N and call A/ = -^, h = jf^, S{ = ih for i =0, . . . , N + 1, and tm = mh form = 0 , . . . , M. The nodes (S/, tm) form a uniform grid ofthe rectangle [0, 5] x [0, T].

Page 96: Achdou and Pironneau-Computational Methods Option Pricing

3.3. Finite Differences in the Primitive Variables 77

3.3.1 Euler Implicit Scheme

The Euler implicit scheme for discretizing (3.45), (3.46), and (3.47) reads

where aj1 = a(Sj, tm) and rm = r(tm}.We call Am the tridiagonal matrix of R(N+1)x(jV+1):

and Pm € RN+l the vector Pm = (p%,..., p%)T. The Euler implicit scheme reads

We denote by || • ||2 the norm in R^1: || Q\\22 = Y^=0 qf, and by | • | the norm

Lemma 3.18. Under assumptions (2.40) and (2.41), there exists a nonnegative constant€2 such that, for all m, m = 1, . . . , M,

Page 97: Achdou and Pironneau-Computational Methods Option Pricing

78 Chapters. Finite Differences

Proof. We have

where

Posing qN+i = 0, we have that, for any 77 > 0,

For the term $2, we have that, for any fi > 0,

Page 98: Achdou and Pironneau-Computational Methods Option Pricing

3.3. Finite Differences in the Primitive Variables 79

From (3.52) and (3.53), for any 77 > 0 and JJL > 0,

and (3.51) follows by taking 77 and /u, large enough.

Corollary 3.19. If At < -^, then, form = 1 , . . . , M, I + AtAm is invertible, and it ispossible to use Eider's implicit scheme.

Proof. The equality (/ + AtA)Q = 0 implies

and therefore Q — 0.

Consistency. By using Lemmas 3.1 and 3.2, one can easily check that if the solution P of(3.45), (3.46), and (3.47) is smooth enough, then, for j = 1 , . . . , N, the consistency error

is bounded by C(P)(h2 + A/), whereas e™+1 is bounded by C(P)At. Therefore, the Eulerimplicit scheme is of order one with respect to t and two with respect to S.

Stability: The Energy Method. Let || • || be the norm in R^+Dx^: \\Q\\ = maxm=i;...,M7= rIIGmll2, where Q = (Q1, ..., Qm) and Qm € RN+l.

Lemma 3.20. There exists a constant CT, > 0 (independent of N) such that, if At < ^-,then the Euler implicit scheme is stable in the norm \\ • ||.

Proof. Proving the stability of the method in the norm || • || consists of showing that if, form= 1,. . . ,M,

then, for a positive constant independent of V, N, and M,

Page 99: Achdou and Pironneau-Computational Methods Option Pricing

80 Chapters. Finite Differences

To do it, we take the scalar product of (3.54) with Um:

and we use the well-known identity UT(U - V) = \(\\U\\\ + \\U - V\\\ - || V|||). Weobtain that

which implies, thanks to (3.51),

where C3 = 2C2 + 1. Assuming that Ar < ^, multiplying (3.56) by (1 - C3 Ar)m~M, andsumming over m, we obtain that

Let €4 be a positive constant independent of A/ such that log(l — Ca Ar) > — €4 Af.We have that (1 - C*AtrM < ec*M^ = ec*T. and

Since (3.57) holds when M is replaced by m < M, we have proved (3.55), withC = max(l, Vf)e?c*T.

Remark 3.12. Note that here, the stability is more difficult to analyze than in the previouscases, because the coefficients of the partial differential equation are not constant. Themethod used here to prove the stability is called an energy method.

Convergence. It is possible to replicate the arguments used for Euler's explicit scheme in§3.1.2 and prove that the Euler implicit scheme in the primitive variables is convergent inthe norm || • ||.

Exercise 3.8. Write down the Crank—Nicolson scheme for the Black-Scholes equation inthe primitive variables and analyze its stability by the energy method.

Page 100: Achdou and Pironneau-Computational Methods Option Pricing

3.4. Numerical Results 81

Figure 3.5. The error produced by the Crank-Nicolson scheme with a centereddiscretization in the variable S, as a function of N (in log-scales).

3.4 Numerical Results

We consider a vanilla European put with strike K = 100 and maturity 1 and we assume thatthe volatility and interest rates are constant: a = 0.2 and r = 0.04. In this case, it is possibleto use Black-Scholes formula (1.18), and to compute the error produced by the same finitedifference schemes as in §3.3, except that we use the Crank-Nicolson time scheme insteadof the Euler implicit scheme. We compute the error in the norm || • || introduced above.

In Figure 3.5, we take a very small time step, i.e., M = 4000, so that the consistencyerror due to time discretization is very small, and we plot the error in the norm || • || withrespect to TV. As a function of N, the error is decreasing and limited from below by theerror produced by the time discretization. When this last error is negligible compared tothe error due to the discretization in S, we see that the convergence order (the slope of thecurve in log-scales) is less than 2: this is due to the fact that the payoff is singular at S — K.In fact, with more careful theoretical considerations, it could be seen that the error decaysfaster than /?2~e for all € > 0, and slower than h*. This is indeed observed in Figure 3.5.

In Figure 3.6, we take a small step in the S variable, i.e., TV = 120, so that theconsistency error due to discretization with respect to S is small, and we plot the error in thenorm || • || with respect to M, for both the Crank-Nicolson and the Euler implicit scheme. Asa function of M, the two errors are decreasing and limited from below by the error producedby the discretization in S. When this last error is negligible compared to the error due to thetime discretization, we see that the convergence order (the slope of the curve in log-scales)is less than 2: this is due to the fact that the payoff is singular at S = K. In fact, with morecareful considerations, it could be checked that the error decays faster than A? *~€ for all€ > 0, and slower than h*. This is indeed observed in Figure 3.6. Due to the choice ofthe norm || • ||, the two curves have the same behavior, because the error is driven by thesingularity at t — 0, and it does not help to take an accurate scheme near t = 0.

At N and M fixed (M = 230, TV = 120), plotting the pointwise error for the Crank-Nicolson and Euler implicit schemes (see Figure 3.7) shows that the error is concentratedaround the singularity, i.e., t = 0 and 5 = K. We see also that the error decays faster in

Page 101: Achdou and Pironneau-Computational Methods Option Pricing

82 Chapter 3. Finite Differences

Figure 3.6. The error produced by the Crank-Nicolson and Euler implicit schemeswith a centered discretization in the variable S, as a function ofM (in log-scales).

Figure 3.7. The pointwise error produced by the Crank-Nicolson and Euler im-plicit schemes with a centered discretization in the variable S, as functions and S.

Page 102: Achdou and Pironneau-Computational Methods Option Pricing

3.5. Which Variable Is Better? 83

time with the Crank-Nicolson scheme: indeed, away from t = 0, the solution is smoothand the Crank-Nicolson behaves better than the Euler schemes.

Remark 3.13. The previous observations tell us that in order to improve the accuracy,choosing a uniform grid is not a good idea, and that the grid should be highly refined neart — 0 and S = K. However, the schemes presented so far rely on uniform grids in thevariable S. It is possible to design second order schemes that work on nonuniform grids, butin our opinion, their construction is easier understood with the formalism of finite elements.Therefore, at this point, we keep in mind that nonuniform grids should definitely be used,and we postpone the description of schemes for such grids to the next chapter.

Project 3.1. On the example of European call, compare the computing times of a Monte-Carlo method and of a Crank-Nicolson finite difference scheme. For the Monte-Carlomethod, apply one of the variance reduction techniques given in Chapter 1.

3.5 Which Variable Is Better?We are ready now to answer the question, Should one prefer the primitive variables or thelogarithmic price? The answer is, it does not matter; what is important is the grid. Indeed,a uniform grid in the logarithmic price, when converted in the primitive variable, has alarge density of nodes near 5 = 0, which is completely unnecessary for a vanilla option,because the price is almost affine at S = 0. Conversely, we have seen that a uniform gridin the primitive variable may use too many nodes for large values of S. Therefore, for bothchoices of variables, what really matters is to use a suitable grid, properly refined near thesingularity of the payoff function. The schemes discussed so far are designed for uniformgrids in 5 or x only: to obtain good schemes for nonuniform grids, one should be morecareful, and things are better understood with the concepts of finite elements; this will bethe topic of the next two chapters.

3.6 Options on a Basket of Two AssetsConsider an option on a basket of two assets: its price is given by the multidimensionalBlack-Scholes equation

where t is the time to maturity, PQ is the payoff function, and

is positive definite.

Page 103: Achdou and Pironneau-Computational Methods Option Pricing

84 Chapters. Finite Differences

For computing, we truncate the domain and consider (3.58) for 0 < Si < 5\ and0 < 52 < £2, where Si, £2 are large enough. Additional boundary conditions have to beimposed on the artificial boundaries Si = Si and S2 = $2. For puts and many reasonablepayoff functions like in (2.64), (2.65), it is sensible to impose that P(S\, S2) = P(S\, $2) =0 for all 0 < Si < Si, 0 < S2 < S2.

Consider three positive integers N\, A/2, and M and pose hk = j/^, k = 1, 2, and

At = jj. We consider the real numbers 5*,,- = ih^ for k = 1, 2 and 0 < / < A/* + 1 andtm = mAt for 0 < m < M. The points (tm, S1,, S2j} are the nodes of a uniform grid of[0, 71 x [0, Si] x [0, S2].

The value of

at (Si,/, 82, j) e (0, Si) x (0, Sz) is approximated by the centered scheme

where

For i = 0 or j = 0, we take the same scheme, but some terms vanish, so, on thetwo boundaries S1 = 0 and S2, we obtain schemes for the one-dimensional Black-Scholesequation.

Finally, the Euler implicit scheme consists of finding P™j, 0 < m < M , 0 < i <NI + 1, 0 < j < N2 + 1, such that

Page 104: Achdou and Pironneau-Computational Methods Option Pricing

3.7. An Asian Put with Fixed Strike 85

with the convention that P™, , — P,m, — 0 and with

and

It can be checked that the scheme (3.60) is first order in time, and second order in thevariables Si and 52. The stability and convergence analyses follow the same line as in §3.3.

Exercise 3.9. Write the Euler implicit scheme with an upwind discretization of the firstorder derivatives.

Project 3.2. Compare various implicit schemes for a vanilla European call: Euler andCrank-Nicolson with/without upwinding and Crank-Nicolson with Gear's formula (3.22)for the first order derivative. Plot the errors; plot also a finite difference approximation ofdssC.

3.7 An Asian Put with Fixed Strike

3.7.1 An Upwind Scheme with Respect to A

For the financial modeling of Asian options, we refer the reader to [117, 116] and thereferences therein.

We consider an Asian put with fixed strike whose payoff is Po(S, A) = (A — K)+:calling A the average value of the asset in time, A = j J0' S(r}dr, the price of the optionis found by solving the Cauchy problem (hereafter, t denotes the time to maturity, so

Note that when t -> T, then A -> S, so the price of the option at t = T (today) is given byP(t, S, S), and for pricing, we are interested only in the value of P on the diagonal S = A.Nevertheless, we have to solve (3.63).

Page 105: Achdou and Pironneau-Computational Methods Option Pricing

86 Chapters. Finite Differences

On 5 = 0, the coefficient 3-^- vanishes, so the equation degenerates into a partialdifferential equation with respect to t and A:

Near A — 0, we have

This term is analogous to a transport term with a velocity pointing outward the domainin fluid mechanics, and for that reason no boundary condition has to be imposed on theboundary A — 0 (in fluid mechanics, this is called an outflow boundary).

Remark 3.14. Note that there is no diffusion term with respect to A (i.e., jjp), so, in viewof §3.2, upwinding in the variable A will be necessary.

Exactly as for the Black-Scholes equation, we truncate the domain in the variablesS and A, i.e., we consider (3.63) in (0, 5) x (0, A), and we have to supply additionalboundary conditions on the boundaries S = S and A = A. An argument similar to thatfor the European put shows that lim^-^oo P(t, 5, A) = 0, so we can choose to imposethe Dirichlet condition P(t, S, A) = 0 in the zone where 5 > A. No condition has to beimposed for 5 < A for the same reasons as above (if 5 < A, the term — yjj£ |£ is a transportterm with an outgoing velocity).

Consider now the boundary S = S: on this boundary, we impose the Neumanncondition |j = 0, because P0 does not depend on 5, so P should not depend on 5 for largevalues of S.

Take three integers Ns, NA, and M, pose hs = S/Ns+1 = jj~^, and Af = -^, andconsider the real numbers 5, = ih$, Aj = jhA, tm = mAf for 0 < i < NS + 1, 0 < j <NA + l,0<m < M. The nodes (?„,, 5,, A;) form a uniform grid of [0, T] x [0, S] x [0, A].At a node (S,-, Aj) in (0, S) x (0, A),

is approximated by the upwind scheme

where

Page 106: Achdou and Pironneau-Computational Methods Option Pricing

3.7. An Asian Put with Fixed Strike 87

It is possible to use a second order scheme by making use of Exercise 3.3 for discretizingS-A dP f /c 4 \.

~ T-t 8A al V J / , Aj).

Of course, this scheme cannot be applied near the boundaries A — 0 and A = A.

3.7.2 A Program in C++

The following program computes the price of an Asian put with a Crank-Nicolson schemeand the finite difference schemes described in §3.7.1. For simplicity, we have used onlyband matrices (the bandwidth is equal to the number of steps in the S variable) and thesystems of linear equations are solved by LU factorization. It would have been better touse sparse matrix and a good preconditioned iterative solver like GMRES (see [107, 106])with an incomplete LU factorization (see [106]).

The time grid may have variable steps, whereas the grid in S and A does not varywith time. We use the vector + sparse matrix class called RNM of Danaila, Hecht, andPironneau [38]. It is not necessary to study these classes in order to use them. One needonly know how to call them and how to use the overloaded operators. It may seem likekilling a fly with a gun, but it will allow us to hide low-level implementations using thebias library for speed and adaptation to the computer architecture.

The RNM class is templated over a basic type: the real numbers (either double orf 1oat). We will later use ddoubl e for automatic differentiation as a fast way to computederivatives and sensitivities (Greeks).

To create an RNM vector v of size m and a band matrix A of size m x m and bandwidthd = 1, one writes

const int N=10;typedef double Real;typedef KN<Real> vec;typedef SkyLineMatrix<Real> mat;vec v(N);mat a(N,1);

It is indeed convenient to define the types vec and mat for readability, as these willbe used often.

The RNM classes implement efficiently the operations of vector calculus such as

vec c=0,b=2 * c + 1;a . L U ( ) ; a .Solve(v,c) ;cout«v«endl;

Page 107: Achdou and Pironneau-Computational Methods Option Pricing

88 Chapters. Finite Differences

which means that, with cf = l, i = l...,N, and a a tridiagonal band matrix, the systemof linear equations av = c is solved by the Gauss LU factorization method, and the resultis displayed.

A "CN-scheme" class is defined for the Crank-Nicolson scheme.

ALGORITHM 3.2. Crank-Nicolson.

class CN_Scheme_Asian

{private:

int order;double T, S_max, A_max; // bounds of the comp. domainint NS,NA; // number of nodes in S and A

vector<double> grid_t; // time grid, can be nonuniformMatriceProfile<double> AA_S; // auxiliary matrix computed once

// and for all

MatriceProfile<double> AA_A; // auxiliary matrix computed once// and for all

MatriceProfile<double> BB; // the matrix of the linear systemdouble rate ; // interest ratedouble sigma; // volatility

public:CN_Scheme_Asian( const int orderg,

const double Tg,const double S_maxg,const double A_maxg,

const int NSg,const int NAg, const vector<double> &grid_tg,const double rateg,const double sigmag)

: order (orderg) , T (Tg) , S_max (S_maxg) , A_max (A_maxg) , NS (NSg) , NA (NAg) ,grid_t (grid_tg) , AA_S (NSg*NAg,2*NAg) ,AA_A(NSg*NAg, 2*NAg) ,BB(NSg*NAg,2*NAg) ,rate(rateg), sigma(sigmag)

{Assemble_Matrices();

}; // constructor

void Assemble_Matrices( ); // assembles time independent matricesvoid Time_Step (int it, vector<KN<double> > &P) ; // one time stepvoid build_rhs(KN<double> &u, const KN<double> &u_jp,

const double t,const double dt); // construct RHS of// linear system

void build_matrix( const double t, const double dt) ; // builds BB fromAA_S and AA_A

}

A time step of the method is implemented in the function Time_Step: it consistsof building the matrix B ~ M + A^A"1 (not equal because of the Neumann boundarycondition at S = 5), constructing the right-hand side of the system, and solving the system.

Page 108: Achdou and Pironneau-Computational Methods Option Pricing

3.7. An Asian Put with Fixed Strike 89

ALGORITHM 3.3. Time step.

void CN_Scheme_Asian::Time_Step(int it, vector< KN<double> >& P)

{double t=grid_t[it]; // current timedouble dt=t-grid_t[it-1]; // current time stepbuild_rhs(P[it],P[it-l],T-t+dt,dt); // computes the RHSbuild_matrix(T-t,dt); // computes the matrix B =(M+dt/2* A)BB.LUO; // LU factorization of BBB.Solve(P[it] ,P [it]); // solves the system

}

The matrix has to be recomputed at each time step, since it depends on t\ however,it is possible to write Am = AS + -j~AA, where the matrices AS and AA do not vary intime and can be computed once and for all. The matrices As and AA are computed by thefunction void Assemble_Matrices () .

ALGORITHM 3.4. Matrix assembly 1.

void CN_Scheme_Asian::Assemble_Matrices()

{assert(S_max<=A_max); // checks that S_max<=A_maxdouble hS=S_max/(NS-1); // step in Sdouble hA=A_max/(NA-1); // step in Avector<double> S ( N S ) ; // S gridvector<double> A ( N A ) ; // A gridfor(int i=0; i<NS; i++)

S[i] = (S_max/ (NS-1) ) *i;for(int i=0 ; i<NA; i++)

A[i] = (A_max/ (NA-1) ) *i;int k=-l ;AA_S=0; // stiffness matrix except derivatives wrt AAA_A=0; // derivative wrt Adouble aux;

for(int i=0; i<NS-l ; i++)for (int j = 0 ; j < N A ; j + + )

{k=i*NA+j;aux=pow(sigma*i,2) ;AA_S(k,k)=rate+aux;AA_S(k,k+NA)= -(aux +rate*i)/2;

}if (order==l)

for(int i=0; i<NS-l ; i++)for (int j = 0 ; j < N A ; j + + )

{aux= fabs(-S[i] +A[ j ] ) /hA;k=i*NA+j;AA_A(k ,k)= aux;if ( S [ i ] > = A [ j ] )

AA_A(k,k+l)=-aux;else

Page 109: Achdou and Pironneau-Computational Methods Option Pricing

90 Chapter 3. Finite Differences

AA_A(k,k-l)=-aux;

}else if (order==2)

{for(int i=0;i<NS-l;i++)for (int j=0;j<2;j++)

{aux= fabs ( -S [ i ]+A[ j ] ) /hA;k=i*NA+j;A A _ A ( k , k ) = aux;if ( S [ i ] > = A [ j ] )

AA_A(k,k+1)=-aux;else

AA_A(k,k- l )=-aux ;

}for(int i=0; i<NS-l ; i++)

for (int j = N A - 2 ; j < N A ; j + + )

{aux= f a b s ( - S [ i ] + A [ j ] ) /hA;k=i*NA+j;AA_A(k ,k)= aux;if ( S [ i ] > = A [ j ] )AA_A(k,k+l)=-aux;

elseAA_A(k,k-l)=-aux;

}for(int i=0;i<NS-l;i++)for (int j=2;j<NA-2;j++)

{aux= f abs ( -S [ i ]+A[ j ] ) /hA;k=i*NA+j;if ( S [ i ] > = A [ j ] )

{AA_A(k,k)= 3*aux/2;AA_A(k,k+l)=-4*aux/2;AA_A(k,k+2)=aux/2;

}else

{AA_A(k,k)= 3*aux/2;AA_A(k,k-l)=-4*aux/2;AA_A(k,k-2)=aux/2;

}}

}for (int j=0 ; j<NA; j++)

for(int i=l; i<NS-l; i++)

{k=i*NA+j;AA_S(k,k-NA)= -(pow(sigma*i,2) -rate*i)/2;

}// note that the Neumann condition at S=S_max is not done yet

2

Page 110: Achdou and Pironneau-Computational Methods Option Pricing

3.7. An Asian Put with Fixed Strike 91

The function : build_matrix is as follows.

ALGORITHM 3.5. Matrix assembly 2.

void CN_Scheme_Asian: :build_matrix (const double t,const double dt)

{int i ;BB=0;

for(int k=0;k<NS-l;k++)for (int j=0;j<NA;j++)

{i=k*NA+j;BB(i,i)=l+dt/2*(AA_S(i,i)+AA_A(i,i)/t);BB(i,i+NA)=dt/2*AA_S(i,i+NA);

}

for(int k=l;k<NS-l;k++)for (int j=0;j<NA;j++)

{i=k*NA+j;BB(i,i-NA)=dt/2*AA_S(i,i-NA) ;

}

for(int k=0;k<NS-l;k++)for (int j=l;j<NA;j++)

{i=k*NA+j;BB(i,i-l)=dt/2*AA_A(i,i-l)/t;

}

for(int k=0;k<NS-l;k++)for (int j=0;j<NA-l;j++)

{i=k*NA+j;BB(i,i+l)=dt/2*AA_A(i,i+l)/t;

}if (order==2)

{

for(int k=0;k<NS-l;k++)for (int j=0;j<NA-2;j++)

{i=k*NA+j;BB(i,i+2)=dt/2*AA_A(i,i+2) /t;

}for(int k=0;k<NS-l;k++)for (int j=2;j<NA;j++)

{i=k*NA+j;BB(i,i-2)=dt/2*(AA_A(i,i-2) /t) ;

}}

for (int j = 0;j<NA;j++) // the Neumann condition at S=S_max

{i=j+(NS-l)*NA;

Page 111: Achdou and Pironneau-Computational Methods Option Pricing

92 Chapters. Finite Differences

B B ( i , i ) = B B ( i - N A , i - N A ) ;

B B ( i , i - N A ) = - B B ( i , i ) ;

}

2

Finally, the right-hand side of the system of linear equations is constructed by thefollowing program.

ALGORITHM 3.6. Right-hand side.

void CN_Scheme_Asian::build_rhs(KN<double> &u, const KN<double> &u_p,

const double t,const double dt)

{u=0;

AA_A. addMatMul(u_p, u) ;

u/ = t;

AA_S. addMatMul (ujp, u) ;

u*=-dt/2;

for(int k=0;k<NS-l ;k++)

for (int j = 0 ; j < N A ; j + + )

{

int i=j+NA*k;

u ( i ) + = u _ p ( i ) ;

}

for (int j=0;j<NA;j++) // the Neumann condition at S=S_max

{int i=j+(NS-l)*NA;

u(i)=0;

}

]

We use this program for computing an Asian put with strike K = 100. We havechosen 5 = A = 200. The maturity is 1 year, r = 0.05, and a = 0.2. In Figure 3.8, wehave plotted the surface P(S, A) at t ~ 0, / ~ T/2, and t ~ T. The grids are uniform andwe have used the first order in A upwind scheme with 100 nodes in 5 and A, and 50 nodesint.

In Figure 3.9, we plot a zoom of the price of the put at t ~ y, when we use an upwindsecond order and a centered scheme instead of the first upwind scheme for discretizing— S-A/T-r: we see that the second scheme is not monotone and that the centered schemecauses spurious oscillations. Here the grid in (5 < A) has 60 x 60 nodes.

Page 112: Achdou and Pironneau-Computational Methods Option Pricing

3.7. An Asian Put with Fixed Strike 93

Figure 3.8. The Asian put computed by the Crank-Nicolson scheme at t ~ 0,t ~ T/2, and t ~ T.

Page 113: Achdou and Pironneau-Computational Methods Option Pricing

94 Chapters. Finite Differences

Figure 3.9. The Asian put computed by the Crank-Nicolson scheme with a secondorder upwind scheme in A and with a centered scheme at t ~ T/2.

Page 114: Achdou and Pironneau-Computational Methods Option Pricing

Chapter 4

The Finite Element Method

it consists of choosing a finite-dimensional subspace V/, of V, for instance, the space ofcontinuous piecewise affine functions on a triangulation of Q, and of solving the problemwith test and trial functions in Vh, instead of V. In the simpler finite element methods, theconstruction of the space V/, is done as follows:

• The domain is partitioned into nonoverlapping cells (elements) whose shapes aresimple and fixed: for example, intervals in one dimension, triangles or quadrilateralsin two dimensions, tetrahedra, prisms, or hexahedra in three dimensions. The set ofthe elements is in general an unstructured mesh called a triangulation.

• The maximal degree k of the polynomial approximation in the elements is chosen(mostly degree one in this book).

• Vh is made of functions of V whose restriction to the elements are polynomial ofdegree less than k.

Programming the method is also somewhat similar in any dimension, but mesh gen-eration is very much dimension-dependent.

There is a very well understood theory on error estimates for finite elements. It ispossible to distinguish a priori and a posteriori error estimates: in a priori estimates, the erroris bounded by some quantity depending on the solution of the continuous problem (whichis unknown, but for which estimates are available), whereas, in a posteriori estimates, theerror is bounded by some quantity depending on the solution of the discrete problem whichis available.

95

4.1 OrientationConforming finite element methods are numerical approximations closely linked to thetheory of variational or weak formulations presented in Chapter 2. The first finite elementmethod can be attributed to Courant [34].

The framework is the same in any dimension of space d: for a weak formulationposed in an infinite-dimensional function space V, for instance,

Page 115: Achdou and Pironneau-Computational Methods Option Pricing

96 Chapter 4. The Finite Element Method

For a priori error estimates, one can see the books of Raviart and Thomas [103],Strang and Fix [111], Braess [18], Brenner and Scott [20], Ciarlet [27, 28], and Thomee[112] on parabolic problems. By and large, deriving error estimates for finite elementmethods consists of the following:

1. establishing the stability of the discretization with respect to some norms related to|| • || v, as we did for finite difference methods;

2. once this is done, one sees that in simple cases the error depends on some distanceof the solution of the continuous problem to the space Vh. This quantity cannot becomputed exactly since the solution is unknown. However, it can be estimated froma priori knowledge on the regularity of the solution.

When sharp results on the solution of the continuous problem are available, the apriori estimates give very valuable information on how to choose the discretization a priori;see the nice papers by Schotzau and Schwab [109] and Werder et al. [115], in the case ofhomogeneous parabolic problems with smooth coefficients.

A posteriori error estimates are a precious tool, since they give practical informationthat can be used to refine the mesh when needed. In Chapter 5, we consider a posteriorierror estimates for a finite element method appb'ed to the Black-Scholes equation.

In this chapter, we insist on implementation rather than error estimates. The chapteris organized as follows: We first describe the finite element method on a generic parabolicboundary value problem in two dimensions. Then we focus on the Black-Scholes equationin one and two dimensions.

4.2 A Generic Problem

4.2.1 Variational Formulation

Consider the following:

• let £2 be a polygonal domain of M2 (£2 is open and bounded);

• let F be the boundary of £2;

• we assume that F = F</ U FB, where the one-dimensional measure of F^ n Fn is 0;for* e F,

• we denote by n the unit normal vector to F at x, pointing outward;

• we consider smooth enough functions:

Remark 4.1. It is possible to consider more general domains whose boundaries are locallythe graph of a Lipschitz continuous function.

For suitable functions

Page 116: Achdou and Pironneau-Computational Methods Option Pricing

4.2. A Generic Problem 97

we are interested in finding u(x, T) solving the parabolic boundary value problem

where

We recall Green's formula,

which holds whenever the integrals are defined.The variational formulation of (4.1) involves the Sobolev space

which is a Hilbert space endowed with the norm

Calling

T>(Q) the space of the restrictions of the functions of £>(R2) to Q,

we recall that £>(£2) is dense in W.The linear operator u i->- u\?d, which maps a function to its restriction to r</, is

bounded from £>(£2) with the norm || • || w to L2(r^). Therefore, we can define a continuousextension yd of this operator on W, called the trace operator on IV We define V as thekernel of yd. The space V is a closed subspace of W.

Note that it is also possible to define a trace operator from W to L2(FW).For simplicity, we assume that the coefficients K, a, and f3 and the function g are

smooth enough so that there exists a function

with

• Yd(ug) = 8 a-e- with respect to t;

• ^ - V • (KVUg) - V • (aug) + Pug e L2(S7 x (0, 71));

• the normal trace (&wg + (K Vug) •«) |rn can be defined and belongs to L2(Fn x (0, T)).

Page 117: Achdou and Pironneau-Computational Methods Option Pricing

98 Chapter 4. The Finite Element Method

Reasoning as in §2.6, we introduce the bilinear form on W:

Assuming that

for a.e. x e £2, K(X) is a symmetric tensor and there exist two positive constants0 < K < k such that, for all £ e R2,

• a e (L°°(Q))2, ft € L°°(n), ft € L°°(rn),

it can be proved that there exist two positive constants c_ < c and a nonnegative constant A.such that for all u, w e W,

and

The variational formulation of (4.1) is as follows: Find u: u — ug e L2((0, T); V),u e C°([0, T]; L2(ft)), and f e L2((0, T); V), with u|,=0 = MO, and, for a.e. t e (0, T),

Thanks to the bound (4.5) and to Garding's inequality (4.6), it can be proved that, if thereexists ug satisfying the condition above, then the variational formulation has a uniquesolution, which satisfies the first line of (4.1) in the sense of distributions.

4.2.2 The Time Semidiscrete Problem

We introduce a partition of the interval [0, T] into subintervals [fm_i, tm], 1 < m < Af,such that 0 = f0 < *i < • • • < tm = T.

We denote by Atm the length tm — tm-1, and by Af the maximum of Atm, 1 < m < M.For simph'city, we assume that UQ e W.

We discretize (4.7) by means of a Crank-Nicolson scheme; i.e., we look for um e W,m = 0 , . . . , Af, such that u° = UQ and for all m = 1,. . . , M, um - ug(tm) e V, and for allv e V,

where <f>m 1/2 means 0(*m"'2Hm), and similarly for /. This scheme is second order.

Remark 4.2. I/UQ does not belong to W, then we have to approximate first UQ by a functionin W, at the cost of an additional error.

Page 118: Achdou and Pironneau-Computational Methods Option Pricing

4.2. A Generic Problem 99

Figure 4.1. Left: a finite element mesh made of triangles. This mesh has beenobtained by pricing adoptively an American basket option. Right: these cases are ruledout.

4.2.3 The Full Discretization: Lagrange Finite Elements

Discretization with respect to x is obtained by replacing W (resp., V) by a subspace of finitedimension Wh C W (resp., V), C V). For example, one may choose for Vh, a space ofcontinuous piecewise polynomial functions on a triangulation of £2 vanishing on F</. Fora positive real number h, consider a partition Th of £2 into nonoverlapping closed triangles(Th is the set of all the triangles forming the partition) such that

• Q = (JKeThK;

• for all AT ̂ AT', two triangles of Th, K n K' is either empty, a vertex of both K andKf, or a whole edge of both K and K';

• for all K e Th, the one-dimensional measure of K n F^ (resp., K D Fw) is either 0 orK nrd (resp., AT n Fn) is a whole edge of AT;

• maxtfeT^ diameter(AT) = h.

For these conditions to hold, £2 must be polygonal (to be covered exactly by a triangulation).However, if £2 is not polygonal but has a smooth boundary, it is possible to find a set Thof nonoverlapping triangles of diameters less than h such that the distance between £2 and\JK€j-hK scales like h2.

In Figure 4.1, we show examples of situations which can or cannot occur with themesh defined above.

Exercise 4.1. Call NT the number of triangles in Th, NE the number of edges, Nv thenumber of vertices, and NQ the number of vertices lying in the open domain £2. Prove that

For k a positive integer, we introduce the spaces

Page 119: Achdou and Pironneau-Computational Methods Option Pricing

100 Chapter 4. The Finite Element Method

We focus on the case where k = 1; i.e., the functions in Wh are piecewise affine. Itis clear that Wh is a finite-dimensional subspace of W and that V/, is a finite-dimensionalsubspace of V.

Assume that for each m = 1 , . . . , M, there exists a function u™ h e Wh such that thetrace of u™h on F^ is g(tm). If it is not the case, g(tm) must be approximated first by thetrace of a function in Wh, at the cost of an additional error. For example, if g is continuouson r^, one can take the Lagrange interpolation of g.

Assuming that UQ e Wh, the full discretization of the variational formulation consistsof finding u% e Wh, m = 1 , . . . , M, such that itf - u™h e Vh, and, with u°h - UQ,

4.2.4 The Discrete Problem in Matrix Form

Abasis of Vh is chosen, (tu,),=i,...,#• Then, for 1, . . . , M, u™ can be written as

and, applying (4.11) to (4.10) with u/, = w{, we obtain a system of linear equations fornm — (um\r— \uj )j=l,...,N-

where M and A are matrices in R^xAr:

and

The matrix M is called the mass matrix and A the stiffness matrix. It can be proved, thanksto estimates (4.5) and (4.6), that if Ar is small enough, then M + A^"- A is invertible, so it ispossible to solve (4.12).

Page 120: Achdou and Pironneau-Computational Methods Option Pricing

4.2. A Generic Problem 101

4.2.5 The Nodal Basis

Hereafter, we take k = 1, so we deal with piecewise linear finite elements. On each triangleK E Th, denoting by ql, i = 1, 2, 3, the vertices of K, we define for x e R2 the barycentriccoordinates of x, i.e., the solution of

This 3x3 system of linear equations is never singular because its determinant is twicethe area of K. It is obvious that the bary centric coordinates A.f are affine functions of x.Furthermore,

• when x e K, Xf > 0, i = 1, 2, 3;

• if K — [qil, q'2, q'3] and x is aligned with q'1, qh, then A.J = 0.

Let Vh be a function in Wh'. it is easy to check that, on each triangle K e Th,

Therefore, a function in Wh is uniquely defined by its values at the nodes of Th and a functionin Vh is uniquely defined by its values at the nodes of Th not located on IV

Call (ql)i=i,...,N the nodes of Th not located on F^, and let wl be the unique functionin Vh such that wl ( q j ) = Sjj for all j = 1 , . . . , N. For a triangle K such that ql is a vertexof K, it is clear that wl coincides in K with one of the three barycentric coordinates attachedto triangle K. Therefore, we have the identity

which shows that (w'),=1 >Ar is a basis of Vh. As shown in Figure 4.2, the support of w'is the union of the triangles of Th containing the node q1, so it is very small when the mesh

Figure 4.2. The shape function wj

Page 121: Achdou and Pironneau-Computational Methods Option Pricing

102 Chapter 4. The Finite Element Method

is fine, and the supports of two basis functions, w' and wj, intersect if and only if ql and qiare the vertices of a same triangle of Th. Therefore, the matrices M and A constructed withthis basis are very sparse. This reduces dramatically the complexity when solving properly(4.12). The basis (u;'),=i ^ is often called the nodal basis of Vh. The shape functionsw' are sometimes called hat functions. For u/, e Vh, the values u, = Vh(q') are called thedegrees of freedom of Vh.

UK — [q'1, q'2, q13], and if b'1 is the point aligned with q'2 and q'3 and such thattfiq^ _L <7'2g'3, then

and calling w'1 the unit vector orthogonal to q'2q'i and pointing to q'1, i.e., w'1 = . • bilq'1If'^'H

and E'1 the length of the edge of K opposite to q11, and using the well-known identityEil I^'V1 | = 2\K\, we obtain

This yields in particular

where a% is the angle of K at vertex q'3.The following integration formula is very important for the numerical implementation

of the finite element method.

Proposition 4.1. Calling A,-, i = 1, 2, 3, the barycentric coordinates of the triangle K, andv\, v"2, V3 three nonnegative integers, and \K\ the measure of K,

Remark 4.3. It may be useful to use bases other than the nodal basis, for example, basesrelated to wavelet decompositions, in particular for speeding up the solution o/(4.12); see[95, 114].

Remark 4.4. The integral of a quadratic function on a triangle K is one-third the sum ofthe values of the function on the midedges times \K\, and therefore (4.19) is simpler whenvi + vi + V-? = 2:

Remark 4.5 (mass lumping for piecewise linear triangular elements). Let f be a smoothfunction and consider the following approximation for the integral of f over £2 = U^eT^ K>where 7h is a triangulation of SI:

Page 122: Achdou and Pironneau-Computational Methods Option Pricing

4.2. A Generic Problem 103

where q\ , qf, q% are the three vertices ofK. If f is affine, this formula is exact; otherwiseit computes the integral with an error O(h2).

This approximation is called mass lumping: for two functions Uh, u>h e V/,, we callU and V the vectors of their coordinates in the nodal basis (see (4.15)): mass lumpingpermits us to approximate JQ uhVh by UTMV, where M is a diagonal matrix with positivediagonal entries.

4.2.6 Stabilization by Least Squares

Exactly as for finite differences, the Galerkin finite element scheme presented above be-comes unstable in the maximum norm when the nonsymmetric term in (4.1) becomes domi-nant (for example, this is the case for some Asian options). One has to stabilize the method:one way is to add a least squares term to (4.8). We consider the sum on the elements of thesquared residuals:

Finding u™ as the minimizer of Jm(v, u™ *) over u™h + V/, amounts to solving a leastsquares approximation to (4.1). It consists of solving the Euler equations

where

with

and where F(Vh} is a linear form depending on u™ 1,<t>m 2 and fm 2.

Page 123: Achdou and Pironneau-Computational Methods Option Pricing

104 Chapter 4. The Finite Element Method

This method has serious drawbacks: the condition number of the matrix in the systemof linear equations (4.21) scales as the square of the condition number of the matrix in theGalerkin method. Therefore, the solution is much harder to compute by iterative methodsand more sensitive to roundoff errors. Also, this method is less accurate in the regions wherethe solution is smooth.

Therefore, it is much better to mix together the Galerkin and the least squares ap-proximations, and the resulting method is called the least squares Galerkin method: for awell-chosen parameter <5, the new discrete problem is to find u™ e u™ h + Vh,m = 1 , . . . , M,with uQ

h = uQ, and

Of course, this problem amounts to solving a system of linear equations for the valuesof u™ at the vertices, with a new matrix M + Atm/2 A. The stability is increased because thediagonal coefficients of the matrix are larger now. It is possible to study this procedurethoroughly, including a priori error estimates, and to choose 8 in an optimal way. There aremany references on this topic; see, for example, [54].

4.3 The Black-Scholes Equation with Local Volatility

We are interested in discretizing the Black-Scholes equation for a vanilla put, i.e., (3.45),(3.46), (3.47), with a finite element method. The variational formulation that we start fromhas been introduced in §2.3.2 and is given in (2.23), (2.24).

We introduce a partition of the interval [0, S] into subintervals KI = [5,-_i, 5,-], 1 <i < AT + 1, such that Q = SQ < Si < ••• < SN < SN+i = 5. The size of the_intervalTI is called h{ and we set h = max^i^.^+i hi. We define the mesh TH of [0, 5] as theset {KI, ..., KN+I}. In what follows, we will assume that the strike K coincides with somenode of Th'. there exists kQ, 0 < JCQ < N + 1, such that 5^ = K. We define the discretespace Vh by

The assumption on the mesh ensures that P0 e Vh. The discrete problem obtained byapplying the Crank-Nicolson scheme in time reads as follows:

Find (P^0<m<M, PH e Vh satisfying

and for all m, 1 < m < M,

Page 124: Achdou and Pironneau-Computational Methods Option Pricing

4.3. The Black-Scholes Equation with Local Volatility 105

where am = a,m and

Note that, for v, w e V^, we have a simpler expression for at(v, w) when a is continuouswith respect to 5:

where [ff ]($•) is the jump of ff at 5,-:

Let (u/),=o,...;v be the nodal basis of Vh, and let M and Am in R^+Dx^+D be the mass andstiffness matrices defined by M,-,y = (w1, u>;), A™j = atm(wj, w1), 0 < z, 7 < N. Calling

Pm = (P fcm(50),..., P^(SN))T and P° - (P0(S0), • • •. ^oC^))7, (4.25) is equivalent to

The shape functions w1 corresponding to vertex 5, are supported in [5,_i, Si+i ]. This impliesthat the matrices M and Am are tridiagonal because when |z — j\ > 1, the intersection ofthe supports of wi' and w; has measure 0. Furthermore

giving

Page 125: Achdou and Pironneau-Computational Methods Option Pricing

106 Chapter 4. The Finite Element Method

From this, a few calculations show that the entries of Am are

Note that when the mesh is uniform, we recover the matrix A (up to a scaling by hfor the rows / > 1, and | for the row i = 0) found when using the finite difference methodin §3.3; see (3.49). The entries of M are

Therefore, when the mesh is uniform, the scheme (4.29) is not completely equivalent to thefinite difference scheme because M is not diagonal. However, in this case, it is possible touse a quadrature formula which makes of M a diagonal matrix M: M,,, = £\ M,->;- (thisprocess is called mass lumping). Doing so, one obtains a scheme completely equivalentto the finite difference scheme. So, when the mesh is uniform, the finite element methodwith mass lumping is equivalent to the finite difference centered scheme, although it hasnot been obtained in the same manner.

When the mesh is not uniform, the scheme (4.29) can also be seen as a finite differencescheme of second order with respect to 5. Indeed, calling Si±i = |(Sj+S,±i), it correspondsto using the following finite difference approximations for the second order derivative:

Page 126: Achdou and Pironneau-Computational Methods Option Pricing

4.4. A Black-Scholes Equation Solver in C++ 107

and for the first order derivative,

Exercise 4.2. Prove that the finite difference scheme obtained by the two sets of formulasabove is second order accurate.

4.4 A Black-Scholes Equation Solver in C++The following program solves the one-dimensional Black-Scholes equation with variablea with a Crank-Nicolson scheme and piecewise affine finite element in 5. The systemsof linear equations are solved by LU factorization. The time grid may have variable steps,whereas the mesh in S does not vary with time. A program where the mesh in 5 can varyin time is given in the next chapter.

As in §3.7.2, we use the RNM vector + sparse matrix class of Danaila, Hecht, andPironneau [38]. It is not necessary to study these classes in order to use them. One needonly know how to call them and how to use the overloaded operators. It may seem likeoverkill, but it will allow us to hide low-level implementations using the bias library forspeed and adaptation to the computer architecture.

A CN_Scheme class is defined for the Crank-Nicolson scheme as follows.

ALGORITHM 4.1. CN-scheme.class CN_Scheme{private:vector<double> S_nodes, S_steps; // node and element sizesvector<double> grid_t; // the time griddouble rate (double) ; // interest rate is a function of timedouble vol (double,double); // vol. is a function of time and SMatriceProfile<double> B; // matrix M+dt/2 A

public:CN_Scheme (const vector<double> &g_grid_S,

const vector<double> &g_S_steps,const vector<double> & g_grid_t) :S_nodes(g_grid_S) ,

S_steps(g_S_steps), grid_t(g_grid_t),B(g_grid_S.size()-1,2) {}; // constructor

void Time_Step(int i, vector<KN<double> > &P) ;void build_rhs (KN<double> &u, const KN<double> &u_p,

const double t,const double dt) ;void build_matrix(MatriceProfile<double> &B , const double t,

const double dt);

h

A time step of the method is implemented in the function Time_Step: it consistsof building the matrix B = M + ^-A™ (we have assumed that local volatility is a function

Page 127: Achdou and Pironneau-Computational Methods Option Pricing

108 Chapter 4. The Finite Element Method

of time and 5, so the matrix has to be recomputed at each time step), computing its LUfactorization, constructing the right-hand side of the system of linear equations, and solvingthis system.

ALGORITHM 4.2. Time step.

void CN_Scheme::Time_Step(int it, vector< KN<double> >& P)

{double t=grid_t[it]; // current timedouble dt=t-grid_t[it-1] ; // current time stepbuild_matrix(B,t,dt) ; // computes B =(M+dt/2* A)B . L U O ; // LU factorization of Bbuild_rhs(P[i t] ,P[i t- l] , t -d t ,d t ) ; // computes the RHSB.Solve(P[i t ] ,P[ i t ] ) ; // solves the system

]

The matrix B = M + ^"-A"1 is assembled as follows.

ALGORITHM 4.3. Matrix assembly.

void CN_Scheme::build_matrix(MatriceProfile<double> &B,const double t,const double dt)

{ int i;double S,h_jp,h_n, a,b,c,d;double r=rate(t);

// computes the first row of Bh_n=S_steps[0] ;B(0,0) = (0.25*dt*r+l./3)*h_n;B(0,l)=h_n/6;

for (i=l; i< S_steps .size 0-1; i++){ // computes the i-th row of Bh_p=h_n;S=S_nodes[i] ;h_n=S_steps[i] ;a=pow(S*vol(t,S),2) ;b=a/h_jp;c=a/h_n;d=r*S;

B(i , i )=0 .25*dt*(b+c+r*(h_p+h_n))+ (h_p+h_n)/3 ;B(i, i-l)=0.25*dt*(-b+d)+h_p/6;B( i , i+ l )=0.25*dt*( -c-d)+h_n/6 ;

}h_p=h_n; // computes the last row of BS=S_nodes[i];h_n=S_steps[i] ;a=pow(S*vol(t,S) ,2) ;b=a/h_p;c=a/h_n;d=r*S;B( i , i )=0 .25*dt*(b+c+r*(h_p+h_n))+ (h_p+h_n)/3 ;B( i , i - l )=0 .25*dt*(-b+d)+h_p/6;

]

Page 128: Achdou and Pironneau-Computational Methods Option Pricing

4.4. A Black-Scholes Equation Solver in C++ 109

The right-hand side is computed as follows.

ALGORITHM 4.4. Right-hand side.

void CN_Scheme::build_rhs(KN<double> &u,const KN<double> &u_p,const double t,const double dt)

{ // u_p is the solution at the previous time step// u will be the right-hand side of the linear system// u is computed from u_p by a loop on the elements

double r , c ,d ; // auxiliary variablesdouble x_l,x_r; // left and right endpoints of current elementdouble v_l,v_r; // links to the values of the vol. at x_l,x_rdouble u_l,u_r; // d.o.f. of u_p associated to the current element

r=ra te( t ) ; u=0; // all the components of u are initialized to 0x_l=0; // some initializations before entering the loopu_l=u_p (0) ;v_l=0.5*pow(x_l*vol(t ,x_l) ,2);int i;for ( i=0; i<S_steps.size ()-1;i++) // loop on elements

{// left val. of x, u_p and vol at left end of elem. are known

x_r=S_nodes [i + 1] ; // get x, u_p and vol at right end of elem.v_r=0.5*pow(x_r*vol(t,x_r),2);u_r=u_p (i+1) ,-

c=u_r-u_l;d=c/S_steps[i];u(i)+=S_steps [i] /6 .* (2*u_l+u_r)

+0.5*dt*(d*v_l+(c*(2*x_l+x_r)-(2*u_l+u_r)*S_steps [ i ] )*r /6) ;u (i+1)+=S_steps [i]/6.*(u_l+2*u_r)

+ 0.5*dt*(-d*v_r+(c*(2*x_r+x_l)-(2*u_r+u_l)*S_steps [ i ] )* r /6 ) ;

// right val. becomes left val. for the next elem.x_l=x_r;u_l=u_r;v_l=v_r;

}// last elem. is special because of Dirichlet conditions

c=-u_l;d=c/S_steps[i] ;u ( i )+=S_s teps [ i ] /3 .* (u_p( i ) )

+0.5*dt*(d*v_l+(c*(2*x_l+x_r)-2*u_l*S_steps[i])*r/6);

}

In Figure 4.3, we compare the error produced by the method programmed above fortwo grids: a uniform grid with 100 nodes in t and 100 nodes in S, and a nonuniform gridwith the same number of nodes and an algebraic refinement near t = 0 and S = K. Wesee that the error is much larger with the uniform grid. We see also that when the mesh isnonuniform there is an error at high values of 5, which becomes comparable to the errornear the money: this error is due to the artificial boundary conditions. For improving onthis, one should either take S larger or use transparent boundary conditions (see §4.5).

Page 129: Achdou and Pironneau-Computational Methods Option Pricing

110 Chapter 4. The Finite Element Method

Figure 4.3. The pointwise error produced by the Crank-Nicolson scheme andpiecewise affine finite element methods for uniform and nonuniform grids with 100 x 100nodes.

4.5 A Transparent Boundary Condition

While the Black-Scholes equation is set on (0, +00), localization at 5 e (0, 5) implies anerror which decays fast as ^ grows. Nevertheless, for saving time, one may need to haveS as small as possible—for example, 5=1.2K.

Page 130: Achdou and Pironneau-Computational Methods Option Pricing

4.5. A Transparent Boundary Condition 111

Transparent boundary conditions were proposed in computational physics for linearpartial differential equations with constant coefficients, for which the Green's functions areknown, and in particular in electromagnetism, where one frequently deals with unboundeddomains; see [80]. They permit us to compute the solution in a bounded domain with noerrors. We propose adapting the idea to the present situation.

Consider the problem

with the compatibility condition g(0) = 0. It corresponds to a, r constant and is obtainedfrom (2.9) by performing several changes of variables and unknown function; see §2.2.3,in particular the change of variable x — log S. Extending u in x < L by M(x , t) = g(t) andcalling q = —dxit(L, t), this problem is equivalent to

So the solution satisfies

~T"where G(x, t) = e 4tV4nt is the fundamental solution to the heat equation, which yields atx = L

i.e., since /0°° G(z, t - r)dz = ±,

This, in turn, is approximated numerically by

Returning to the Black-Scholes equation in the variable 5, in the special case whenr — o"2/2, the transparent condition is

and is approximated by

Page 131: Achdou and Pironneau-Computational Methods Option Pricing

112 Chapter 4. The Finite Element Method

When r is a different constant, the new function v = u(x, t)e z°2 e ^ (with u(x, t) =P ( S , t), x = log(S)) satisfies

which yields

and in the 5 variable,

As above, this is approximated by

Discretization by finite differences on a uniform grid of step At and h gives

where

The program for an Euler scheme with transparent boundary condition is as follows.

ALGORITHM 4.5. Transparent boundary conditions.

void Euler_Scheme::Time_Step_Transp_BC(int it, vector< KN<double> >& P,int verbose)

{int i,n;double dt,t,S,h_p,h_n,r;double a,b,c,d,e;double co_l,co_2;double pi=4*atan(l.);

n=S_steps [it] . sizeO ;

Page 132: Achdou and Pironneau-Computational Methods Option Pricing

4.5. A Transparent Boundary Condition 113

MatriceProfile<double> A ( n , 2 ) ;t=grid_t[it];dt=t-grid_t[it-1] ;r=rate(t) ;e=0.5*dt;

h__n=S_steps [it] [0] ;A(0 ,0 )=e*r*h_n+ h_n/3;A ( 0 , l ) = h _ n / 6 ;fo r ( i= l ; i< n- l ; i++)

{h_p=h_n;S=S_nodes[it] [i] ;h_n=S_steps[it] [i] ;a=pow(S*vol(t ,S) ,2) ;b=a/h_p;c=a/h_n;d=r*S;A ( i , i )=e* (b+c+r* (h_p+h_n) ) + (h_jp+h_n)/3 ;A ( i , i - l ) = e * ( - b + d ) + h _ p / 6 ;A( i , i+ l )=e* ( -c -d )+h_n /6 ;

}h_p=h_n;S=S_nodes[it] [i] ;h_n=S_steps[it] [i] ;double Smax=S;double eta_infi=vol(t,Smax);double eta_infi_sq= pow(eta_inf i ,2 . ) ;double aux_tr=r- 0.5*eta_infi_sq;A( i , i )=sqr t (2*p i ) + sqrt(dt)*(aux_tr/eta_infi + 2* eta_infi *Smax/ h_n) ;A ( i , i - l ) = - 2 * sqrt(dt)*eta_infi*Smax/ h_n;if (change_grid[it])

build_rhs(P[it],P[it-l] ,S_steps [it-1],S_nodes[it-1] ,S_steps[it],S_nodes[it]);

elsebuild_rhs_same_grid(P[it],P[it-l],S_steps[it-1],S_nodes[it-1],

S_steps[it],S_nodes[it]);P [ i t ] ( n - l ) = 0 ;for (int j = l ; j < i t ; j + + )

{double t2=grid_t[j];double dt2=t2-grid_t[j-1];double r2=rate( t2) ;int siz= S_steps[j] .size()-1;double h2= S_steps[j] [siz];co_l=-dt2*((r2- 0.5*eta_infi_sq)/(2*eta_infi) + eta_infi*Smax/h2) ;co_2=dt2 * eta_inf i * Smax/h2;P[it] ( n - l ) + = ( P [ j ] (siz)*co_l+P[j] (siz-1) *co_2)

* exp(-pow((r2+ 0.5*eta_infi_sq),2.)* ( t - t2) / (2*eta_inf i_sq)) /sqr t ( t - t2) ;

}A.LUO ;A.Solve(P[it] ,P[ i t ] ) ;

}_

Page 133: Achdou and Pironneau-Computational Methods Option Pricing

114 Chapter 4. The Finite Element Method

The sum

can be approximated as follows:

This expression can be computed much faster because an induction formula is available forthe last sum.

Exercise 4.3. Write down the transparent boundary condition for (2.12) with a constantdividend yield q > 0.

Exercise 4.4. Write down the transparent boundary condition for Dupire's equation (2.51)for constant dividend yield and interest rate.

Figure 4.4 illustrates the performances of the transparent boundary conditions at S =1.4K and S = 1.2K, for a put option, with uniform volatility. The option price is wellapproximated, whereas the Dirichlet condition P(S) = 0 gives bad results. There remainsan error though, due to

• the integration formula for (4.32);

• the fact that the function does not solve exactly the Black-Scholes equation in (0, 5) x(0, T).

In Figure 4.5, the price obtained with transparent boundary conditions at 5 = IAK and5 = 1.2K one year to maturity is compared to the exact price.

4.6 Levy Driven Assets

As in §2.5, one may consider LeVy driven assets. The aim of this section is to describeseveral possible ways to discretize the partial integrodifferential equation (2.57).

4.6.1 A Scheme with an Explicit Discretization of the Nonlocal Term

In [32], it is shown that when the kernel k is not too singular or when diffusion dominates,an explicit treatment of the nonlocal term is good enough. This means that a minor modifi-cation of the program for the usual Black—Scholes equation will suffice: at every time step tm,

Page 134: Achdou and Pironneau-Computational Methods Option Pricing

4.6. Levy Driven Assets 115

Figure 4.4. Top: error in the exact price when using an Euler scheme with thenew boundary condition on a European put at T = 1 for a = 0.2, r = 0.04, S = 1.4,K = 140. Bottom: error with the Dirichlet condition P(S, t) = 0. There are 70 nodes inthe S direction and 50 time steps.

before the resolution of the system of linear equations one must change the right-hand sideof the linear system from Pm At to (Pm + v) Af with

(recall that t is the time to maturity).Let Si be the node of a uniform mesh with step size h. Let us denote by P™ the

approximation of P(S,-, mAf), i =Q,...,N. We approximate the integral v(S) by a finite

Page 135: Achdou and Pironneau-Computational Methods Option Pricing

11 6 Chapter 4. The Finite Element Method

Figure 4.5. Comparison with the exact solution at T = 1 when using transparentand Dirichlet conditions at S = 140 (top) and S = 120 (bottom).

sum over j = 0,. . . , N:

ALGORITHM 4.6. An elementary program.void getAu() {

const double c=0.1/sqrt(8*atan(l.0));for(int i=l;i<nS-l;i++){

v[ i ]=0 ;

for(int j= l ; j<nS ; j++){

double x = log(double( j) / i ) ;

Page 136: Achdou and Pironneau-Computational Methods Option Pricing

4.6. Levy Driven Assets 11 7

double w = u [ j ] - u [ i ] - ( u [ i+ l ] -u [ i ] ) * ( j - i ) ;v[i] += w*c*exp( -x*x /2) / ( j+0 .5 ) ;

}}

}_

In Figure 4.6, we have plotted the price of a vanilla put option computed with theEuler explicit scheme with Algorithm 4.6, when the underlying asset is described by a Levyprocess, with k(z) = e~^, as well as the price of the same option given by the standardBlack-Scholes model.

4.6.2 A Semi-Implicit Scheme and a Program for Options on CGMYDriven Assets

We are going to propose a scheme where the nonlocal term is discretized partly implicitly;i.e., the nonlocal interaction between nodes close to each other will be treated implicitly.On the contrary, when two nodes are far enough from each other, their interaction will betreated explicitly. The advantage of such a method is twofold:

• the systems of linear equations to be solved at each time step involve banded matrices;

• one can tune the bandwidth of this matrix in order to obtain a stable scheme.

Calling as above wj the shape functions, we have to compute

with k given by (2.59). The first step is to compute

Figure 4.6. A put option on an underlying asset modeled by a Levy process andcomparison with the same modeled by a Black-Scholes equation.

Page 137: Achdou and Pironneau-Computational Methods Option Pricing

118 Chapter 4. The Finite Element Method

To simplify the discussion, we focus on the case where the parameter Y satisfies0< Y < 1.

We discuss in detail the case when 5 > S/+i: in this case,

Calling x the function x

we see that

where E\ is the exponential integral E\(x) = ff° *-j-dt.

2. IfY = 1,

Note that x can be written using special functions:

1. IfF = 0,

where £2 is the second order exponential integral EI(X) = J™ ~rdt.

3. I f O < Y < 1,

where F(a, x) is the incomplete T function: T(a, x) = f*°° ta le 'dt.

Page 138: Achdou and Pironneau-Computational Methods Option Pricing

4.6. Levy Driven Assets 119

After some calculations, one obtains the following in a similar manner:

1. IfSy < S < Sy+i '

2. JfSj-i < S < Sj

The special functions E\, £2, and F( , ) are programmed in the GSL [59]. Using thislibrary, the code for the function x is as follows.

ALGORITHM 4.7. x«

^include <gsl/gsl_sf.h>

double chi(double x, double C,double M,double Y)

{if (Y<le-6)

3. IfS< Sj-i,

Page 139: Achdou and Pironneau-Computational Methods Option Pricing

120 Chapter 4. The Finite Element Method

{if (x<50)return gsl_sf_expint_El(M*x)/C;

elsereturn 0;

}else

if( l.-Y<le-6)

{if (x<50)return gsl_sf_expint_E2(M*x)/C/x;

elsereturn 0;

}else

{if (x<50)return

(exp(-x*M)* pow(x, -Y) -pow(M, Y)*gsl_sf_gamma(l.-Y)*gsl_sf_gamma_inc_Q(l-Y,M*x))/C/Y;

elsereturn 0;

}

J

Then the program for computing the function wl (5)7(5) is as follows.

ALGORITHM 4.8. CGMY1.

double fu_I (double x, void * params)

{double * alpha= (double*) params;double xO=alpha[0];double xl=alpha[1];double x2=alpha[2];double hO=xl-xO;double hl=x2-xl;double res;if (x>x2)

{double logo;

i f ( x O > 0 )logO=log(x/xO);

elselogO=50;

double logl=log(x/xl);double Iog2=log(x/x2);if ( (l+G)*log2>50)res=0;

else

{res=x2/hl*chi(log2,C,G,Y) - (x2/hl+xO/hO) * chi(logl,C,G,Y)+

Page 140: Achdou and Pironneau-Computational Methods Option Pricing

4.6. Levy Driven Assets 121

x d / h O * c h i ( l o g O , C , G , Y )-x*(ch i ( log2 ,C , l+G,Y) /h l+ch i ( logO,C ,1+G, Y) /hO

-ch i ( l og l ,C ,G+l ,Y)* (1 /h l + l /hO) ) ;}

}else

if (x>xl){double logO;if(xO>0)logO=log(x/xO);

elselogO=50;

double logl=log(x/xl);double Iog2=log(x2/x);res=-x2/hl*chi(log2,C,M,Y) +x/hl*chi(Iog2, C,M-1,Y) +xO/hO*chi(logO,C,G,Y)-x/hO*chi(logO,C,1+G, Y)+(1/hO+l/hl)*x*chi(logl,C,1+G,Y)-(xO/hO+x2/hl)*chi (logl,C,G,Y);

}else

if (x>xO)

{double logO ,-if(xO>0)logO=log(x/xO);

elselogO=50;

double logl=log(xl/x) ;double Iog2=log(x2/x) ;res= xO/hO*chi(logO,C,G,Y)-x/hO*chi(logO,C, 1+G,Y)

-x2/hl*chi(log2,C,M,Y)+x/hl*chi(Iog2 , C,M-1,Y)-(l/hO+l/hl)*x*chi(logl,C,M-l,Y)

+(xO/hO+x2/hl)*chi(logl,C,M,Y);

}else

{double logO=log(xO/x);double logl=log(xl/x);double Iog2=log(x2/x);if(M*logO>50)res= 0;

else

{res=-x2/hl*chi(log2,C,M,Y) +(x2/hl+xO/hO) * chi ( logl ,C,M,Y)

- xO/hO*chi(logO,C,M,Y)+x*(chi(Iog2 ,C,M-1,Y)/h l+chi ( logO, C , M - 1 , Y ) / h O

-chi( logl ,C,M-1,Y)*(1/hl+l /hO) ) ;

}}

res*=alpha[3]+x*alpha[4];return res;

]

Note that this function has to be modified if j = 0.

Page 141: Achdou and Pironneau-Computational Methods Option Pricing

122 Chapter 4. The Finite Element Method

We propose the following semi-implicit scheme for discretizing (2.57): Calling B thematrix defined by

we choose an integer b, we call B the banded matrix such that

and we take B — B—B. With A the stiffness matrix for the standard Black-Scholes equationand with Pm = (Pm/n(50),.. -, P£*(SN))T and P° = (P0(S0),..., P0(SN))T, the scheme is

Computing the entries of B amounts to computing an integral of a singular function: forthat, we use the GSL function gsl_integrat ion_qagp, and a simplified program fora time step is the following.

ALGORITHM 4.9. CGMY2.

#include <gsl/gsl_math.h>^include <gsl/gsl_integration.h>

void Euler_Scheme_for_Levy::Time_Step(int it, vector< KN<double> >& P)

{int i, n;double dt, t, S,h_jp,h_n, r;double a,b,c,d,e;gsl_integration_workspace *w =gsl_integration_workspace_alloc(200) ;double res;double err;size_t si=200;

double * param=new double [5],-gsl_function F;n=S_steps[it].size();MatriceProfile<double> A(n,max(2,bandwidth));

t=grid_t[it] ;dt=t-grid_t[it-1];r=rate(t) ;e=0.5*dt;h_n=S_steps[it] [0] ;A(0,0)=e*r*h_n+ h_n/3;A(0 , l )=h_n /6 ;for( i=l ; i< n-l ; i++)

{hj)=h_n;S=S_nodes[it] [i] ;h_n=S_steps[it] [i] ;a=pow(S*vol ( t ,S) ,2) ;b=a/h_p;

Page 142: Achdou and Pironneau-Computational Methods Option Pricing

4.6. Levy Driven Assets 123

c=a/h_n;d=r*S;

A ( i , i )=e* (b+c+r* (h jp+h_n) )+ (h_jp+h_n)/3;A ( i , i - 1 ) = e * ( - b + d ) + h j p / 6 ;A ( i , i + 1 ) = e * ( - c - d ) + h _ n / 6 ;

}h_p=h_n;S=S_nodes[it][i];h_n=S_steps[it][i];a=pow(S*vol(t ,S) ,2) ;b=a/h_p;c=a/h_n;d=r*S;A( i , i )=e* (b+c+r* (h_p+h_n) )+ (h_p+h_n)/3;A ( i , i - l ) = e * ( - b + d ) + h _ p / 6 ;

for ( i = 0;i< n , - i++)

{S=S_nodes[it][i];double Sn=S_nodes[it] [i+1];h_n=S_steps[it] [i] ;for(int j = -bandwidth+1;j <bandwidth;j ++)

i f ( ( i + j < n ) & & ( i + j > = 0 ) )

{param[0]=S_nodes[it][i+j-1];param[l]=S_nodes[it] [ i + j ] ;param[2]=S_nodes[it][i+j+1];param[3]=Sn/h_n;param[4]=-1./h_n;double * sing=new double[2];sing[0]=S;sing[1]=Sn;if ( i + j > 0 )

F.function=& fu_I;else

F.function=&fu_I_0;F.params=param;gsl_integration_qagp(&F,sing,2, 0 ,0 .001,s i , w,&res,&err) ;A( i , i+ j ) -=e*res ;if ( i<n-l)

{param[3]=-S/h_n;param [4] =1. /h_n,-F.params=param;gsl_integration_qagp(&F,sing,2, 0, 0.001,si, w,&res,&err);A(i+l, i+j) -=e*res,-

}}

}build_rhs(P[it],P[it-l],S_steps[it],S_nodes[it] , it) ;A.LUO ;A. Solve(P[it] , P [ i t ] ) ;

}

Page 143: Achdou and Pironneau-Computational Methods Option Pricing

124 Chapter 4. The Finite Element Method

We skip the description of the function build_rhs.Note that the algorithmic complexity for constructing the matrix and the right- hand

side is O(N2), so it is one order larger than for the standard Black-Scholes equation withlocal volatility. There are ways of improving this: either by using a wavelet basis (see [95,94] for a sophisticated procedure using nonuniform time meshes and wavelet compressionin the price variable— this method can be used for barrier options and American optionsfor Levy driven assets) or by using the fast Fourier transform [24], with a narrower rangeof applications.

Numerical Results. We take a = 0, C = 1, M = 2.5, G = 1.8, so the Levy processis a pure jump process. In Figure 4.7, we plot the price of a put with strike K = 100 oneyear to maturity for several values of Y. In Figure 4.8, we plot the price as a function oftime to maturity and of S for Y = 0.5. We see also that even with such a nonuniform mesh,the scheme is stable. In Figure 4.9, we plot the solution computed with a = 0, C = 1,M = 2.5, G = 1.8, and Y = 0.9 and by treating the nonlocal term fully explicitly (b = 0 in(4.35)), we see that instabilities develop. With the same parameters and mesh, taking b = 2suffices to stabilize the scheme. In Figure 4.10, we set a = 0.1 and we compare the pricegiven by the Black-Scholes formula with prices of CGMY driven assets for Y = 0, 0.5, 0.9,withC= 1,M = 2.5, G= 1.8.

Figure 4.7. A put option on a CGMY driven asset for Y = 0, Y = 0.2, and Y = 0.9.

Page 144: Achdou and Pironneau-Computational Methods Option Pricing

4.6. Levy Driven Assets 125

Figure 4.8. A put option on a CGMY driven asset for Y = 0.5 as a function of S and t.

Figure 4.9. Instabilities caused by a fully explicit treatment of the nonlocal term.

Page 145: Achdou and Pironneau-Computational Methods Option Pricing

126 Chapter 4. The Finite Element Method

Figure 4.10. Comparison between the price of a put computed by the Black-Scholes formula with a = 0.1 and puts on CGMY driven assets with a = 0.1 and Y =0, 0.5,0.9.

4.7 Programs for Two-Dimensional Cases

4.7.1 Options on a Basket of Assets

We consider an option on a basket of two assets whose price is obtained by solving thevariational problem (2.70), (2.71), where the bilinear form a is given by

where the domain Q is the rectangle (0, 50 x (0, Si). Let a triangulation of Q be obtainedby three families of parallel lines (like a finite difference mesh where the mesh rectanglesare divided into two triangles using always the same diagonal). Using the basis (U>'),<ATof the shape functions introduced in §4.2.5 (N is the number of vertices in Q), and alexicographic ordering of the degrees of freedom, the matrix A has generally nine nonzerodiagonals (it may be pentadiagonal in the case when Si2 = Sii = 0). The bandwidth, i.e.,max{|i — j | : A,7 ^ 0}, is of the order of */N. A direct solution of the system of linearequations by the Gauss factorization algorithm is not the best method when N is large; it isbetter to use a biconjugate or GMRES method, or simply a conjugate gradient method [69]if the drift term has been treated explicitly in the time discretization; see [81,106,107,113]for descriptions of advanced iterative methods for systems of linear equations; note also that

Page 146: Achdou and Pironneau-Computational Methods Option Pricing

4.7. Programs forTwo-Dimensional Cases 127

for a more general mesh, the matrices M and A are not pentadiagonal, but they are sparse.The iterative methods do not need the matrix A but only a function which implementsU —> At/, i.e., which computes fl(]C,- ujw^ w')i if U = (u\, ..., u^)T.

To compute At/, we use the fact that

where A*U is the vector whose entries are a/jrCC/ ujwj)i w'> * — 1, • • •, W, and where

Hence

We shall also use (4.17) and (4.19).For simplicity only, let us consider only the first term in (4.38), so aK becomes

and

But Vw' is constant on K and Sk = Y^l=i sk,vtf, so from (4.19) and (4.20),

The summation (4.39) should not be programmed directly like

Page 147: Achdou and Pironneau-Computational Methods Option Pricing

128 Chapter 4. The Finite Element Method

because the numerical complexity will then be of order N2NT, where NT is the number oftriangles in Th. One should notice that the sums commute, i.e.,

and then see that A,^ is zero when ql or qj is not in AT, so that effectively one has

This technique is called assembling. The complexity is O(Nt) now. It has broughtup the fact that vertices of triangle K have global numbers (their positions in the array thatstore them) and local numbers, their positions in the triangle K, i.e., 1,2, or 3. The notationinoc refers to the map from local to global.

Therefore, one should compute tfloci.loc', from (4.40) and (4.17), we have that

where n^loc is the fcth coordinate ofnliloe. It helps a little to note that Elnl is the edge qi+qi++

rotated counterclockwise by 90° in the triangle (ql, ql+, ql++) provided that the numberingis counterclockwise too:

We split the computation of U \-> (aM + A)£7 into two parts corresponding, respec-tively, to the bilinear forms

and

to enable an explicit treatment of the nonsymmetric part of A. Doing so, it is possible touse the well-known conjugate gradient algorithm [69, 81] to solve the systems of linearequations at each time step, because the matrix of the system is symmetric and positivedefinite. It is also possible to use a fully implicit method, but then one must choose otheriterative methods like BICGSTAB [113] or GMRES [107, 106].

Page 148: Achdou and Pironneau-Computational Methods Option Pricing

4.7. Programs for Two-Dimensional Cases 129

Thus the main part of the program will be as follows.

ALGORITHM 4.10. Two-dimensional Black-Scholes.

void aMul(Vec& au, Grid& g, Vec& u, double alpha, double sll, double s!2,double s22,double a)

{double kll,k!2,k22;for(int i=0; i<g.nv/i++)au[i] = 0; // init au

for(int k=0; k<g.nt;k++) // loop on triangles

{kll=0;k!2=0;k22=0;for (int iv=0;iv<3;iv++)

{int i = g (k, iv) ;kll+= sll*pow(g.v[i] . x , 2 ) ;k!2+= 2*sl2*g.v[ i ] .x*g.v[ i ] .y;k22+= s22*pow(g.v[ i ] .y ,2) ;for (int j v=0 ; jv<3 ; jv++)

{int j= g (k , jv) ;kll+= sll*g.v[i] .x*g.v[j] .x;k!2+= s!2*g.v[i] .x*g.v[j] .y;k!2+= s!2*g.v[i] .y*g.v[j] .x;k22+= s22*g.v[i] .y*g. v[j ] .y;

}}

for(int iloc = 0; iloc < 3; iloc++){

int i = g(k , i loc) ;int ip = g (k , ( i loc+l )%3) ;int ipp= g(k , ( i loc+2)%3) ;

for(int jloc = 0; jloc<3; jloc++){

int j = g (k , j loc ) ;int jp = g (k , ( j loc+ l )%3) ;int jpp= g(k , ( j loc+2) %3) ;double aijk = a* (k22* (g.v[jpp] .x - g .v [ jp ] . x )

*(g.v[ipp].x - g.v[ip] .x)+kll* (g.v[jpp] .y - g .v [ jp ] .y )

*(g.v[ipp] .y - g .v[ ip] .y)+k!2* ( (g .v f jpp ] .x - g .v [ jp ] . x )

*(g.v[ipp].y - g .v[ ip] .y)+ (g -v [ jpp] .y - g -v[ jp ] .y)

*(g.v[ipp].x - g .v [ ip ] . x ) ) ) / g . t [ k ] . a r ea /96 . ;if (!g.v[i].where)

au [i] += aijk * u [j ] ;}

if (!g.v[i] .where)au[i] += (u [i] *2 .+u| 'ip]+u [ipp] ) * g.t[k].area * alpha/ 12.;

}

}}

Page 149: Achdou and Pironneau-Computational Methods Option Pricing

130 Chapter 4. The Finite Element Method

void bMul(Vec& bu, Grid& g, Vec& u, double bl, double b2, double sll,double s!2, double s22)

{double rsl,rs2;double sll_, s!2_, s22_;rsl=bl/12;rs2=b2/12;sll_=-sll/24;sl2_=-s!2/24;s22_=-s22/24;

for(int i=0; i<g.nv; i++)bu[i] = 0;

for(int k=0; k<g.nt;k++){

doub1e Kgradu1=0;doub1e Kgradu2 = 0;for(int iloc = 0; iloc < 3; iloc++)

{int i = g (k , i loc ) ;int ip = g(k, (iloc+1)%3);int ipp= g ( k , ( i l o c + 2 ) % 3 ) ;

Kgradul+=u[i]*(g. v[ipp].y-g.v[ip].y) /2;Kgradu2-=u[i]*(g.v[ ipp] .x-g.v[ ip] .x) /2;

}

for(int iloc = 0; iloc < 3; iloc++){

int i = g(k , i loc) ;bu[i]+=rsl* Kgradul*g.v[i].x+rs2* Kgradu2*g.v[i].y;bu[i]+=sll_* Kgradul*g.v[i] .x+s!2_* Kgradul*g.v[i] .y;bu[i]+=s!2_* Kgradu2*g.v[i].x+s22_* Kgradu2*g.v[i].y;for (int j loc = 0; jloc<3; jloc-(-+)

{int j = g(k, jloc) ;bu[i]+=rsl* Kgradul*g.v[j].x+rs2* Kgradu2*g.v[j].y;bu[i]+=sll_* Kgradul*g.v[j].x+s!2_* Kgradul*g.v[j].y;bu[i]+=s!2_* Kgradu2*g.v[j].x+s22_* Kgradu2*g.v[j].y;

}}

}}

With a fixed time step, the number of conjugate gradient iterations scales like thenumber of nodes. To avoid such an unpleasant behavior, one has to use a preconditionedconjugate gradient method with a good preconditioner. Although it is beyond the scope ofthis book, we advocate the use of multigrid or algebraic multigrid preconditioners; see [96]and references therein. In Figures 4.11 and 4.12, we plot the price of a put 0.7 years tomaturity, with payoff functions given by (2.65) and (2.64).

The full program is given in the appendix (§4.10).

Page 150: Achdou and Pironneau-Computational Methods Option Pricing

4.7. Programs for Two-Dimensional Cases 131

Figure 4.11. The price of a put option on a basket of two assets 0.7 years tomaturity. The coefficients are r = 0.1, EH = 322 = 0.04, Ei2 = —0.012, P0 given by(2.65) with K = 100 computed with three different meshes with, respectively, 497, 1969,and 7733 nodes. The time step is 0.01 years.

Figure 4.12. The price of a put option on a basket of two assets 0.7 years tomaturity. The coefficients are r = 0.1, E11= S22 = 0.04, Ei2 = —0.012, P0 given by(2.64) with K = 100 computed with a mesh with 1969 nodes. The time step is 0.01 years.

Page 151: Achdou and Pironneau-Computational Methods Option Pricing

132 Chapter 4. The Finite Element Method

Figure 4.13. The price of a put option on a basket of two assets computed withdifferent boundary conditions: first the finite element method described in §4.7.1; secondthe same method but imposing Dirichlet conditions at 5, =0", i = 1,2, whose dataare obtained by solving one-dimensional Black-Scholes equations. The two surfaces areindistinguishable.

Project 4.1. For a basket option with two assets, compare several boundary conditions.For some of them, one can use a finite difference discretization. Use a Gauss-Seidel methodto solve the systems of linear equations. In Figure 4.13, we have plotted the price of a putoption obtained with two kinds of boundary conditions.

Project 4.2. Test the program given in the appendix below (§4.10), and run it (no specialboundary condition is imposed on the lines S\ = 0, £2 = Q). Modify the method by imposingthe traces on the lines Si = 0 and 82 = 0 (these trace functions are obtained by solvingone-dimensional parabolic problems). Does it give better results?

Project 43. In the program given in the appendix below, replace the conjugate gradientby a biconjugate gradient, BICGSTAB, or GMRES (the source codes for these methods arefreely distributed on many web sites), and treat the first order terms implicitly.

Project 4.4. Take a basket European put option, and make the change of variablesSi -> Si/(l + Si), i = 1, 2, which maps (M+)2 onto the unit square. Modify the pro-gram given in the appendix below in order to solve the new boundary value problem andcompare. A mesh adapted to the case (see Chapter 5) may be generated with freeFEM(http://www.freefem. org).

Page 152: Achdou and Pironneau-Computational Methods Option Pricing

4.7. Programs for Two-Dimensional Cases 133

4.7.2 A Stochastic Volatility Model

We consider the partial differential equation (2.87) obtained in §2.7. The partial differentialequation is rewritten in terms of r — T — t and in divergence form as

A semi-implicit in time finite difference discretization is applied:

Let Vh be the space of continuous piecewise linear functions on a triangulation of the squareft := (0, LJC) x (—Ly , Ly) which are equal to zero on the Dirichlet boundaries of theproblem. We consider the following finite element discretization:

For p — 0, the aim is to approximate P in the domain (0, 5) x (— 1.5, 1.5) for t smaller than1. We choose S = 800. For computing the solution, we discretize (2.87) in the larger domain(0, 800) x (—y , y) with y > 1.5. We use artificial homogeneous Dirichlet conditions onthe boundaries y = ±y. These conditions, which are obviously not satisfied by P, inducenevertheless small errors on P in the smaller domain (0, 800) x (—1.5, 1.5) because theadvection terms are strong near the top and bottom boundaries, and directed outward, sothe bad effects of the wrong artificial boundary conditions are limited to a boundary layernear y = ±y. We take y = 3. In Figure 4.14, we plot the price of the put option one yearto maturity performed with the parameters

with a time step of 6 days. There is a Neumann boundary condition on the boundary x = S.No boundary condition is needed on x = 0 because of the degeneracy of the equation.

Remark 4.6. The choice ofa=l is not quite realistic from a financial viewpoint if theasset is linked to stocks, because the mean reversion rate is generally larger. When the asset

Page 153: Achdou and Pironneau-Computational Methods Option Pricing

134 Chapter 4. The Finite Element Method

Figure 4.14. The price of a put option with stochastic volatility one year to matu-rity: two views.

corresponds to interest rates, smaller values of a are reasonable. When the mean reversionrate is large, it is possible to carry out an asymptotic expansion of the solution as in [51],and we believe that the variational setting introduced above permits us to fully justify theseexpansions.

We give below the new functions aMul and bMul used for the systems of linearequations.

ALGORITHM 4.11. Stochastic volatility.

void aMu!2 (Vec& au, Grid& g, Vec& u, double alpha, double sll,

double s!2, double s22,double a)

{double kll,kl2,k22;int k,i,ip,ipp,j,jp,jpp;for(i=0; i<g.nv;i++)

Page 154: Achdou and Pironneau-Computational Methods Option Pricing

4.7. Programs for Two-Dimensional Cases 135

au [ i] = 0;for(k=0; k<g.nt ;k++)

{double int_Kx2y2=0;double int_Kxabsy=0;for (int iloc=0;iloc<3;iloc++)

{i= g ( k , i l o c ) ;for (int jloc=0;jloc<3;jloc++)

{j = g(k, jloc) ;for (int lloc=0;lloc<3;lloc++)

{int 1 = g(k, l loc) ;for (int mloc=0 ;mloc<3;mloc++)

{int m = g (k ,mloc ) ;int c[3] ;c [ 0 ] = 0 ;c [ l ] = 0 ;c [2 ]=0 ;

c [iloc] ++;c [ j loc] ++; c [Hoc] ++;c [mloc] ++;

int nl=l;int n2=l;int n3=l;int n4=l;for(int p = l ; p < = c [ 0 ] ; p + + )

nl*=p;for(int p=l;p< = c [1] ;p++)

n2*=p;for(int p= l ;p<=c[2 ] ;p++)

n3 * =p;for (int p=l,-p<=c [0] +c [1] +c [2] +2;p++)

n4*=p;int_Kx2y2+=double(2*nl*n2*n3)/n4*g.v[i].x*g.v[j]

.x*g.v[ l ] .y*g.v[m].y;

}}

}}

// int_Kx2y2*=2;

for (int iloc=0;iloc<3;iloc++)

{i= g(k,iloc);int_Kxabsy+=2*g.v[i].x*abs(g.v[i].y)/12;for (int jloc=iloc+l;jloc<3;jloc++)

{j = g(k, jloc) ,-int_Kxabsy+= (g.v[i] .x*abs (g .v [ j ] .y) +g. v [ j ] .x*abs ( g . v [ i ] . y ) ) / 1 2 j

}}

kll=sll*int_Kx2y2;kl2=s!2*int_Kxabsy;k22=s22;for(int iloc = 0; iloc < 3; iloc++)

{i = g(k , i loc) ;ip = g ( k , ( i l o c + l ) % 3 ) ;

Page 155: Achdou and Pironneau-Computational Methods Option Pricing

136 Chapter 4. The Finite Element Method

ipp= g(k, (iloc+2)%3) ;

for(int jloc = 0; jloc<3; jloc++)

{j = g(k,jloc);jp = g(k, (jloc+l)%3) ;jpp= g(k,(jloc+2)%3);double aijk = a * ( k 2 2 * ( g . v [ j p p ] . x - g . v [ j p ] . x )

*(g .v[ ipp] .x - g .v [ ip ] .x )+kll* (g.v[ jpp] .y - g .v [ jp ] .y)

*(g.v[ ipp] .y - g .v[ ip] .y )+k!2* ( (g .v t jpp] .x - g . v t j p ] .x)

*(g .v[ ipp] .y - g.v[ip] .y)+ (g.v[jpp] .y - g .v t jp] .y) * (g.vfipp] .x- g . v [ i p ] . x ) ) ) /g.t [k] .area/4.;

if ( !g.v[ i ] .where)auti] += aijk * u [ j ] ;

}if ( !g.v[ i] .where)

au[i] += (u [i] *2 .+u[ ip ]+u[ ipp ] )* g.t[k].area * alpha/ 12.;

}

}}

void bMu!2(Vec& bu, Gridfc g, Vec& u,double alpha, double rhobeta2, double alpham, double r)

{double rsl,rs2,rs3;rsl=r/12;rs2=-alpha/12;rs3=rhobeta2/12;for(int i=0; i<g.nv; i++)

bu[i] = 0;for(int k=0; k<g.nt ;k++)

{doub1e dxu= 0;double dyu=0;for(int iloc = 0; iloc < 3; iloc++)

{int i = g(k,iloc);int ip = g(k,(iloc+l)%3);int ipp= g(k, (iloc+2)%3);dxu-=u[i]*(g.v[ipp].y-g.v[ip].y)/2;dyu+=u[i]*(g.v[ipp].x-g.v[ip].x)/2;

}

for(int iloc = 0; iloc < 3; iloc++)

{int i = g(k,iloc);for (int jloc=0;jloc<3;jloc++)

{int j = g(k,jloc);for (int lloc=0;lloc<3;lloc++)

Page 156: Achdou and Pironneau-Computational Methods Option Pricing

4.7. Programs for Two-Dimensional Cases 137

{int 1 = g (k , IIc) ;for (int mloc=0 ,-mloc<3 ,-mloc++)

{int m = g ( k , m l o c ) ;

int c[3] ;c [ 0 ] = 0 ;

c [ l ] = 0 ;

C [ 2 ] = 0 ;

c [Hoc] ++;c [jloc] ++;c [Hoc] ++;c [mloc] ++;

int nl=l;int n2=l;int n3=l;int n4=l;

for(int p=l;p<=c [0] ,-p++)nl*=p;

for(int p=l;p<=c [1] ,-p++)

n2*=p ;

for(int p = l ; p < = c [ 2 ] ; p + + )

n3*=p;

for (int p=l;p<=c [0] +c [1] +c [2] +2, -p++)n4*=p;

if (!g.v [i] .where)bu[i]-=dxu*double(2*nl*n2*n3)/n4

*g.v[ j ] .x*g.v[l] .y*g.v[m] .y;

}}

}if ( !g.v[i] .where)

{double signy= (g.v[i].y>0)?1:-1;

bu[ i ]+=(rs l - signy*rs3 )* dxu*g.v[i].x+(rs2-signy*rs3)

* dyu*g.v[i].y+alpham*dyu/3;

for(int jloc = 0; jloc<3; j loc++)

{int j = g (k, j loc) ;signy= (g .v [ j ] . y>0)?1 : -1 ;if (!g.v[i] .where)

bu[i ]+=(rs l - signy*rs3 )* dxu*g.v[j] .x

+ (rs2-signy*rs3) * dyu*g. v [j ] .y;

}}

} // i} // triangles

}_

4.7.3 Matrix Storage: The Compressed Sparse Row Format

Since the matrices A, M do not depend on time and since the matrix-vector products haveto be performed many times, it is much more efficient to compute the matrices once and forall and store them. Of course, only the nonzero entries must be stored; a popular format forsparse matrices is called the compressed sparse row format (also called Morse format):

Page 157: Achdou and Pironneau-Computational Methods Option Pricing

138 Chapter 4. The Finite Element Method

• the nonzero entries of the matrix A are stored in a large vector

double * ent_a,

and the nonzero entries of a given row are contiguous in the vector;

• the addresses in the vector ent_a of the first nonzero entry of each row are storedin a vector

int * first_in_row_a,

whose size is the number of rows;

• the column indices corresponding to the nonzero entries are stored in a vector

int * col_a,

whose size matches that of ent_a.

The code for assembling the symmetric part of A and storing it in the compressed sparserow format uses the standard template library of C++, particularly the container map.

ALGORITHM 4.12. Compressed sparse row storage.

void build_a(Grid& g, double alpha, double sll,double s!2, double s22,double a, map<pair_int, double,std::less<pair_int> > & entries)

{double kll,kl2,k22;int k,i,ip,ipp,j,jp,jpp;if (a>0)

{for(k=0; k<g.nt;k++)

{double int_Kx2y2=0;double int_Kxabsy=0;for (int iloc=0;iloc<3;iloc++)

{i= g(k,iloc);for (int j loc=0;jloc<3;jloc++)

{j = g (k , jloc) ;for (int lloc=0;lloc<3;lloc++)

{int 1 = g(k, l loc) ;for (int mloc=0,-mloc<3 ,-mloc++)

{int m = g(k,mloc);int c[3] ;c [0 ]=0 ;C [ l ] = 0 ;c [2 ]=0 ;C [iloc] ++;c [jloc] ++; c [Hoc] ++;c [mloc] ++;

Page 158: Achdou and Pironneau-Computational Methods Option Pricing

4.7. Programs for Two-Dimensional Cases 139

int nl=l;int n2=l;int n3=l;int n4=l ;for(int p = l ; p < = c [ 0 ] ; p + + )

nl*=p;

for(int p = l ; p < = c [ 1 ] ; p + + )n2*=p;

for(int p=l;p< = C [2] ;p++)n3*=p;

for(int p=l;p< = c[0]+c[l ]+c [2 ]+2 ;p++)n4*=p;

int_Kx2y2+=double(2*nl*n2*n3)/n4*g.v[i] .x*g.v[j] .x*g.v[l] .y*g.v[m] .y;

}}

}}

for (int iloc=0;iloc<3;iloc++)

{i= g(k,iloc);int_Kxabsy+=2*g.v[i] .x*abs(g.v[i] .y)/12;for (int jloc=iloc+l;jloc<3;jloc++)

{j = g(k, jloc) ;int_Kxabsy+= (g. v[i] .x*abs (g. v[j ] .y) +g .v[ j ] .x

*abs(g.v[i] .y))/12;

}}

kll=sll*int_Kx2y2;kl2=s!2*int_Kxabsy;k22=s22;for(int iloc = 0; iloc < 3; iloc++)

{i = g(k,iloc);ip = g(k,(iloc+l)%3);ipp= g(k,(iloc+2)%3);for(int jloc = 0; jloc<3; jloc++)

{j = g(k, jloc) ;jp = g(k, (jloc+l)%3) ;jpp= g(k,(jloc+2)%3);double aijk = a* (k22* (g.v[jpp] .x - g.v[jp].x)

*(g.v[ ipp] .x - g.v[ip] .x)+kll* (g.v[jpp] .y - g.v[jp] .y)

*(g.v[ ipp] .y - g.v[ip] .y)+k!2* ( (g.v[jpp] .x - g .v[ jp] .x)

*(g.v[ipp].y - g.v[ip] .y)+ (g-v[jpp] .y - g . v t j p ] - y ) * (g.vfipp] .x- g.v[ip] .x) ) ) /g. t[k] .area/4. ;

pair_int auxp;auxp[0] =i;auxp[l]=j ;pair <map<pair_int,double, less<pair_int > >::iterator,

bool> pit;pair< pair_int,double> val;val.first=auxp;val.second=aijk;

Page 159: Achdou and Pironneau-Computational Methods Option Pricing

140 Chapter 4. The Finite Element Method

pit=entries.insert(val);if (pit.second==false)

(*(pit.first)).second += aijk;}

}

}}

if(alpha>0)for(k=0; k<g.nt;k++)for(int iloc = 0; iloc < 3; iloc++){i = g(k,iloc);pair_int auxp;auxp[0]= i;auxp[1]= i;pair <map<pair_int,double, less<pair_int > >::iterator,

bool> pit;pair< pair_int,double> val;val.first=auxp;val.second=g.t[k].area * alpha/ 6.;pit=entries. insert (val) ,•if (pit.second==false)

(*(pit.first)).second += val.second;for (int jloc=l;jloc<3;jloc++){ip = g(k,(iloc+jloc)%3);auxp[0]= i ;auxp [1]=ip;val.first=auxp;val.second=g.t[k].area * alpha/ 12.,•pit=entries.insert(val);if (pit.second==false)

(* (pit.first)).second += val.second;}

}}

int main(){

Grid g("mesh6_VS.msh") ; // triangulated squaremap<pair_int, double, std: : less<pair_int> > entries,-for(int i=0; i<g.nv; i++) // a hack to put axis at Neumann conditions

i f (g .v [ i ] .where == 2| |g.v[i] .where==4 )g.vfi].where = 0;

double * ent_stiff_sym;int * col_stiff_sym;int * first_in_row_stiff_sym;int size_stiff_sym,-int k,j ;map<pair_int,double, less<pair_int > >::iterator it;build_a(g, r+1./dt,sll,s!2,s22,1..entries);ent_stif f_sym=new double [entries .size () ] ;

Page 160: Achdou and Pironneau-Computational Methods Option Pricing

4.8. Programming in Dimension d > 2 141

col_stiff_sym=new int [entr ies .s ize() ] ;first_in_row_stiff_sym=new int[g.nv];

k=-l ;j = -l;for( i t=entr ies .begin() ; i t !=entr ies .end() ; i t++)

{j++;ent_st iff_sym[j]= (*it).second;col_stiff_sym[j]= (*it) .first [1] ;if ( ( * i t ) . f i r s t [ 0 ] ! = k )

{k++;

first_in_row_stiff_sym[k] =j;

}}

size_stiff_sym=entries.size();entries.clear 0 ;

]

Assembling the mass matrix and the nonsymmetric part of A are done similarly. Thematrix-vector product is as follows.

ALGORITHM 4.13. Matrix-vector product.

void Mul(Vec& bu, Grid& g, Vec& u, double * ent, int * col,int * first_in_raw, int & size_of_ent)

{int i ;for( i=0; i<g.nv;i++)

bu[i] = 0;for( i=0;i<g.nv-l ; i++)

if ( !g.v[i] .where)for(int j=first_in_raw[i];j<first_in_raw[i+1];j++)

bu[ i ]+= ent [ j ]*u[col[ j ] ] ;if (!g.v [i] .where)

for(int j=first_in_raw[i];j<size_of_ent;j++)bu[ i ]+= ent [j] *u[col [j] ];

}

4.8 Programming in Dimension d > 2

There are more and more financial products built on several assets, so the numerical solutionof the Black-Scholes equation in higher dimension is a current area of research.

In three dimensions the finite element method is used intensely in engineering, sosome of the engineering software can be used. For example, Figure 4.15 shows the solutionobtained with f f 3d [40] by the finite element method with quadrangles of the Black-Scholes equation for a European put with r = 0, al• = 0.1 * i, cr,; — —0.1, i, j = 1, 2, 3,and payoff

Page 161: Achdou and Pironneau-Computational Methods Option Pricing

142 Chapter 4. The Finite Element Method

The computational domain is the intersection of the cube (0, 1 )3 with the unit sphere centeredatO.

4.9 High Dimensions: An Introduction to GalerkinMethods with Sparse Tensor Product Spaces

For parabolic problems in space dimensions d > 3, the finite element and finite differencemethods fail, because they require typically O(h~d) degrees of freedom for an accuracyof O(h} in the energy norm. For this reason, a popular cliche says that only Monte-Carlomethods can be applied for high-dimensional problems. Yet quite recent developments haveshown that it is possible in some cases to use deterministic Galerkin methods or grid-basedmethods for parabolic problems in dimensions d for 4 < d < 20: these methods are basedeither on sparse grids [ 118,65,63] or sparse tensor product approximation spaces [64,114].For a recent survey on sparse grids, a good reference is [23]. Here we give a brief surveyof a paper by Petersdoff and Schwab [114]. The full results contained there are of greatinterest but rather technical and beyond the scope of the present book.

For convenience, we restrict ourselves to sparse tensor product finite element spacesconstructed with one-dimensional piecewise affine functions. The construction of the ap-proximation space involves wavelets: for simplicity, we focus on a very simple example ofwavelets.

4.9.1 Wavelets in M

In the interval / = [0, 1], we define the mesh Te whose nodes are xj = j2~e~l, j —0,. . . , 2i+1. We define V1 as the space of piecewise linear continuous functions on themesh Tl vanishing at 0 and 1. The dimension of V£ is N*- = 2£+1 — 1. We defineML = Nl - N*'1 = 2£. For t > 0, we define the wavelets VJ, j = 1, • • •, Ml, at level £,by

where the normalization constant is chosen in order to achieve || ̂ rj || £2 = I for l < j < M .

The support of ^frj has diameter less than 22~i.The first three levels are displayed on Figure 4.16. For t > 0, we define Wl =

spantyj, 1 < j < M1} and W° = V°: we have V1 = Wl 0 Vl~\ and V1 = 0f=0 Wk.

Each function v of VL has the representation v = Y^k=o SyLi u; tf > an<^ ̂ *s easv to cneckthat most of the wavelets belonging to levels k and I with \k — t\ > 1 are orthogonal forthe L2 and H1 scalar products.

Page 162: Achdou and Pironneau-Computational Methods Option Pricing

4.9. Introduction to Sparse Approximations for High Dimensions 143

Figure 4.15. A put option built on three underlying assets. On the top the payoffand the computational domain projected on a cube. On the bottom the solution on thesphere fl(0, 0.5).

The following properties can also be checked:

with c and C independent of t.

Page 163: Achdou and Pironneau-Computational Methods Option Pricing

144 Chapter 4. The Finite Element Method

Figure 4.16. The wavelet basis: the first three levels.

Figure 4.17. A representation of the full tensor product space for d = 2 (for t = 0. 1. 2).

4.9.2 Sparse Tensor Product Spaces

For a parabolic equation in Q = (0, 1)J, a natural choice for a discrete space is the tensorproduct space Vh = V* 0 • • • ® Vfc = Y^o<k,<t wkl ® ''' ® ^''- Tne dimension of V/, is(2t+1 + 1)J, so it grows very rapidly with d. We shall use instead the sparse tensor productspace Vh — Ylki+--+k,<t Wkt <8> • • • <8> Wki<, whose dimension is O(td2t). The space V/, is

considerably smaller than Vh and can be used for practical computations for d < 20.A schematic representation of the spaces V/? and V/, are displayed in Figures 4.17

and 4.18.Consider the discretization of an elliptic Dirichlet problem in Q: the discretization

error of the Galerkin method with the space Vh (resp., V/,) is of the same order as thebest fit error when approximating the solution of the continuous problem by a functionof Vh (resp., Vh). We know that inf ( 1 / e^ ||u — u/, | | / / i (n) < Ch v\H2(n), where h = 2~ f ,

and M#:(n) = ZLti+-+*,=? II kf'v. klt I l i j / n ) - Since V/, is much smaller than Vh a similar<ir, .-.'iv(/

estimate is not true. However, the following estimate has been proved (see [64, 114]):

Page 164: Achdou and Pironneau-Computational Methods Option Pricing

4.9. Introduction to Sparse Approximations for High Dimensions 145

Figure 4.18. A representation of the sparse tensor product space for d = 2 (fort = 0, 1, 2).

where

is endowed with its natural norm and seminorm. We see that the Galerkin method with thespace Vh converges linearly in h provided the solution to the continuous problem belongsto K2(fi) (which is a much smaller space than #2(£2)).

When dealing with a homogeneous parabolic problem such as (2.61) with smooth co-efficients, Petersdoff and Schwab [114] made use of the smoothing property of the parabolicoperator and designed a method based on sparse tensor product spaces as above, even ifthe Cauchy data are not smooth: indeed, for any Cauchy data, the solution to the problembelongs to "H2(£2) for all positive time, so the sparse tensor product space will be largeenough to approximate the solution at t > 0 in an optimal way. Yet, when the Cauchy dataare not smooth enough, the %2-norm of the solution blows up as t -» 0. This is the case foroptions with nonsmooth payoff functions. To compensate for this, Petersdoff and Schwab[114] proposed using a time stepping with a very nonuniform time grid suitably refined

Page 165: Achdou and Pironneau-Computational Methods Option Pricing

146 Chapter 4. The Finite Element Method

near t — 0. This yields a sophisticated method which enables one to price basket optionswith up to twenty assets. Similar ideas have been used for pricing options under stochasticvolatility in [71].

4.10 Appendix: The Full Program for Two-DimensionalBlack-Scholes

ALGORITHM 4.14. Two-dimensional Black-Scholes.

// file : BS2DfemCG.cpp^include <iostream>^include <fstream>^include <math.h>^include <cmath>^include <stdlib.h>^include <assert.h>^include "RNM.hpp"tfdefine NDEBUG // uncomment when debugging is overusing namespace std;

typedef KN<double> Vec;

class Vertex

{public:double x, y; // coordinatesint where; // on which boundary

};

class Triangle

{public:Vertex* v[3]; // the 3 vertices of the triangleint where; // in which regiondouble area;

};

class Grid{ public:int nt, nv; // nb of triangles, vertices, and edgesKN<Vertex> v; // all verticesKN<Triangle> t; // all trianglesGrid(const char *path ); // reads a triangulation in freeFEM formatint no(Triangle* tt) const { return tt-( Triangle*)t;} // the place in

// array t of triangle ttint no(Vertex* tt) const { return tt-( Vertex*)v;} // the place in

// array v of Vertex tt 32int operatorO (int k,int iloc) const { return no (t [k] . v[iloc] ) ; }

// same as no(vertex)

};

Grid::Grid(const char *path ):v(),t(){ // reads a triangulation in freeFEM formatint iO,il,i2;

Page 166: Achdou and Pironneau-Computational Methods Option Pricing

4.10. Appendix: The Full Program for Two-Dimensional Black-Scholes 147

ifstream file(path);if (Ifile) cout«"can t find triangulation file"«endl;file » nv » nt;v.init(nv);t.init(nt);for(int i=0; i<nv/ i++ )

file » v [ i ] .x » v [ i ] . y » v[i] .where;for(int i=0; i<nt; i++ )

{file » iO » il » i2 » t[i].where;t [i] .v[0] = &v[iO-l ] ;t [i] .v[l] = &v[il-l] ;t [i] .v[2] = &v[i2-l] ;t[ i] .area = ( (t [i] . v [1]->x - t [i] . v [0 ] ->x) * (t [i] . v [2] ->y

- t[i] .v[0] ->y) -( t [ i ] . v [2 ] ->x - t[i] . v [ 0 ] - > x ) * ( t [ i ] .v[ l ] ->y- t[i] . v [ 0 ] - > y ) ) / 2 ;

}}

void bMul(Vec& bu, Grid& g, Vec& u, double alpha, double bl, double b2,double sll, double s!2, double s22)

{double rsl,rs2;double sll_,s!2_,s22_;rsl=bl/12;rs2=b2/12;sll_=-sll/24;Sl2_=-sl2/24;s22_=-s22/24;

for(int i=0; i<g.nv; i++)bu[i] = 0;

for(int k=0; k<g.nt ;k++)

{double Kgradul=0;double Kgradu2=0;for(int iloc = 0; iloc < 3; iloc++)

{int i = g(k,iloc);int ip = g(k,(iloc+l)%3);int ipp= g(k,(iloc+2)%3);

Kgradul+=u[i]*(g.v[ ipp] .y-g.v[ ip] .y) /2;Kgradu2-=u[i]*(g.v[ipp] .x-g.v [ ip] .x) /2;

}

for(int iloc = 0; iloc < 3; iloc++)

{int i = g(k,iloc);bu[i]+=rsl* Kgradul*g.v[i].x+rs2* Kgradu2*g.v[i].y;bu[i]+=sll_* Kgradul*g.v[i].x+s!2_* Kgradul*g.v[i].y;bu[i]+=s!2_* Kgradu2*g.v[i].x+s22_* Kgradu2*g.v[i].y;for(int jloc = 0; jloc<3; jloc++)

{int j = g (k, j loc) ,•bu[i]+=rsl* Kgradul*g.v[j].x+rs2* Kgradu2*g.v[j].y;

Page 167: Achdou and Pironneau-Computational Methods Option Pricing

148 Chapter 4. The Finite Element Method

bu[i]+=sll_* Kgradul*g.v[j] .x+s!2_* Kgradul*g.v[j] .y;bu[i]+=s!2_* Kgradu2*g.v[j] .x+s22_* Kgradu2*g.v[j] .y;

}}

}}

void aMul(Vec& au, Grid& g, Vec& u, double alpha, double sll, double s!2,double s22,double a)

{double kll,k!2,k22;for(int i=0; i<g.nv;i++)

au[i] =0; // init aufor(int k=0; k<g.n t ;k++) // loop on triangles

{kll=0;k!2=0;k22=0;for (int iv=0;iv<3;iv++)

{int i = g(k , iv) ;kll+= sll*pow(g.v[i] .x ,2 ) ;k!2+= 2*sl2*g.v[i] .x*g.v[i] .y;k22+= s22*pow(g .v [ i ] .y ,2 ) ;for (int j v = 0 ; j v < 3 ; j v + + )

{int j= g ( k , j v ) ;kll+= sll*g.v[i] .x*g.v[j] .x;k!2+= s!2*g.v[i] .x*g.v [j ] .y;k!2+= s!2*g.v[i] .y*g. v [ j ] . x ;k22+= s22*g.v[i] .y*g.v[j] .y;

}}

for(int iloc = 0; iloc < 3; iloc++)

{int i = g(k, i loc) ;int ip = g ( k , ( i l o c + l ) % 3 ) ;int ipp = g(k , ( i loc+2)%3) ;

for(int jloc = 0; jloc<3; jloc++){

int j = g(k,j loc);int jp = g (k , (jloc + l ) % 3 ) ;int jpp = g(k , (j loc+2) %3) ;double aijk = a* (k22* (g.v[jpp] .x - g .v [ jp ] .x )

*(g.v[ipp].x - g.v[ip] .x)+kll* (g.v[jpp] .y - g -v[ jp ] .y)

*(g.v[ipp].y - g . v f i p ] . y )+k!2* ( (g.v[jpp] .x - g . v f j p ] .x)

*(g.v[ipp].y - g .vf ip] .y)+ (g-v[ jpp] .y - g.v[jp] .y)

*(g.v[ipp] .x - g . v [ i p ] . x ) ) ) /g. t [k] .area/96.;if (!g.v[i].where)

au[i] += aijk * u [ j ] ;}

if (!g.v[i] .where)au[i] += (u[i] *2.+u [ip]+u [ipp] ) * g.t[k].area * alpha/ 12.;

Page 168: Achdou and Pironneau-Computational Methods Option Pricing

4.10. Appendix: The Full Program for Two-Dimensional Black-Scholes 149

}

}}

void solvecg(Grid& g, Vec& f, Vec& u, int niter, double precise,double alpha, double sll,double s!2,double s22)

{int nv = g.nv;Vec au(nv), ag(nv), grad(nv), hh(nv), diag(nv);double normOldGrad = Ie60;

for(int m=0; m<nlter ; m++)

{aMul(au, g, u, alpha,sll,sl2,s22,1) ;

double normGrad = 0;for(int i=0;i<nv; i++)

if (!g.v[i] .where)

{gradfi] = (au[i] - f [i] ) ;normGrad += pow(grad[i] , 2) ;

}

double gh =0, gamma = normGrad / normOldGrad;normOldGrad = normGrad;for(int i=0;i<nv; i++)

i f ( !g .v [ i ] .where ){hh[i] = gamma * hh[i] - grad[i];gh += grad[i] * hh[i] ;

}

aMul(ag,g,hh,alpha,sll ,s!2,s22,1);double rho = 0;for(int i=0;i<nv; i++)

if (!g.v[i] .where) rho += hh[i] * ag[i];rho = - gh / rho ;

for(int i=0;i<nv; i++)if (!g.v [i] .where) u[i] += rho * hh[i];

if(m==0) precise = normGrad * pow(precise,2);if(normGrad < precise){ cout « " nb iter=" «m«"

normGrad = " «normGrad« endl;return;

}}

}

void myexitO { cout«"program ended at myexit () "«endl; }

int main()

{atexit(myexit); // for debuggingGrid g("mesh2.msh"); // triangulated square

Page 169: Achdou and Pironneau-Computational Methods Option Pricing

150 Chapter 4. The Finite Element Method

for(int i = 0; i<g .nv; i++) // a hack to have Neumann conditionsif(g.v[i].where != 0) g.vfi].where = 0;

const double T =0.7, // financial datar=0.05,Kl=100,K2=100,sl=0.2,s2=0.2,sll=sl*sl,S22=s2*s2,s!2=-sl*s2*0.3;

const int itermax=70;double dt = T/itermax;double t=0;Vec uO(g.nv), ul(g.nv);Vec f(g.nv),x(g.nv),f1(g.nv),f2(g.nv) ;

for(int i=0; i<g.nv/i++){ //set payoff at maturitydouble a = (g.v[i].x > g.v[i].y )? Kl-g.v[i].x : K2-g.v[i].y ;uO[i] = a>0 ? a : 0;ul[i]=0;

}for(int timelter=0; timelter < itermax; timelter++) // time loop

{t+=dt;aMul(f2,g,uO,1./dt,0.,0.,0.,0) ; // the mass matrixbMul(fl,g,uO,0,r,r,sll,s!2,s22) ; // the nonsymmetrie part of the

// stiffness matrixfor(int i=0;i<g.nv;i++)f[i]=fl[i]+f2 [i]; // add the two contributions

cout«"timeiter = "«timelter+l«" temps = "«t«'\t';solvecg(g,f, ul,200, le-5, r+1./dt,sll,s!2,s22); // solve linear

// system by eg

for(int i=0; i<g.nv;i++) // updateuO[i] =ul[i] ;

}of stream plot ("plot2") ,-for (int it=0,-it<g.nt; i t++)

plot «g. v [g (it, 0) ] .x «" "«g. v[g (it, 0) ] .y « " " « u O [ g ( i t , 0 ) ] « endl«g. v [g (it, 1) ] .x «" "«g. v [g (it, 1) ] .y « " " «uO[g( i t , l ) ] « endl«g. v[g (it, 2) ] .x «" "«g. v [g (it, 2) ] .y « " " « u O [ g ( i t , 2 ) ] « endl«g. v[g (it, 0) ] .x «" "«g.v [g (it, 0) ] .y « " " « u O [ g ( i t , 0 ) ] « endl«endl«endl ;

return 0;]

Page 170: Achdou and Pironneau-Computational Methods Option Pricing

Chapter 5

Adaptive Mesh Refinement

This chapter is devoted to automatic mesh refinements with criteria based on a posterioriestimates of the finite element discretization errors of the Black-Scholes equation.

The main idea consists of finding local error indicators which can be computed ex-plicitly from the solution of the discrete problem, and such that their Hilbertian sum isequivalent to the global error. These indicators are said to be optimal if the constants of thenorm-equivalence inequalities are independent of the error. Moreover, since they are local,they provide a good representation of the error distribution.

The result (Theorem 5.6) leads to a numerical method which puts the discretizationnodes where they are needed; for a given accuracy, the method is fast because it has fewerunknowns than with a uniform mesh. For example, this may be important for calibrationproblems where the Black-Scholes equation is solved a large number of times.

This chapter uses many of the technicalities of the finite element method and may bedifficult for nonspecialists.

We have chosen to follow the same strategy as in the enlightening paper by Bernardi,Bergam, and Mghazli [14]. Therefore we need a finite element method with a mesh in thevariable S that can vary in time, and this chapter provides such a tool. We consider twofamilies of error indicators, both of residual type. The first family is global with respectto the price variable and local with respect to time: it gives relevant information in orderto refine the mesh in time. The second family is local with respect to both price and timevariables, and provides an efficient tool for mesh adaption in the price variable at each timestep.

Other approaches for mesh adaption for parabolic problems and finite element methodsare available in, e.g., [45,46, 47].

This chapter is rather technical but essentially self-contained; to this end, there aresome repetitions concerning Sobolev spaces and variational methods and other crucial no-tions for constructing the error indicators. The technical proofs are all given separately inthe appendix at the end of this chapter. They can of course be skipped.

151

Page 171: Achdou and Pironneau-Computational Methods Option Pricing

152 Chapters. Adaptive Mesh Refinement

5.1 The Black-Scholes Equation and Some Discretizations

5.1.1 The Black-Scholes Equation and Its Variational Formulation

We consider the Black-Scholes equation for a European put with a local volatility a:

Here t is the time to maturity and S is the price of the underlying asset. The volatility a isa function of 5 and / and the interest rate r is a function of t. For a vanilla put, the payofffunction is

where K is the strike. What follows can be generalized to any payoff function vanishingfor S large enough.

To simplify the discussion, we assume that the volatility a (5, t) and the interest rater (t) are smooth functions. We need to make the following assumptions: there exist constants0 < crmin < 0max> 0 < CCT, and R > 0 such that

For the purpose of discretization, we truncate the domain in the variable 5: we introduce alarge constant S, and instead of (5.1), we consider

where Q = (0, 5).In what follows, we use the space L2(£2) of square integrable functions on Q. We

denote by (-, •) the inner product in L2(ft) and by || • || the associated norm. We introducethe weighted Sobolev space V:

Endowed with the inner product and norm

V is a Hilbert space. This space has the following properties:

Page 172: Achdou and Pironneau-Computational Methods Option Pricing

5.1. The Black-Scholes Equation and Some Discretizations 153

1. V is separable.

2. Denoting by D(R+) the space of infinitely differentiable functions with compactsupport in R+, and by T>(&) the space containing the restrictions of the functions of£>(M+) to £2, Z>(S2) is densely embedded in V.

3. V is densely embedded in L2(fi).

4. The seminorm

is in fact a norm in V, equivalent to || • \\v; more precisely, we have the followingHardy inequality: for all v e V,

Denoting by D (Q) the space of infinitely differentiable functions with compact supportin £1, we define V0

as the closure of D(£2) in V. It is easy to prove that V0 is the subspaceof V containing the functions vanishing at 5. For simplicity, we also denote by (•, •) theduality pairing between V0, the dual space of VQ, and VQ, and we define || • || v> by

We define C°([Q, T}\ L2(fi)) as the space of continuous functions with values inL2(£2), and L2(0, T; VQ) as the space of square integrable functions with values in VQ.

We call a, (u, w) the bilinear form:

It is clear from the assumptions above on r and a that for all t e [0, T], at is acontinuous bilinear form on V x V. Let IJL be the best positive constant such that, for allV, W € Vn,

The boundary value problem (5.6) has the following equivalent variational formulation (see[90]):

Find u e C°([0, T}\ L2(ft)) n L2(0, T\ VQ) satisfying

From the assumptions above on r and a, we have the following Garding inequality.

Lemma 5.1 (Garding's inequality). There exists a nonnegative constant A. such that

Page 173: Achdou and Pironneau-Computational Methods Option Pricing

154 Chapters. Adaptive Mesh Refinement

Proof. Take, for example,

Using Lemma 5.1 and abstract results due to Lions and Magenes [90], it is possible to provethat the problem (5.14), (5.15) admits a unique solution. Moreover, introducing the norm

we have, by taking v equal to u(t)e 2X/ in (5.15) and integrating in time,

From this, we deduce that

5.1.2 The Time Semidiscrete Problem

We introduce a partition of the interval [0, T] into subintervals [fn_i, t n ] , I <n < N, suchthat 0 = to < ti < • • • < IN = T. We denote by Atn the length tn — tn-\, and by Ar themaximum of the Atn, 1 < n < N. We also define the regularity parameter /OA,:

For a continuous function / on [0, T], we introduce the notation /" = f(tn). The semidis-crete problem arising from an implicit Euler scheme is the following:

Find (un)0<n<N e L2(Q) x Vf satisfying

For A? smaller than 1/(2A.), the existence and uniqueness of (u")o<n<N is a consequence ofthe Lax-Milgram lemma. We call u A/ the function which is affine on each interval [/„ _ i, rn ],and such that u^t(tn) = un.

From the standard identity (a — b,a) = ^ \a |2 + ^ \a — b\2 — \ \b\2, a few calculationsshow that

Multiplying equation (5.23) by Yl"=i(l — 2XAr,) and summing the equations on n, weobtain

Page 174: Achdou and Pironneau-Computational Methods Option Pricing

5.1. The Black-Scholes Equation and Some Discretizations 155

Introducing the discrete norm for the sequence (vm}\<m<n,

we have the discrete analogue of (5.18):

In what follows, we will need an equivalence relation between [[(wm)]]n and [[MA?]](^)-

Lemma 5.2. There exists a positive real number a < | such that the following equivalence

property holds for At < | and for any family (UW)O<«<AT in v£+1:

From (5.26) and (5.27), we deduce that for all «, 1 < n < N,

where

5.1.3 The Fully Discrete Problem

We now describe the full discretization of (5.6). Foreachn,0 < n < N, let (7^/i) be a familyof grids of £2. As usual, /z(w) denotes the maximal size of the intervals in Tnh- For a givenelement a> e Tnh, let hw be the diameter of a> and let Smm((o), Smax(<*>) be the endpoints ofu>. We assume that there exists a constant ph such that, for two adjacent elements a> and co'of (Tnh),

For each h, we define the discrete spaces by

The grids Tnh for different values of n are not independent: indeed, each triangulation Tnhis derived from Tn-\,h by cutting some elements of Tn-\^ into smaller intervals or, on thecontrary, by gluing together elements of Tn-\,h- This enables us to use simple Lagrangeinterpolation operators to map a discrete function of Vn-\,h to a function of Vnh and tocompute exactly (u^"1, v%) if wjj"1 e Vn-i,/, and u£ € Vnn.

Page 175: Achdou and Pironneau-Computational Methods Option Pricing

156 Chapters. Adaptive Mesh Refinement

Assuming that w0 € VQh, the fully discrete problem reads as follows:Find (un

h)0<n<N, unh e V°h, satisfying

As above, for At smaller than 1/(2A), the existence and uniqueness of (M^)o<n<w is aconsequence of the Lax-Milgram lemma, and we have the stability estimate

We call u h A/ the function which is affine on each interval [/„ _ i, tn ], and such that u /, A, (tn) =u"h.

5.2 Error Indicators for the Black-Scholes Equation

5.2.1 An Upper Bound for the Error

We now intend to bound the error [[u — M/,,A/]](^)» 1 < « < W, as a function of errorindicators which can be computed from Uh, A/ • We are going to use the triangular inequality

and we begin by evaluating [[u — WA,]](/„).With this aim, we make a further assumption on the coefficients: we assume that

a, S|| are Lipschitz continuous with respect to t uniformly with respect to S and thatr is Lipschitz continuous on [0, T]. Thanks to the previous set of assumptions on thecoefficients, we can introduce three constants LI, LI, and Lj, such that, for all t and t' in[0, 7*],

Proposition 53. Assume that the function UQ belongs to V\h- Then there exists a constanta < j such that if At < |, the following a posteriori error estimate holds between thesolutions of problems (5.15) and (5.22):

where

Page 176: Achdou and Pironneau-Computational Methods Option Pricing

5.2. Error Indicators for the Black-Scholes Equation 1 57

and c is a positive constant, L = 4Li + 2L2 + LS, where L\, LI, L^ are given by (5.35),and C(UQ) is given by (5.29).

Corollary 5.4. If the assumptions of Proposition 5.3 are satisfied, there exists a positiveconstanta < | such that if At < j, the following a posteriori error estimate holds betweenthe solutions of problems (5.15) and (5.22):

Proposition 5.5. Assume that UQ e V\h. Then the following a posteriori error estimateholds between the solution (w")o<w<Ar of problem (5.21), (5.22) and the solution («£)o<n<Arof problem (5.32), (5.33).' there exists a constant c such that, for all tn> 1 < n < N,

where

Remark 5.1. One could also take for r]m<a) the larger indicator

where £/, i = 1, 2, are the two endpoints ofco and where -£*- (£) is the jump of-^j- at £,.

This larger indicator is not necessary for parabolic problems in two dimensions (includingtime), but in more than two dimensions, (5.40) does not yield an upper bound for the error,and (5.41) is compulsory. This will be explained in Remark 5.2 in the appendix below.

Combining the results of Propositions 5.3 and 5.5 leads to the following full a posteriorierror estimate.

Theorem 5.6. Assume that UQ e V\h and that AAf < a as in Lemma 5.2. Then thefollowing a posteriori error estimate holds between the solution u of problem (5.14), (5.15)

Page 177: Achdou and Pironneau-Computational Methods Option Pricing

158 Chapters. Adaptive Mesh Refinement

and the solution uh,A of problem (5.32), (5.33): there exists a constant c such that, for alltn,\<n<N,

where L = 4L\ + ILj. + £3, LI, £2, ^3 are given by (5.35), C(UQ) is given by (5.29), nn

is given by (5.37), and r\m^ is given by (5.40), and

5.2.2 An Upper Bound for the Error Indicators

The program is now to prove separate bounds for each indicator rjn and rjn^. We begin withrjn. For that, we introduce the notation [[vn]] for (i>") !<„<#, vn e VQ:

Proposition 5.7. Assume that u° belongs to VQ, and that A.A/ < a as in Lemma 5.2. Thefollowing estimate holds for the indicator nn, 2 < n < N:

and

where c is a positive constant.

Page 178: Achdou and Pironneau-Computational Methods Option Pricing

5.4. A Taste of the Software 159

The most important property of estimate (5.44) is that, up to the last term, whichdepends on the data, all the terms on the right-hand side of (5.44) are local in time. Moreprecisely, they involve the solution in the interval [tn-i,tn].

We need to define some more notation before stating the upper bound result forr]n^. For co e Tn,h, let K^ be the union of co and the element that shares a node withco, and let V0(KJ be the closure of 2?(£J in V(£J = {v e L2(KW); Sff e L2(KJ}

endowed with the norm || u || v(£j = (fK u2(S)+,S2(ff (S))2)?. Wealsodefine |Mlv0(Kj =

(fKo S2(ff (S))2)5 for v € VQ(KW}. We denote by V^K^ the dual space of Vo(KM)endowed with dual norm.

Proposition 5.8. The following estimate holds for the indicator r]n>a) defined in (5.40) forall co € Tn,h, 1 < n < N:

5.3 Conclusion

In §5.2.1 we have bounded the norm of the error produced by the finite element method bya Hilbert sum involving the error indicators nm and nm<a), which are, respectively, local int and local in t and S. Conversely, in §5.2.2, we have seen that the error indicators can bebounded by local norms of the error. This shows that the error indicators are both reliableand efficient, or in other words that the error produced by the method is well approachedby these indicators. Furthermore, since the indicators are local, they tell us where the meshshould be refined.

It is now possible to build a computer program which adapts the mesh so as to reducethe error to a given number e. From the result of an initial computation M/,iA, we can adaptseparately the meshes in the variables t and S so that the Hilbert sum in (5.42) decreases.The process is repeated until the desired accuracy is obtained.

5.4 A Taste of the SoftwareThe software for the finite element method with adaptive mesh refinement based on theerror indicators presented above is surely more complex and longer than the simple programpresented in §4.4. For that reason, we will not reproduce it entirely here. Instead, we focuson two points:

• the program for a backward Euler scheme with the mesh in the S variable varying intime;

• the computation of the indicators rjm.

An Euler scheme class is defined for the backward Euler scheme as follows.

Page 179: Achdou and Pironneau-Computational Methods Option Pricing

160 Chapters. Adaptive Mesh Refinement

ALGORITHM 5.1. Euler_scheme.

class Euler_Scheme

{private:vector<vector<double> >S_nodes,S_steps; // the meshes in S (one for

// each time step)vector<double> grid_t; // the mesh in tvector<int> change_grid; // at each time step, tells

// whether the S-mesh varies or notdouble rate (double); // the function for the

// interest ratedouble vol(double,double); // the local volatility functiondouble eps,- // a small parameter

protected:public:Euler_Scheme(const vector<vector<double> > &g_grid_S,

const vector<vector<double> > &g_S_steps,vector<double> & g_grid_t, vector<int> & g_change_grid)

:S_nodes(g_grid_S),S_steps(g_S_steps), grid_t(g_grid_t),change_grid(g_change_grid){eps=le-9;}; // the constructor

void Time_Step(int i, vector<KN<double> > &P) ; // a time stepvoid build_rhs(KN<double> &u, const KN<double> &u_p, const vector<double>

& steps_p, const vector<double> & nodes_p,const vector<double>& steps, const vector<double> & nodes);

// computes the RHS of the linear system at each time stepvoid build_rhs(KN<double> &u, const KN<double> &u_p,

// computes the RHS of the linear system at each time step// assuming that the S-mesh does not vary

double build_time_error_indicator(const KN<double> &u, const KN<double> &u_p,const vector<double> & steps_p,const vector<double> & nodes_p,const vector<double> & steps,const vector<double> & nodes);

// computes the time error indicator at a given time stepdouble build_time_error_indicator(const KN<double> &u, const KN<double> &u_p,

// computes the time error indicator at a given time step// if the S-mesh does not vary

double build_time_error_indicator(int it, const vector< KN<double> >& P) ;// the loop for computing the time error indicators

void build_S_indicator(const KN<double> &u, const KN<double> &u_p,const vector<double> & steps_p,const vector<double> & nodes_p,const vector<double> & steps,const vector<double> & nodes,const double rt , const double dt,KN<double> &indic );

// computes the S-error indicators at a given time stepvoid build_S_indicator(int it, const vector< KN<double> >& P,

vector< KN<double> >& indie);// computes the 5-error indicators at a given time step

// if the S-mesh does not vary}

Page 180: Achdou and Pironneau-Computational Methods Option Pricing

5.4. A Taste of the Software 161

A time step of the method is implemented in the function Time_Step: it consistsof building the matrix B = M + AfmAm , computing its LU factorization, constructing theright-hand side of the system of linear equations, and solving this system.

ALGORITHM 5.2. Time step.

void Euler_Scheme::Time_Step(int it, vector< KN<double> >& P)

{int i, n ;double dt,t,S,h_p,h_n,r;double a,b,c,d,e;

// constructs the matrix of the linear systemn=S_steps[it] .size ();MatriceProfile<double> A(n,2); // memory allocation

t=grid_t[it];dt=t-grid_t[it-1];r=rate(t);e=0.5*dt;

h_n=S_steps[it][0];A(0,0)=e*r*h_n+ h_n/3;A ( 0 , l ) = h _ n / 6 ;fo r ( i= l ; i< n- l ; i++)

{h_jp=h_n;S=S_nodes[it][i];h_n=S_steps[it] [i];a=pow(S*vol(t ,S) ,2);b=a/h_p;c=a/h_n;d=r*S;A ( i , i ) = e * (b+c+r* (h_j>+h_n) )+ (h_p+h_n)/3 ;A( i , i - l )=e*( -b+d)+h_p/6 ;A( i , i+ l )=e*( -c -d )+h_n/6 ;

}h_p=h_n;S=S_nodes[it][i];h_n=S_steps[it] [i];a=pow(S*vo l ( t ,S ) ,2 ) ;b=a/h_p;c=a/h_n;d=r*S;A( i , i )=e* (b+c+r* (h_js+h_n) )+ (h_p+h_n)/3 ;A ( i , i - l ) = e * (-b+d)+h_p/6;

// the matrix of the linear system is constructed

// builds the right-hand sideif (change_grid[it])

build_rhs(P[it],P[it-l],S_steps[it-1],S_nodes[it-1],S_steps[it],S_nodes[it] ) ;

elsebuild_rhs(P[it] ,P[it-l],S_steps[it] ,S_nodes[it] ); // simpler

Page 181: Achdou and Pironneau-Computational Methods Option Pricing

162 Chapters. Adaptive Mesh Refinement

A.LUO ; // LU factorization of AA.Solve(P[ i t ] ,P [ i t ] ) ; // solves the linear system

}

The difficult part is the construction of the right-hand side of the system of linearequations when the mesh in 5 varies: assume that Tn,h ^ Tn-\,h', then we have to computefQ u"h~

1wi for the shape functions of V®h. To do it exactly, one has to intersect the twomeshes Tn,h and Tn-\,h- We reproduce here a function which is not optimized (so that it isnot too intricate).

ALGORITHM 5.3. Right-hand side.

void Euler_Scheme::build_rhs(KN<double> &u, const KN<double> &u_p,const vector<double> & steps_p,const vector<double> & nodes__p,const vector<double> & steps,const vector<double> & nodes)

{double h;double ujpl,u_pr;double phi_l,phi_r;double psi_l,psi_r;double x_l,x_r;int i=0;int j=0;U=0;

u_pl=u_jp (0) ;

x_l=0;

while (ioteps. size () ){

if(nodes_p[j +1]<=nodes[i+1]+eps){

phi_l=0.0;psi_l=l.0;while (nodes_p [j+1]<=nodes[i+1]+eps)

{if (j<steps_p.size()-1)

u_pr=u_p(j+l) ;else

u_pr=0;x_r=nodes_p[j+1];h=x_r-x_l;phi_r=(nodes_p[j+1]-nodes[i])/steps [i] ;psi_r=l.-phi_r;if(i<steps.size()-1)

u( i+ l ) +=h* (2* (phi_l*u_pl+phi_r*u_pr)+ (phi_l*u_pr+phi_r*u_pl) ) / 6 ;

u (i) +=h* (2* (psi_l*u_pl+psi_r*u_pr)+ (psi_l*u_pr+psi_r*u_j?l) ) /6 ;

x_l=x_r;u_pl=u_pr;phi_l=phi_r;psi_l=psi_r;

Page 182: Achdou and Pironneau-Computational Methods Option Pricing

5.4. A Taste of the Software 163

j + + ;if (j==steps_jp. size () )

break;

}if(nodes[i+1]>nodes_p[j]+eps)

{x_r=nodes[i+1];h=x_r-x_l;if ( j<steps_p.size()-1)u_pr=u_p (j ) + (nodes [i+1] -nodes_jp [ j ] ) /stepsjp [j ]

* (u_p(j+l) -u_p(j) ) ;

else

u_pr=(1.-(nodes[i+1] -nodes_p [j])/steps_p[j])*u_p(j) ;phi_r=l.0;psi_r=0.0;if (i<steps.size ()-1)u(i+l)+=h* (2* (phi_l*u_pl+phi_r*u_pr)

+ (phi_l*u_pr+phi_r*u_pl) )/6;u (i) +=h* (2* (psi_l*u_pl+psi_r*u_pr)

+ (psi_l*u_pr+psi_r*u_pl) )/6;u_pl=u_pr;x_l=x_r;

}i++;

}else{

while (nodes [i+1] <=nodes_p [ j+1] +eps){

x_r=nodes[i+1];h=x_r-x_l;if (j<steps_p.size()-1)u_pr=u_j) (j ) + (nodes [i+1] -nodes_p [ j ] ) /stepsjp [ j ]

* (u_p(j+l) -u_p(j) ) ;else

u_pr=u_p(j)*(1-(nodes[i + 1]-nodes_p [ j ] ) /s teps_p[ j ] ) ;if (i<steps.size()-1)

u ( i + l ) + = h * ( 2 * u_pr +u_pl) /6;u ( i )+=h*(2* u_pl +u_pr) /6;x_l=x_r;u_pl=u_pr;i++;if ( i==steps.size())

break;

}if (nodes [i] >nodesjp[j+l] -eps)

J + + ;}

}}

We do not reproduce the function for building the right-hand side when the mesh inthe variable S does not vary: it follows along the same lines as that presented in §4.4.

Page 183: Achdou and Pironneau-Computational Methods Option Pricing

164 Chapters. Adaptive Mesh Refinement

The function for evaluating rjm given by (5.37) is Euler_Scheme: :build_time_error_indicator.

ALGORITHM 5.4. Error indicator for the time mesh.

double Euler_Scheme::build_time_error_indicator(const KN<double> &u,const KN<double> &u_p,const vector<double> & steps_p,const vector<double> & nodes_p,const vector<double> & steps,const vector<double> & nodes)

{double h;int i=0;int j = 0,-doub 1 e u_pr, u_r, e_r ;double x_l,x_r;double u_pl=u_p (0) ;double e_l=u(0)-u_pl;double indic=0;x_l=0;while (i<steps.size() )

{if (nodes__p [j +1] <=nodes [i+1] +eps)

{while (nodes__p [ j +1] <=nodes [i+1] +eps)

{if (j<steps_p.size()-1)

u_pr=u_p(j +1) ;else

u_pr=0;

x_r=nodes_p[j +1] ;h=x_r-x_l;if( i<steps.size() -1)

u_r=u(i) + (x_r-nodes[i])/steps [ i ] * ( u ( i + l ) - u ( i ) ) ;else

u_r=u(i)-(x_r-nodes[i]) /s teps[ i]*u(i) ;e_r=u_r-u_pr ;indic+= (x_r*x_r*e_r-x_l*x_l*e_l)

*(e_r-e_l)/h+h*((2*e_r+e_l)*e_r+(2*e_l+e_r)*e_l)/6;e_l=e_r;u_jpl=u_pr;x_l=x_r;J + + ;if ( j==steps_p.s ize())

break;}

if(nodes [i+1]>nodes_p [j]+eps){

x_r=nodes[i+1];h=x_r-x_l;if (j<steps_p.size()-1)u_pr=u_p(j) + (x_r-nodes_p[j] ) /steps_p[j] * (u_p(j+l) -u_p(j) ) ;else

u_pr=u_p(j)*(!.-(x_r-nodes_p [ j])/steps_p[j]);if (i<steps.size()-1)

Page 184: Achdou and Pironneau-Computational Methods Option Pricing

5.5. Results 165

e_r=u(i+l)-u_pr;else

e_r=-u_pr;indic+= (x_r*x_r*e_r-x_l*x_l*e_l)

*(e_r-e_l)/h+h*((2*e_r+e_l)*e_r+(2*e_l+e_r)*e_l)/6;e_l=e_r;u_pl=u_pr;x_l=x_r;

}i++;

}else

{while(nodes[i+1]<=nodes_p [j+1]+eps)

{x_r=nodes[i+1];h=x_r-x_l;if (j<steps_p.size()-1)u_j?r=u_p(j) + (x_r-nodes_p [j ] ) /stepsj>[j] * (u_p(j+l) -u_p(j) ) ;

elseu_jpr=u_p (j ) - (x_r-nodes_p [ j ] ) /steps_p [ j ] *u_p(j ) ;

if (i<steps.size ()-1)e_r=u(i+l)-u_pr;

elsee_r=-u_pr;

indic+= (x_r*x_r*e_r-x_l*x_l*e_l)*(e_r-e_l)/h+h*((2*e_r+e_l)*e_r+(2*e_l+e_r)*e_l)/6;

e_l=e_r;u_pl=u_pr;x_l=x_r;i++;if (i==steps.size ())break;

}if(nodes[i]>nodes_p [j+1]-eps)

j++ ;}

}return indie,•

}

5.5 Results

5.5.1 Test with a Uniform Volatility

We apply the refinement strategy to the computation of a vanilla European put with payoff100 and maturity 1 year: the volatility and the interest rates are constant: a = 0.2 andr = 0.04. Therefore, we can also compute the price of the option by the Black-Scholesformula, and the error due to the discretization.

We compute the option price in the rectangle [0, 200] x [0,1].

Page 185: Achdou and Pironneau-Computational Methods Option Pricing

166 Chapters. Adaptive Mesh Refinement

First Refinement Strategy. We start with a uniform mesh with 20 nodes in t and 80 inS. Along with the discrete solution, we compute the indicators r\m and rjm_w, and accordingto (5.42), we can compare 77^ with -^ XLeT^ ^m &•> me former term being a global S-

min

discretization error indicator at time tm. If the time-discretization error indicators tend todominate the global S-discretization error indicators, we choose to refine the mesh in the tvariable, and we divide the time steps for which the error indicators are large into smallertime steps, keeping the 5 mesh unchanged. If, on the contrary, the global S-discretizationerror indicators tend to dominate the time-discretization error indicators, then, for each tm,we generate a finer mesh Tm by dividing the elements u> such that rjn iW is large into smallerelements. In such a way we obtain a new mesh, and we can compute again a discretesolution and error indicators.

For the refinement in t, we compute f = maxm rjm and £ = minm r\m and we divide thetime interval \tm-\ ,tm] by two if rjm > (£ + £)/2. For the refinement in 5, we take a similarstrategy. This produces a very progressive mesh refinement: we made up to 19 refinements.We plot in Figure 5.1 the meshes obtained after 0, 5, 10, 19 refinements. In Figure 5.2,we plot -j3- and ty0- XLer Vm u> as functions of time. In Figure 5.3, we have plotted the

error between the prices computed by the Black-Scholes formula and by the finite elementmethod, for the four meshes. In Figure 5.4, we have plotted the error indicators rjm<w.

Finally, in Table 5.1 we have listed both a\\u — Uh,At\\L2((Q,T);V) and (£)m07m +

^f Y^a rim o>)) f°r me different meshes. We see that the estimate of the error by meansof the error indicators is really reliable, for the estimated error never exceeds 2.1 x theactual error. Therefore one can use safely the error indicators for a stopping criterion in theadaption procedure.

The code for the refinement strategy is as follows.

ALGORITHM 5.5. Refinement strategy.

int mainO

{// parameters for the mesh refinement function

int max_aspect_ratio_t=2;int max_aspect_ratio=2;double reduction_factor=8.;

// data structure for the seguance of gridsvector< vector<double> >grid_t(21);vector<vector<vector<double> > >grid_S(21);vector< vector<vector<double> > >S_steps(21);vector < vector<int> >change_grid(21) ;

// bounds of the domaindouble S_max= 200.0, T=l.;double K=100;

// construction of a first gridint Nt=21;int NS=81;grid_S[0] .resize(Nt);S_steps[0].resize(Nt);change_grid[0].resize(Nt,0);for(int i=0;i<Nt;i++)

{grid_t[0] .push_back((T*i)/(Nt-1) ) ;for(int j = 0 ; j < N S ; j + + )

Page 186: Achdou and Pironneau-Computational Methods Option Pricing

Figure 5.1. Four successive mesh refinements: the bottom right figure is a zoomof the more refined mesh near the singularity. ~

l sj

|nsa

y •£

•$

Page 187: Achdou and Pironneau-Computational Methods Option Pricing

Figure 5.2. Error indicators nm and (ty- ̂ ^^f ^ w)5 versus time.min

juauja

ujp

y L

jsay

v aA

jidepy

-gja

jdE

iQ

89 L

Page 188: Achdou and Pironneau-Computational Methods Option Pricing

Figure 5.3. The pointwise errors with the adaptive strategy: the bottom rightfigure is a zoom.

691

si|n

say

-g-g

Page 189: Achdou and Pironneau-Computational Methods Option Pricing

Figure 5.4. Error indicators rjm^: the bottom right figure is a zoom.

}U9W

8U!p

y Lj

saw

aA

jjcte

pv

'SJa

jdeiQ

O

ZL

Page 190: Achdou and Pironneau-Computational Methods Option Pricing

5.5. Results T71_

gr id_S[0 ] [ i ] . push_back( (S_max* j ) / (NS-1) ) ;for(int j = 0 ; j < N S - l ; j + + )

S_steps[0] [i] .push_back(grid_S[0] [i] [j+1]-grid_S [0] [i] [ j ] ) ;}

int ref_it=0; // counts the refinement stepsdouble estim_norm_error=10000; // estimated errorwhile(ref_it<20 && estim_norm_error>l)

{Euler_Scheme scheme(grid_S[ref_it], S_steps [ref_it],grid_t[ref_it] ,

change_grid[ref_it]);// construct a scheme

vector<KN<double> > P(Nt); // the discrete solutionvector<KN<double> > indic_S(Nt); // indicators in Sfor (int i=0;i<P.size ();i++) // init P and indic_S

{P [i] .init(S_steps [ref_it] [i] .size ( ) ) ;indic_S[i] .init(S_steps[ref_it] [i] .size ( ) ) ;for(int j = 0; j<S_steps[ref_it] [i] .size ( ) ; j + + )

{P[i] ( j ) = 0 ;i nd i c_S[ i ] ( j )=0 ;

}}

int iS=0;while (gr id_S[ref_i t ] [0][ is]<K)

{P[0] (iS)=K-grid_S[ref_it] [0] [IS]; // the Cauchy datumiS++;

}vector<double> indic_t; // indicators in timevector<double> indic_S_global; // sum of the S indicators at each

// time stepdouble norm_indic_t=0, norm_indic_S_global=0;for(int i=l;i<Nt;i++)

{scheme.Time_Step (i, P) ; // a time step of the schemedouble auxl=sqrt(scheme.build_time_error_indicator(i,P) )

* vol(0.5,100);indic__t .push_back (auxl) ; // time error indicator : eta_inorm_indic_t+=auxl*auxl;scheme.build_S_indicator_l(i,P,indic_S); // S error

// indicator at time step i: etait(adouble aux=scheme.build_global_S_indicator(i,indic_S[i],

grid_S[ref_it][i]);// sum of the S error indicators at time step i

indic_S_global.push_back(aux);norm_indic_S_global+=aux*aux;

}estim_norm_error=sqrt( norm_indic_t)+ sqrt( norm_indic_S_global) ;

// next refinement : in t or S ? compares the error indicators in// S and t

int which_refine=ref_it%2;if ( norm_indic_t/norm_indic_S_global>2 | |

norm_indic_t/norm_indic_S_global<0.5)which_ref ine=norm_indic_t<norm_indic_S_global;

// refinement : the parameter which_refine tells whether to// refine in t or S

Page 191: Achdou and Pironneau-Computational Methods Option Pricing

172 Chapters. Adaptive Mesh Refinement

adaption_tS(grid_t[ref_it],indic_t,grid_t[ref_it+l] ,1,max_aspect_ratio_t, grid_S[ref_it], change_grid[ref_it], S_steps[ref_it],

indic_S, grid_S[ref_it+l] ,S_steps[ref_it+l] ,change_grid[ref_it+l], reduction_factor, max_aspect_ratio, indic_S_global,

which_refine);Nt=grid_t [ref_it + l] . s i zeO;ref_it++;

}}

TableS.l. a\\u-uh^\\L2{(QJ},V}and(Y,m(ri2m + fy £„ <j) * for the different

meshes.

errorestim. err.

error

estim. err.

5.67

12.27

1.06

1.48

5.66

8.56

0.77

1.29

5.67

6.62

0.77

1.03

4.66

5.38

0.57

0.90

3.734.58

0.57

0.77

3.25

4.19

0.41

0.67

3.26

3.39

0.41

0.52

2.532.95

0.300.44

2.532.56

1.95

2.21

1.45

1.85

1.06

1.59

More Aggressive Refinement Strategies. It is of course possible to use more aggressiverefinement strategies; i.e., one can refine a time step or an element more than twice. Theadvantage is that fewer refinement steps are needed, but the mesh so produced may be toofine in some regions. In our tests, starting with a mesh of 20 x 80, and allowing to split therefined elements into up to eight subelements (depending on the indicator), it is possible todiminish the maximum norm of the error to less than 10~2 in around five refinement steps.

5.5.2 Result with a Nonuniform Local Volatility

Here we take the volatility to be a(5, 0 = 0.05 + 0.25 l^s-ioo^ ut-o.s^ ,,. The result is' 4 6 6 !" 6.61 -1'

plotted in Figure 5.5. We see that the mesh is automatically refined in the zone where thevolatili ty jumps.

Project 5.1. Run the program described above. Adapt it to a barrier option with realisticdata. If time allows make the change S ->• 5/(l + 5) which maps R+ onto (0, 1), computea European put in this formulation, and compare.

5.6 Mesh Adaption for a Put on a Basket of Two AssetsTo illustrate the power of mesh adaption, we take the example of a European put on abasket of two assets: we solve (2.61), with PQ given by (2.65). We take an = 022 = 0.2,y^y = —0.6, and r = 0.05. We use an Euler scheme in time and triangular continuous andpiecewise affine finite elements in the price variables. In Figure 5.6, we plot the contoursof the solution nine months to maturity, computed by using a quasi-uniform mesh. It is

Page 192: Achdou and Pironneau-Computational Methods Option Pricing

5.6. Mesh Adaption for a Put on a Basket of Two Assets 173

Figure 5.5. The solution computed with a piecewise constant local volatility.

Figure 5.6. Left: a quasi-uniform mesh in the variables S\, S^. Right: contourso f P ( S i , ^2, 0.25) computed on this mesh.

possible to use an adaption strategy. One way do it is to generalize the approach presentedabove to the two-dimensional case. The approach presented here is different: by and large,starting from a possibly coarse grid, the idea is to adaptively construct a regular mesh (theangles of the triangles are bounded from below by a fixed constant) in the metric generatedby an approximated Hessian of the computed solution. Although the theory for this strategyis not as clean as the one presented above, this method gives generally very good results. Wehave used the freeware f reef em++, by Pironneau and Hecht [100], which is available athttp://www.freefem.org. This software permits one to use two-dimensional finite elementsand mesh adaption by means of a user-friendly dedicated language.

Page 193: Achdou and Pironneau-Computational Methods Option Pricing

174 Chapter 5. Adaptive Mesh Refinement

Adapted meshes at different times and the contours of the solution nine months tomaturity are plotted in Figure 5.7. We see that the meshes need many fewer nodes thanthe quasi-uniform mesh for a nice accuracy. The mesh is refined only in the zones wherethe solution has large second order derivatives. Note that no adaption in time has beenperformed here, although we have made clear that this is crucial for pricing accurately nearmaturity.

Figure 5.7. The adapted meshes three, six, and nine months to maturity, and thecontours of P nine months to maturity.

5.7 Appendix: Proofs

Proof of Lemma 5.2. From the definition of UA/, an easy computation yields

Page 194: Achdou and Pironneau-Computational Methods Option Pricing

5.7. Appendix: Proofs 175

If Afm = 0,theright-handsidein(5.47)isequalto|(|u"J|^ + |ym-1|2v+(i;w, vm-l)v) >

51 um I2/, using the inequality ab > — ̂ - — b2. Furthermore, e~2XArmT is continuous withrespect to A/m, so there exists a positive constant a\ < | such that if Af < ^-, thene^'"' Jr'

m e"2A-T | i>Arlv(T)dr > 11 u"1]2/, or in an equivalent manner,

We also have

M=l /

This and (5.48) yield the upper estimate for [[(um)]]n.For the other estimate, we see that (5.47) also yields

Therefore,

This and the estimate Yl™=i (1 - 2>.Af,-) < e~~2Xtm-1, which holds as soon as 2A. Ar < 1, yield

We know that there exists a constant «2 < \ such that

and

where /OA/ is defined by (5.20). We have also that if Af < ^, then

Page 195: Achdou and Pironneau-Computational Methods Option Pricing

176 Chapters. Adaptive Mesh Refinement

so

Finally, (5.27) follows by taking a = min(a;i, #2). D

Proof of Proposition 5.3. We begin by plugging «A? into (5.15); we obtain that for allt e (tn-i,tn],andv € V0,

Subtracting from (5.15) leads to

Wenowtakeu(0 = (u — u&t)(t)e 2X/, integrate on (tn _ i, tn), and sum up with respect

to n. Since (u — u&t)(Q) = 0, we obtain

We evaluate separately each term on the right-hand side of this inequality:

Page 196: Achdou and Pironneau-Computational Methods Option Pricing

5.7. Appendix: Proofs 177

where we have used (5.10). Calling L — 4L\ + ILi + LI, and using (5.28), we obtain

Dealing now with the second term, we have from a Cauchy-Schwarz inequality

But WA /(T) - um = ̂ (um-1 - um), soA/™

Adding and subtracting u™ 1 and u™ yields

Using (5.49) then (5.27) yields that the sum over m of the last two terms can be bounded by

Therefore

which gives the desired estimate.

Page 197: Achdou and Pironneau-Computational Methods Option Pricing

178 Chapters. Adaptive Mesh Refinement

Proof of Corollary 5.4. It is clear that

and reusing the steps of the preceding proof, we obtain that

which implies that

and we can use (5.36). Also,

and

Finally,

and

which implies that

Combining all these estimates, we have proved the desired result.

Proof of Proposition 5.5. For any v e VQ and for any u/, e Vnh, we have

Page 198: Achdou and Pironneau-Computational Methods Option Pricing

5.7. Appendix: Proofs 179

By integrating by parts, we see that

where £,-, i = 1, 2, are the endpoints of &>. Calling (S,-)/=o,...,#„/, the mesh points of Tnh,0 = SQ < S\ < • • • < Sxnh = S, we choose Vh e V/, such that uj,(S,-) = u(5,-) for S; 7^ 0,and vh (0) such that J0' (v — Vh) = 0. We can prove that

and

With this choice,

Remark 5.2. Note that such a choice for u/,, based essentially on Lagrange interpolation,is not possible for a parabolic problem in more than two dimensions (counting the timedimension), because the junctions ofV are generally not continuous. This explains Remark5.1.

Therefore

Finally, taking v = (u" - unh) in (5.51) yields

Page 199: Achdou and Pironneau-Computational Methods Option Pricing

180 Chapters. Adaptive Mesh Refinement

and therefore

Multiplying the previous equation by n/L/O ~ 2AAf,-) and summing up over n, we obtainthat for a constant c,

Therefore, using (5.27),

Proof of Proposition 5.7. We apply the triangular inequality to r)n:

We know from (5.49) that

and using (5.20),

It remains to estimate Atne 2Xr"-1 ^9°- \un —un l\\. For this, we see thai

Page 200: Achdou and Pironneau-Computational Methods Option Pricing

5.7. Appendix: Proofs 181

where

We are going to deal separately with the four terms in the right-hand side of (5.55).We have

Similarly,

We write the fourth term as

Page 201: Achdou and Pironneau-Computational Methods Option Pricing

182 Chapters. Adaptive Mesh Refinement

But, using (5.19),

and

Let us deal with III. Exactly as for (5.50),

Page 202: Achdou and Pironneau-Computational Methods Option Pricing

5.7. Appendix: Proofs 183

• if/i = 1,

The desired bounds follow by inserting all these estimates into (5.55). D

Proof of Proposition 5.8. We use (5.52) with u/, = 0 and v = (^-^ rS-jfj- + ru%)'fta}

on u> and v = 0 on (0, S)\a>, where ̂ « is the bubble function on at, equal to the product ofthe two barycentric coordinates associated with the endpoints of co. This leads to

We note that v is the product of •&£ by a linear function, and we use the inverse inequalities

Thus,

Page 203: Achdou and Pironneau-Computational Methods Option Pricing

184 Chapters. Adaptive Mesh Refinement

and therefore

Remark 5.3. lfr]n^ was computed by (5.41) as in Remark 5.1, then Proposition 5.8 wouldhold: indeed, for any endpoint £/ ^ Qofco, we call co' the other element sharing the node£,- with CD, and we use (5.52) with Vh = 0 and

where R^,o is the affine function in O taking the value 1 /£, at £, and 0 at the other endpoint

ofO. We see that <72(£, *„)£,- |[^](&)l is bounded by

plus the same terms as in (5.57). Using (5.30), (5.58)for w and CD' and the estimate

we obtain that

Page 204: Achdou and Pironneau-Computational Methods Option Pricing

Chapter 6

American Options

6.1 IntroductionUnlike European options, American options can be exercised anytime before maturity. Notethat since the American option gives more rights to its owner than the European option, itsprice should be larger.

As before, the price of the underlying asset satisfies

where the volatility may depend on time and price and where Wr is a standard Brownian mo-tion. There exists a probability P* (the risk neutral probability) under which the discountedprice of the asset is a martingale. It can be proven that under the risk neutral probability,the price of the American option of payoff P0 and maturity T is

where 77,r denotes the set of stopping times in [t, T] (see [78]).It is possible to prove that P(S, t) is also the solution to the variational inequality,

which is the weak form of the following set of inequalities:

with data

The theory for pricing an American option is not easy: the proof of the above-mentioned result can be found in Bensoussan and Lions [13] and Jaillet, Lamberton, andLapeyre [78].

185

Page 205: Achdou and Pironneau-Computational Methods Option Pricing

186 Chapter6. American Options

Figure 6.1. Left: the function S i-» P(S, t) at t = T and t < T. Right: theregion of exercise.

It can be proved that the price C(5, t) of a European vanilla call is always largerthan the payoff (S — K)+. Therefore, the American and European vanilla calls have thesame prices. On the contrary, for the American vanilla put, there is a region where P(5, /)coincides with the payoff P0(S) = (K — S)+; see Figure 6.1. If 5, falls in this region,then the put option should be exercised, because it is worth selling the underlying asset inorder to buy some risk-free asset. The region where P(S, t} = P0(S) is called the regionof exercise.

In what follows, in conformity with the rest of the book, we focus on partial differ-ential equations and their numerical resolutions: the first two sections are devoted to themathematical analysis of the variational equation and to the free boundary (the boundary ofthe region of exercise). Then we discuss discretization by finite elements and prove conver-gence of the method. Later, we consider the solution procedure to the discrete variationalinequality, and give a C++ program. Finally, we present two different computations, with aconstant and a local volatility: in these tests, we also use a mesh refinement strategy closeto the one presented in Chapter 5.

6.2 The Variational Inequality

Calling t the time to maturity, (6.2), (6.3) becomes

with Cauchy dat

Page 206: Achdou and Pironneau-Computational Methods Option Pricing

6.2. TheVariational Inequality 187

We focus on the case of a vanilla put, i.e., the payoff function is P0(S) — (K — S)+,but, to a large extent, what follows holds for more general functions.

To write the variational formulation of (6.4), (6.5), we need to use the same Sobolevspace V as for the European option, i.e.,

and we call /C the subset of V:

Since the functions of V are continuous, the inequality in (6.7) has a pointwise meaning.The set /C is a closed and convex subset of V, because convergence in V implies pointwiseconvergence.

Using the notation defined in Chapter 2, we can formally multiply the first inequalityin (6.4) by a smooth nonnegative test function of 5 and perform some integration by parts.We obtain that

where the bilinear form at is defined in (2.19):

We make the same assumptions as for the European option, namely, (2.20) and (2.21).These imply that the bilinear form at is continuous on V uniformly in t; see (2.22) andGarding's inequality (2.25). Observing that P0 e V, the set JC is exactly 1C = P0 + £0,where K,0 is the cone of nonnegative functions in V. Therefore, from (6.8), we see that avariational formulation to (6.4) is as follows:

Find P e C°([0, T]; L2(R+)) nL2(0,1; /C), such that 3£ € L2(0, T; V), satisfying

for a.e. t e (0, T),

or in an equivalent manner,

Page 207: Achdou and Pironneau-Computational Methods Option Pricing

188 Chapter 6. American Options

and finally

Note that (6.12) and (6.13) imply that

Conversely, choosing v = P(t) + w — P0, with w e AC in (6.14), implies (6.12). Thenusing (6.12) and choosing v = P0 in (6.14) yields (6.13). Therefore, we have found thatthe weak formulation is equivalent to the following variational inequality:

Find P e C°([0, 7]; L2(R+)) n L2(0, 7; AC), such that |f e L2(0, 7; V), satisfying(6.10) and (6.14).

We do not write here the proof of existence and uniqueness for the variational in-equality evolution problem (6.10), (6.14). It is given in [2], after the book by Kinderlehrerand Stampacchia [82], which is an excellent reference on the mathematical analysis ofvariational inequalities. One may also look at the papers by Friedman [56, 57].

The main idea is to observe that

• the price of the American option is always larger than that of the European option,which is positive for t > 0. Therefore, P(t) cannot coincide with P0 for values of5 > K;

• it holds that

so in the region where P and P0 coincide, we have

and to approach the variational inequality by the penalized nonlinear problem:FindPe € C°([0, 7]; L2(R+))nL2(0, 7; V), such that ̂ L € L

2(0, 7; V), satisfying(6.10) and

with V€ : y \-+ Vf(y) = V(|), where V is a smooth nonincreasing convex function (seeFigure 6.2) such that

Then the proof of existence for the variational inequality consists of showing that thepenalized problem has a unique solution Pe, proving estimates on Pe, in particular that a.e.in t, Pf e AC, and finally obtaining that when € —>• 0, Pf converges to a limit P which is asolution to (6.14). The main arguments are related to the fact that Ve is a monotone functionand to the weak maximum principle (see [89]). The results are summarized in the followingtheorem.

Page 208: Achdou and Pironneau-Computational Methods Option Pricing

6.3. The Exercise Boundary 189

Figure 6.2. The function Ve.

Theorem 6.1. With a satisfying assumptions (2.20) and (2.21), the problem (6.10), (6.14)has a unique solution P which belongs to C°([0, +00) x [0, T]) with P(0, f) = K, forall t e [0, T], and is such that Sff, ff e L2(0, T; V), Sff 6 C°([0, T]\ .L2(M+)), anJf e L2(0, T; L2(R+))-

The function P is also greater than or equal to Pe, the price of the vanilla European put.The quantities \\P\\L2(0,T;V), II **llL«»(0,r;L2(R+))' ll^ff| |L2 (0 fr ;v), l l f f l lL ' (o , r ;V) ,

HSff ||L°°(o,r;L2aR+))> and \\ If \\L^O,T-L^R+)) are bounded independently from a in the classdefined in assumptions (2.20) and (2.21).

We have that

Furthermore, if Pe is the solution to (6.10), (6.15), we have

and calling n, the function fji = ^ + AtP, where At is the linear operator V —>• V, for all

v e V, Atv = -^^-^ - rSff + rv, we have

6.3 The Exercise Boundary

Lemma 6.2. Let P be the solution to (6.10), (6.14). There exists a function y : (0, T] —>•[0, K), such that for all t e (0, T), {5; P(S, t) = P0(S)} = [0, y(f)]. In the open setQ+ = {(S, t),0<t <T,S > y(t}}, we have |f + AtP = 0.

Proof. The function S|f belongs to C°([0, T]; L2(R+)), and, for any t, we have thatfj(-, 0 > -1 a.e. in S. The set {S; P(S, t) = P0(S)} is not empty since it contains 0. Ifit was not connected, then there would exist an interval where fj(S, 0 < —1 a.e. Thiswould contradict the bound on |j. Therefore, the set {5; P(S, t) = P0(5)} is an intervalcontaining 0.

Page 209: Achdou and Pironneau-Computational Methods Option Pricing

190 Chapter 6. American Options

Theorem 6.3. For a satisfying (2.20) and (2.21), there exists yo > 0 depending only on asuch that

Proof (sketched). Let P be the solution of (6.4) with a — a. The region {P = P0} isgiven by {(5, /), S < Y(OK where y is a function from [0, T] to [0, K].

It can be proved by using the weak maximum principle that |^ > 0 (this relies onthe fact that a is a constant, so the equation for the penalized problem can be differentiatedtwice).

We can also prove that P is a nondecreasing function of time (by studying the cor-responding penalized problem and passing to the limit); therefore y is a nonincreasingfunction of time.

Also, as proven in [82, p. 288], y is continuous, so the boundary of {P = P0} is a

negligible set, and p, = |f + AtP = rKl{P=Po} = rKl({S,,),o<t<T,s<y(t)}-We also have that P < P: indeed, calling E = P – P,

The two terms on the right-hand side are nonnegative. The first term is nonnegative thanksto the convexity of P with respect to S. The second term is nonnegative thanks to (6.19).Furthermore, rAT(l{p<Po} — l{p<pc})E- is nonnegative a.e. thanks to the nonincreasingcharacter of the real function u H> !M<p0(^) (here E- is the negative part of E). Therefore,a weak maximum principle can be applied and we see that £"_ = 0 (everywhere since Pand P are continuous).

Since P < P, we know that y < y. Therefore, if there exists tQ < T such thaty(t0) — 0, then y(t0) = 0 and y(t) = 0 for t > t0. It follows that P solves the Black-Scholes equation for t > t0, and P(t0) < K: the maximum principle indicates that P(t) <Ke-r(t-t0) for t > tQ xhis is in contradiction with the fact that P > P0.

The assertion y(T) = 0 is also impossible, because we can always look for P in alarger time interval.

Since y is continuous on [0, T], there exists YQ > 0 such that inequality (6.20) is satis-fied.

We now state a regularity result on y, with the minimal assumptions (2.20) and (2.21).

Theorem 6.4. For a satisfying (2.20) and (2.21), the function t H-> y (0 is upper semicon-tinuous. Moreover, it is right continuous in [0, T). Furthermore, for each t e (0, T], y hasa left limit at t.

Proof. See [2]. The proof is based on the construction of auxiliary variational inequalitieswith constant volatilities and uses the weak maximum principle.

As a consequence of Theorem 6.4, we have the following result.

Page 210: Achdou and Pironneau-Computational Methods Option Pricing

6.3. The Exercise Boundary 191

Theorem 6.5. For a satisfying (2.20) and (2.21), the function \JL — ̂ + At P is

In other words, a.e., one of the two conditions P — P0 and JJL = 0 is not satisfied: we seethat there is strict complementarity in (6.4).

Proof. For any time t, both limr<; y(r) and limr>, y ( r } exist. Therefore, the function y isthe uniform limit of a sequence of piecewise constant functions % (i-e., Yk is constant on afinite number of intervals). Thus, calling J (resp., Jk) the set of points where y (resp., y^)jumps, we have J c ^k&^Jk because of the uniform convergence and J/t is finite. Thusthe set J is countable.

Consider now the boundary T of the set {P = P0} = {S < y(t}, t e [0, T]}: we haveT = (F n {(S, /), f e [0, T]\J}) U (r n {(S, t), t e J}). The second set is negligible,since J is countable. For the first set, we have r n {(S, t), t e [0, T]\ J} = {(y(t), /), t e[0, T]\J], so it is also negligible. Thus, F is negligible.

Therefore, the set {P = P0} has the same measure as its interior, on which JJL = rK.This proves (6.21). D

For additional information on y, we need more assumptions on the volatility.

Assumption 6.1. We assume that for a constant Cff > 0,

a.e. in (0, T) x R+.

Lemma 6.6. With a satisfying assumptions (2.20), (2.21), and (6.22), the solution P to(6.10), (6.14) satisfies 0 > 0 a.e.

From Lemma 6.6, we can prove the following result.

Theorem 6.7. Under the assumptions of Lemma 6.6, the function y is continuous.

Proof. The proof uses the strong maximum principle and is given in [2].

When Theorem 6.7 applies, the graph F of y is a free boundary and the reaction termIJL is rKl{P=Po}: P is a solution to the partial differential equation on one side of F andcoincides with P0 on the other side, and a.e. one of the two conditions P = P0 and (u = 0is not satisfied.

Since the option should be exercised when P = P0, the curve F is called the exerciseboundary. We have seen in Theorem 6.3 that F does not intersect the axis 5 = 0.

Note also that from Theorem 6.1, the slope of P (S, t) as a function of S is continuousacross S = y (t). Only the second derivative of P with respect to S may jump at S = y(t).

Another interesting question (of practical interest) is the behavior of y for t close to0, i.e., near the maturity. The answer was given by Barles et al. [11], and Lamberton [86]

Page 211: Achdou and Pironneau-Computational Methods Option Pricing

192 Chapter 6. American Options

for constant volatility. For local volatilities, a comparison argument can be applied, and theresults cited above can be generalized as follows.

Proposition 6.8. We have, for t close to 0,

Therefore, the function y is not even Holder continuous with exponent 1/2.

6.4 Discrete Approximations to the Variational Inequality

We choose to discretize the problem with finite elements because they enable to discretizedirectly (6.14). A finite difference method is quite possible too, but one has to depart from(6.4).

We localize the problem on (0, 5) as usual, so V becomes

(where S is large enough so that P0(S) = 0), and 1C = {v e V, v > P0}. The variationainequality is (6.14) with new meanings for V, 1C, and a,.

Moreover, if yo e (0, AT) as in (6.20) is known, one can focus on the smaller interva[S, 5] with 0 < S < yo and obtain the equivalent weak formulation:

Find P e L2((0, T), JQ D C°([0, T); L2(ft)), with |f e L2(0, T; V), such thaP(t = 0) = P0 and (6.14) holds for all v e 1C, with the new definition of the closed set /C

We introduce a partition of the interval [0, T] into subintervals [tn-\, tn], 1 < n < N,with At{ = tf — ti-i, Af = max, Af, and a partition of the interval [0, 5] into subintervalsa)i = [5,_i, S{], 1 < i < Nh + I, such that 0 = S0 < Si < • • • < SNh < SNh+l = S. Thesize of the interval <w, is called hi and we set h = max,=i Nh+\ hf. The mesh 7h of [0, 5]is the set {coi,..., a>Nh+i}. In what follows, we will assume that both the strike K and thereal number S_ coincide with nodes of 7^: there exist a < / c , 0 < a r < / c < . / V / , + l, suchthat SK = K and 5a_i = 5. We define the discrete space Vh by

where PI (CD) is the space of linear functions on a).Since K is a node of T/,, P0 e Vh, and since 5 is also a node of T/,, we can define the

closed subset /C/, of V/, by

Page 212: Achdou and Pironneau-Computational Methods Option Pricing

6.4. Discrete Approximations to the Variational Inequality 193

The discrete problem arising from an implicit Euler scheme is as follows:Find (Pn)o<n<N e /Q satisfying

and for all «, 1 < n < N,

Exercise 6.1. Write the discrete problem arising from the Crank-Nicolson scheme.

Let (u>'')i=+o,...Nh be the nodal basis of Vh, and let M and Am in R(Nh.+)*( Nh.+) be themass and stiffness matrices defined by

These matrices are exactly those described in §4.3. Denoting

(6.28) is equivalent to

We call Ma (resp., A£) the block of M (resp., A") corresponding to a < i, j < Nh/,.

6.4.1 Existence and Uniqueness of (6.28)

Theorem 6.9. Consider A such that Gdrding's inequality (2.25) holds, and take A? < £;there exists a unique Pn satisfying (6.28).

Proof. We reproduce the arguments of Stampacchia (the proof holds for infinite-dimensionalHilbert spaces assuming that the bilinear form a ( - , •) is continuous and satisfies a Garding'sinequality).

There exists a unique Qn e Vh such that

We introduce a positive parameter p, which will be chosen later. It is straightforward to seethat (6.28) is equivalent to

Page 213: Achdou and Pironneau-Computational Methods Option Pricing

194 Chapter 6. American Options

which amounts to saying that P" is the projection of P" — p Qn on /C/,, for the scalar product

( - , - ) v :

where n^ is the projector on /C/, with the scalar product (•, - )v - To summarize, we haveproven so far that (6.28) is equivalent to the fixed point problem (6.31). To use the Banach-Picard fixed point theorem, we need to find p such that the operator P t-> YI)ch(P-pQ)isa.contraction in the norm || • || v, where (? is given by (Q, v)v = (P — Pn~l, i>)+A/na / n(P, u)for all v e Vh. Since the projector Yl)ch is Lipschitz continuous with the Lipschitz constant1, it is enough to prove that for a positive constant x < 1» II^ — pQ — P' — pQ'llv <X\\P — P'\\v for all P, P' e Vh, and obvious meanings for Q and Q'. This amountsto proving that \\P — pQ\\v < X l l ^ l l v * where Q is the unique function in Vh such that(Q, v)v = (P, v) + &tnatn(P, v) for all v e Vh.

From the continuity of atn, there exists a positive constant C such that | |<2l lv <

C\\P\\V.Consider now A such that Garding's inequality (2.25) holds, and take A/ < i. We

have

For At < i and p small enough (the condition on p depends on Af), we have proved that

the mapping P \-+ P — pQisa contraction in Vh, and we can apply the fixed point theorem:there exists a unique P" satisfying (6.31), and therefore (6.28).

6.4.2 Stability

Taking v = P0 in (6.28),

which implies from (2.22) and (2.25) that

Hence, assuming now that 2A.A* < 1,

Page 214: Achdou and Pironneau-Computational Methods Option Pricing

6.4. Discrete Approximations to the Variational Inequality. 195

For m < N, multiplying this by (1 — 2XAt}m~n~l and summing over n from n = 1 ton — m yield

Calling PA/ the piecewise affine function in time such that P&t(tn) = Pn, the previousestimate implies that for any c < 1, there exists a constant C such that for all A? with2^Ar < c,

6.4.3 Convergence

Only for simplicity, we assume hereafter that the grid in t is uniform: Atn = Af for all n.

Lemma 6.10. Let P be the solution to (6.10), (6.14) with K, given by (6.24). // P&t is thepiecewise bilinear (in the variables t and S) Lagrange interpolate of P on the (S, t) mesh,we have that P&t > P0,

and

Proof. It is possible to interpolate P at the mesh nodes since P is continuous. Then it isclear that the interpolate PA/ is a piecewise affine function of time with values in K-h (withPAt(tn) = P" e tCh)- The asymptotics on the error in (6.33) and (6.34) follow from theregularity results in Theorem 6.1.

Theorem 6.11. Assume that the coefficients a and r are smooth enough so that

then

Page 215: Achdou and Pironneau-Computational Methods Option Pricing

196 Chapter 6. American Options

Proof. Let us define R = P - P0 e C°([0, T}\ /C0) and /?A, = PAr - P0 e C°([0, T]: /C0),as well as /f = /?A;(/m) = P% -P0e)Cor\Vh, where

and where V/, is defined in (6.25). We have

With A. in the Garding's inequality (2.25), the inequality in (6.37) can be written as

But

and

Therefore.

and (6.38) becomes

Page 216: Achdou and Pironneau-Computational Methods Option Pricing

6.4. Discrete Approximations to the Variational Inequality 197

Multiplying (6.40) by (1 - 2AAr)"~A'"1, taking v% = r™ = Pm - P0, and summingover n, we get (using the fact that r® = r° = 0)

On the other hand, calling 0 the piecewise constant function in (0, T] defined by0(f) = (1 - 2AAf)"~JV~1 if *n-i < * < * « , we know from (6.12) that, for every functionQ e L2(0, T; /C0),

Taking for <2 the piecewise constant function with value in Vj, such that Q(t) = r%, fort e (tn-i, tn], we get that

and using the stability estimate (6.32), the asymptotics on R — R, (6.33), (6.34), as well as(6.35), we obtain that

Page 217: Achdou and Pironneau-Computational Methods Option Pricing

198 Chapter6. American Options

Together with (6.41) and Garding's inequality (2.25), this implies that

Then, realizing that in (6.45), N could be replaced by any n, 1 < n < N, and combining(6.45) with (6.33), (6.34) yields (6.36).

6.4.4 The Discrete Exercise Boundary

One may ask if there is a well-defined exercise boundary t -> y/,(0 also in the discreteproblem. A positive answer has been given by Jaillet, Lamberton, and Lapeyre [78] in thecase of a constant volatility, an implicit Euler scheme, and a uniform mesh in the logarithmicvariable. The main argument of the proof lies in the fact that the solution to the discreteproblem is nondecreasing with respect to the variable t. With a local volatility, this may nothold (see the numerical example below). The result of Jaillet, Lamberton, and Lapeyre hasbeen generalized to a local volatility in [4], in the special case when the mesh is uniform in thevariable 5: here too, the discrete problem has a free boundary. The proof no longer relies onthe monotonic character of the discrete solution with respect to / but on the discrete analogueof the bounds (6.17), i.e., -1 < |j < 0. This is proved by studying a penalized problemfor (6.28) (the discrete analogue to (6.15)) and by using a discrete maximum principle onthe partial derivative with respect to S (for this reason, a uniform mesh is needed). We cansummarize this in the following theorem.

Theorem 6.12. Assume that the grid 7h is uniform and that 5 > 0. Assume also thatthe parameters h and ^ are small enough so that the matrices A£ and M« + A/nA£ aretridiagonal irreducible M-matrices for all n, 1 < n < N.

Then there exist N real numbers y£, 1 < n < N, such that

We believe that this may be extended to somewhat more general meshes.

6.5 Solution ProceduresWe propose hereafter four algorithms for solving the discrete variational inequalities arisingfrom an implicit time-stepping procedure. Other methods based on penalization can befound, for example, in [50].

Page 218: Achdou and Pironneau-Computational Methods Option Pricing

6.5. Solution Procedures 199

6.5.1 The Projected SOR Algorithm

At each time step, we have to solve (6.32), which belongs to the following class of problems:Consider a matrix A e IRMxM, two vectors F and B in RM, and the variational inequality:find U € RM such that

where

We assume that for two positive constants a and ft, A satisfies

so (6.47) has a unique solution.Let co be a real number, 0 < u> < 1. The idea is to construct a sequence of vectors

£/(*) which hopefully converges to U by using a one-step recursion formula (starting froman initial guess t/(0)), C/(A:+1) — ifr(U^), where ty is the nonlinear mapping in Rm:

This construction is a modification of the so-called successive overrelaxation (SOR) methodused to solve iteratively systems of linear equation; see [8, 62, 106] for iterative methodsfor systems of linear equations. For solving approximately the system AX = F, the SORmethods constructs the sequence (Xw )k (starting from an initial guess X(0)) by the recursion

Lemma 6.13. If A is a diagonal dominant matrix and ifO<a>< 1, then the mapping \jfdefined in (6.49) is a contraction in EM of the norm \\ • H^ f || V||oo = maxi<,-<A/ | V,-|).

Proof. Denote Z = ^r(X), Z' = if(X'). Obviously,

where

and

Page 219: Achdou and Pironneau-Computational Methods Option Pricing

200 Chapter 6. American Options

Therefore, denoting 8X = X - X',8Y = Y - Y', and <5Z = Z – Z', we have

In view of (6.50), denoting by i, 1 < < M, an index such that ||<5F||oc = \8Yj\, it isenough to prove that for a constant p,0 < p < 1, \8Y{\ < p^SX^. But (6.50), (6.51), and0 < u> < 1 imply

and

for both the denominator and the numerator are positive, due to the diagonal dominance ofA and the choice of CD. Calling

wehaveO</o < 1 and \W(X) - ^(*')lloo < pll^lloo-

As a consequence of Lemma 6.13, the sequence (C/^)* converges to the unique fixedpoint of ^. There remains to prove the following lemma.

Lemma 6.14. With the assumptions of Lemma 6.13, ifU is the solution to (6.47), then U isthe unique fixed point of\j/ defined in (6.49).

Proof. We know that U satisfies

Denote Z = ^f(U). Let us prove by induction on the indices that Z = U: if U\ > B\, then

therefore with Y defined as above, Y\ = U\ and Z\ = U\.li, on the contrary, U\ = B\, wehave that Y\ < U\, and therefore Z\ = B\.

Suppose now that Z; = £7, for j < i. If C7, > Bf, we have that

If, on the contrary, Ui = B{, then 7, < Ui and Z, = J5,-.

Page 220: Achdou and Pironneau-Computational Methods Option Pricing

6.5. Solution Procedures 201

Thanks to Lemmas 6.13 and 6.14, we have proved the following result.

Theorem 6.15. With the assumptions of Lemma 6.13, the projected SOR method convergesto the solution of (6.41}.

6.5.2 The Brennan and Schwartz Algorithm

The Brennan and Schwartz algorithm [19] is an algorithm which works under rather re-strictive assumptions. It has been studied by Jaillet, Lamberton, and Lapeyre [78]. Thealgorithm is a modification of the Gaussian elimination algorithm, and is based on the fac-torization of A: A = UL, where U is an upper triangular matrix whose diagonal coefficientsare all 1 and L is a lower triangular matrix. In fact, the bandwidths of both U and L are 2, sosolving a system with U or L is very easy, and can be done with a computational cost linearwith respect to M. The complexity for computing L and U is linear too with respect to M.Then, assuming that L and U are computed, the algorithm for solving (6.47) is as follows:

• Solve UY = F.

• For i = 1 to M, doUt = max((y; - L,,/_itf,_i)/LM, B,).

In [78], Jaillet, Lamberton, and Lapeyre studied this method for the American put inthe logarithmic variable, for a uniform grid in x. They prove that if the step size is smallenough, then the Brennan and Schwartz algorithm yields the solution to (6.47): the proofrelies on the fact that the discrete problem has a free boundary and on the fact that the matrixis an M-matrix.

This algorithm is really fast (its complexity grows linearly with M). However, it maylack robustness when the mesh is highly nonuniform.

6.5.3 A Front-Tracking Algorithm

Here, we propose an algorithm for computing the solution of (6.28), assuming that the freeboundary is the graph of a function. In our experience, this algorithm, based on tracking thefree boundary, is more robust (and slightly more expensive) than the Brennan and Schwartzalgorithm (see [78]). Since the free boundary is the graph of a function, the idea is to lookfor y£ by doing the following:

• Start from y£ = y£~l.

• Solve the discrete problem corresponding to

and Pn(S) = 0.

Page 221: Achdou and Pironneau-Computational Methods Option Pricing

202 Chapter 6. American Options

• If Pn satisfies (6.28) and P" > P0, stop; else shift the point y% to the next node onthe mesh left/right according to which constraint is violated by Pn.

With the notation introduced above, the algorithm for computing PA" is as follows.

Algorithm.Choose k such that y£~l = Sk', set found=false;whilefnot found)

.. if ( ( I7" - t f ° ) t <0)found=false; k = k + 1;

elsecompute a = (M(Un - U"'1} + AfnAwf/w)^_r,i f ( a < 0 )

found=false; k = k — 1;else found=true.

In our tests, we have computed the average (over the time steps) number of iterationsto obtain the position of the free boundary: it was found that (with a rather fine time-mesh),this number is smaller than 2.

A Program in C++ for the American Put. Here we give a program for computing anAmerican put. The mesh in S can vary in time exactly as in Chapter 5, so mesh adaptioncan be performed. For simplicity, the time scheme is Euler's implicit scheme. We writefirst a function for a single time step.

ALGORITHM 6.1. Time step.

int American_Euler_Scheme: :Time_Step (int it, vector< KN<double> >& P, constdouble K, const int free_bdry_guess_p){

int i,n;double dt , t ,S,h_p,h_n,r ;double a ,b ,c ,d ,e ;

n=S_steps[it].size 0;MatriceProfile<double> A ( n , 2 ) ;KN<double> y ( n ) ;KN<double> rhs(n); // right-hand sideKN<double> ob(n) ; // obstacle

t=grid_t[it]; // current timedt=t-grid_t [it-1] ,- // time stepr=rate(t) ;e=0.5*dt;

// assemble the matrixh_n=S_steps[it][0];

Page 222: Achdou and Pironneau-Computational Methods Option Pricing

6.5. Solution Procedures 203

A(0,0)=e*r*h_n+ h_n/3;

A(0,l)=h_n/6;

for(i=l;i< n-l;i++)

{h_p=h_n;

S=S_nodes[it] [i] ;

h_n=S_steps[it] [i] ;

a=pow(S*vol(t,S) , 2) ;

b=a/h_p;

c=a/h_n;

d=r*S;

A(i, i) =e* (b+c+r* (h_jp+h_n) ) + (h_j>+h_n)/3;

A(i,i-l)=e*(-b+d)+hjp/6;

A(i,i+1)=e*(-c-d)+h_n/6;

}h_p=h_n;

S=S_nodes [it] [i] ,-

h_n=S_steps[it] [i] ;

a=pow(S*vol(t,S),2) ;

b=a/h_p;

c=a/h_n;

d=r*S;

A(i,i)=e*(b+c+r*(h_p+h_n))+ (h_jj+h_n)/3;

A(i,i-1)=e*(-b+d)+h_p/6;

// assemble the right-hand side;if (change_grid[it] )

{build_rhs(rhs,P[it-l] , S_steps[it-1],S_nodes[it-1],S_steps[it] ,

S_nodes[it]);

}else

build_rhs(rhs,P[it-1] , S_steps[it-1],S_nodes[it-1],S_steps[it] ,S_nodes[it] ) ;

// the obstacle functionint iK=0;while (S_nodes[it] [iK] <K)

iK++;ob=0;for ( i=0; i<iK; i++)

ob(i)=K-S_nodes[it] [i] ;// first guess for the position of the exercise boundary

int f +ree_bdry_gue s s=0;while (S_nodes[it] [free_bdry_guess]< S_nodes[it-1] [free_bdry_guessjp])

f ree_bdry_guess++,-// solves the problem

return free_bdry<double>(A, P[ i t ] , y, rhs, ob, free_bdry_guess);}

Page 223: Achdou and Pironneau-Computational Methods Option Pricing

204 Chapter 6. American Options

The program for the free boundary tracking is as follows.

ALGORITHM 6.2. Free boundary localization.

intfree_bdry (const MatriceProfile<double> & A, KN<double> & x, KN<double> & y,

const KN<double> & b, const KN<double> & ob, int free_bdry_guess)/* ob : a vector describing the obstacle function *//* x : the unknown function *//* y : auxiliary function *//* A the matrix of the problem *//* b the right-hand side *//* free_bdry_guess : guess for the position of the free boundary*//* it should come from the previous time step */

{int found =0;int iterations=0;int fbpos= free_bdry_guess;int sense_of_motion=0;int prev_sense_of_motion=0;int not_infinite_loop=l;

/* y contains b-A * ob *//* recall that the constraint b-A*x <= O*//* is to be satisfied *//* so the contact zone is a subset of the region b-A*ob <=0 */y=A*ob;y-=b;y*=-i.;int fst_ineq_threshold=0;while (y(fst_ineq_threshold+l)<0)

fst_ineq_threshold++;/* fst_ineq_threshold is the extremal point of the zone b-A*ob < 0 */while ( ( I found) && abs(fbpos-free_bdry_guess)<150 && iterations <150)

{iterations++;prev_sense_of_motion=sense_of_motion;int matsize=x.size()-fbpos; // we shall solve a Dirichlet problem

// in the zone i>= fbpos

I* fills the matrix and RHS*/KN<double> xaux(matsize);MatriceProfile<double> auxmat(matsize,2);for (int i=0; i<matsize;i++)

{auxmat(i,i)=A(i+fbpos,i+fbpos);xaux(i)=b(i+fbpos);

}auxmat(0,0)=!.;for (int i=0; i<matsize-l;i++)

{auxmat(i,i+1)=A(i+fbpos,i+fbpos+1);auxmat(i+1,i)=A(i+fbpos+1,i+fbpos);

}auxmat(0,1)=0 . ;xaux(0) =ob(fbpos);auxmat.LU();

Page 224: Achdou and Pironneau-Computational Methods Option Pricing

6.5. Solution Procedures 205

auxmat.Solve(xaux,xaux); // solves the system

/*checks if the guess for the free boundary is correct*/

/* if not, proposes a new guess */

found=l;

if (xaux(1)<ob(fbpos+1)) // checks the inequality b>= ob

{fbpOS++;

found=0;

sense_of_motion=l;

}else // check the inequality A*x>= b

{double aux= A(fbpos,fbpos)*ob(fbpos)

+A(fbpos,fbpos-1)*ob(fbpos-1)

+A(fbpos,fbpos+1)*xaux(1) ;

if (aux<b(fbpos))

{found=0;

fbpos--;

sense_of_motion=-1;

}else

if(fbpos-l>fst_ineq_threshold)

{found= 0;

fbpos--;

sense_of_motion=-1;

}

}not_infinite_loop=sense_of_motion*prev_sense_of_motion;

if (not_infinite_loop==-l)

cout «" enters an infinite loop"«endl;

if (found==l) // the guess is correct, saves the solution in the

// vector x

{for (int i=0; i< fbpos;i++)

x(i)=ob(i) ;

for (int i=fbpos; i<ob.size();i++)

x(i)=xaux(i-fbpos);

}

}if (abs(fbpos-free_bdry_guess)<150&&iterations<150)

return fbpos;

else

return -10;

}

Page 225: Achdou and Pironneau-Computational Methods Option Pricing

206 Chapter 6. American Options

6.5.4 A Regularized Active Set Strategy

The algorithm above is not easy to generalize in higher dimensions. For an algorithm basedon active sets and generalizable in any dimension, we have to regularize first the problem.

Following [76], we first go back to the semidiscrete problem: find Pn e 1C such that

For any positive constant c, this is equivalent to finding P" e V and a Lagrange multiplierIJL e V' such that

When using an iterative method for solving (6.54), i.e., when constructing a sequence(Pn'm, nm) for approximating (Pn, ^), the Lagrange multiplier /^m may not be a functionif the derivative of the P"'m jumps, whereas \i is generally a function. Therefore, a dualmethod (i.e., an iterative method for computing n) may be difficult to use. As a remedy,Ito and Kunisch [76] considered a one-parameter family of regularized problems based onsmoothing the equation for \JL by

for 0 < a < 1, which is equivalent to

for x = ca/(l — a) e (0, +00). We may consider a generalized version of (6.56):

where \i is a fixed function. This turns out to be useful when the complementarity conditionis not strict.

It is now possible to study the full regularized problem

and prove that it has a unique solution, with p a square integrable function. A primal-dualactive set algorithm for solving (6.58) is the following.

Page 226: Achdou and Pironneau-Computational Methods Option Pricing

6.5. Solution Procedures 207

ALGORITHM 6.3. Primal-dual active set algorithm.

1. Choose P"'°, set k = 0.

2. Loop

Denoting by An the operator from V to V: (Anv, w} = (^-, u>) + atn(v, w) andF : V x L2(R+) -+V x L2(R+),

it is proved in [76] that G(v, /z) : V x L2(R+) -+ V x L2(R+), defined by

is a generalized derivative of F in the sense that

this is seen from the fact that, for any f e R, the function / : R —*• R, y I-* max(y, 0)admits g as a generalized derivative where

and by taking ft — 0. Note that

Page 227: Achdou and Pironneau-Computational Methods Option Pricing

208 Chapter 6. American Options

Thus the primal-dual active set algorithm above can be seen as a semismooth Newtonmethod applied to F, i.e.,

Indeed, calling (<5P", 6/it) = (P"<*+1 - />»•*, ^k+l - /^), it is straightforward to see that inthe primal-dual active set algorithm, we have

which is precisely (6.61).In [76], Ito and Kunish, by using the results proved in [72], established that the primal-

dual active set algorithm converges from any initial guess, and that if the initial guess issufficiently close to the solution of (6.58), then the convergence is superlinear.

To compute numerically the solution of (6.54), it is possible to compute successivelythe solutions (P"(xd, f^(Xi)) °f (6.58) for a sequence of parameters (/£) converging to+00: to compute (Pn(xi+i), n(xi+i)), one uses the primal-dual active set algorithm withinitial guess (Pn(xi), V<(Xt))-

Notice that it is possible to use the same algorithm for the fully discrete problem.Convergence results hold in the discrete case if there is a discrete maximum principle. Thealgorithm amounts to solving a sequence of systems of linear equations, and the matrix ofthe system varies at each iteration.

Exercise 6.2. Write a program in order to apply the primal-dual active set algorithm to thepricing of an American option (use Ruler's implicit scheme or Crank-Nicolson scheme).Vary the parameter x and compare the active sets as x -> oo.

6.6 Results

6.6.1 Uniform Coefficients

We consider an American put with a = 0.2, r = 0.04, and T = 1. In this case, the priceof the option is an increasing function of the time to maturity, and therefore, the function yintroduced in Lemma 6.3 is decreasing.

We discretize the problem with the method described in §6.4, except that we allowthe mesh in the variable S to vary in time. Doing so, we can adapt the mesh in 5 locally intime: mesh adaption is important in this case, because the solution is always singular (i.e.,not twice differentiable in 5) at the exercise boundary (which is unknown), so the meshshould be refined in this region. The routine for computing the matrix A and the right-handside of the inequalities are similar to those presented in Chapter 5.

The evaluation of the error indicators follows along the same lines as in Chapter 5,except that the indicators are set to 0 inside the region where P = P0. Purposely, we omitthe code for the error indicators.

Page 228: Achdou and Pironneau-Computational Methods Option Pricing

6.7. More Complex American Options 209

In Figure 6.3, we plot the function P — P0 as a function of 5 and t for several meshes.Three successive meshes are plotted in Figure 6.4: we see that the mesh is refined neart — 0 and also on the last mesh at least that the mesh refinement follows the free boundary;this will be more visible in the next test case with a local volatility. In Figure 6.5, we plotthe exercise boundary for several mesh refinements: when the mesh is properly tuned, wesee that we obtain a smooth curve which is tangent to the S axis at t = 0. Finally, we plotin Figure 6.6 the error indicators with respect to S.

6.6.2 Local Volatility

Here, we consider an academic example, chosen to illustrate the power of the adaptivestrategy. We still consider an American put, with strike K = 100. The interest rate is 0.04as above, but the volatility is local and we choose

so the volatility is piecewise constant and takes the value 0.2 in an ellipse and 0.1 outside.With such a choice, the exercise boundary is expected to change slope as it enters and comesout of the region where a = 0.2. Note that this case is not covered by the theory above,because assumption (2.21) does not hold. In Figure 6.7, we plot the volatility surface asa function of S and t. In Figure 6.8, we plot the function P — P0 versus S and t for twodifferent meshes, and the exercise boundary is displayed in Figure 6.9: we see that thefree boundary does change slope when the volatility jumps. We see also that refinementis crucial in order to catch properly the exercise boundary. Note that the function y is notmonotone. In Figure 6.10, two meshes are displayed: we see that the refinement followsthe free boundary. In Figure 6.11, the error indicators with respect to 5 are plotted: hereagain, we see that the error indicators are large near the free boundary, where the functionP is singular.

6.7 More Complex American Options

It is possible to consider American Options on baskets: the price of the option is then foundby solving a parabolic variational inequality in dimension d (where d is the size of thebasket).

Iterative algorithms like projected SOR in §6.5.1 can be used (see [61] for otheriterative algorithms), but their convergence is generally slow. The two algorithms proposedin §6.5.2 and §6.5.3 cannot be applied without modification. The algorithm proposed in§6.5.4 may be applied.

Exercise 6.3. Write a program in order to apply the primal-dual active set algorithm in§6.5.4 to the pricing of an American put option on a basket of two assets (use Euler 's implicitscheme or Crank—Nicolson scheme). Vary the parameter x and compare the active sets asX -> oo.

Designing a very efficient method for American options on baskets is still an interestingopen problem.

Page 229: Achdou and Pironneau-Computational Methods Option Pricing

Figure 6.3. The function P — Pa with the adaptive strategy: the bottom rightfigure is a zoom.

suou

do u

ED

uaiu

y -9

jajd

eip

O

Page 230: Achdou and Pironneau-Computational Methods Option Pricing

Figure 6.4. Four successive mesh refinements: the bottom right figure is a zoomof the more refined mesh near the singularity. I

n

suoj

jdo

uBD

uauj

y X

9|di

ucr)

ajo

yv

'Z'9

Page 231: Achdou and Pironneau-Computational Methods Option Pricing

212 Chapter6. American Options

It is also possible to study American options with stochastic volatility: we referthe reader to [119], where the variational inequality is treated through a penalty method.American options on Levy driven assets have been studied by Matache, Nitsche, and Schwab[93]: for the solution procedure, they used a wavelet basis for which the matrix A" is wellconditioned but then the constraint becomes difficult to handle.

Figure 6.5. The exercise boundaries for different mesh refinements.

Page 232: Achdou and Pironneau-Computational Methods Option Pricing

6.7. More Complex American Options 213

Figure 6.6. Error indicators t]m^: the last figure is a zoom.

Page 233: Achdou and Pironneau-Computational Methods Option Pricing

214 Chapter 6. American Options

Figure 6.7. The local volatility surface.

Page 234: Achdou and Pironneau-Computational Methods Option Pricing

6.7. More Complex American Options 215

Figure 6.8. The function P — P0 with the adaptive strategy.

Page 235: Achdou and Pironneau-Computational Methods Option Pricing

216 Chapter 6. American Options

Figure 6.9. Left: the exercise boundary for the final mesh and the ellipse wherethe volatility jumps: there are two singularities corresponding to the jumps of volatility.Right: the exercise boundaries for different mesh refinements.

Figure 6.10. Two successive mesh refinements: the mesh is refined along theexercise boundary; see Figure 6.9.

Page 236: Achdou and Pironneau-Computational Methods Option Pricing

6.7. More Complex American Options 217

Figure 6.11. Error indicators r\n

Page 237: Achdou and Pironneau-Computational Methods Option Pricing

This page intentionally left blank

Page 238: Achdou and Pironneau-Computational Methods Option Pricing

Chapter 7

Sensitivities and Calibration

7.1 Introduction

It is important in finance to compute the sensitivity of options with respect to parameterssuch as the price of the underlying asset or the volatility. In mathematical terms, dffC, forinstance, can be obtained by differentiating the Black-Scholes equation and its boundaryconditions. Automatic differentiation of a computer code for pricing provides a way to dothat efficiently and automatically.

Equally important is the problem of adjusting the volatility to fit the observations. Itis a difficult task but it can be formulated via least squares as a differentiable optimizationproblem.

Fast algorithms for optimization problems require derivatives of the cost functions,and here again when the number of variables is not too large, automatic differentiation is ofgreat help.

In this chapter we present an introduction to automatic differentiation, an implemen-tation of the forward mode by operator overloading in C++, and two applications: one to thecomputation of Greeks and another to simple calibration when the number of parameters issmall.

This chapter is also an introduction to the last two chapters on calibration; to this enda short presentation of the conjugate gradient algorithm for optimization is given.

7.2 Automatic Differentiation of Computer ProgramsDerivatives of functions defined by their computer implementations can be calculated au-tomatically and exactly. Several techniques are available and we will present only one ofthem—the forward mode [66]. The basic idea is that each line of a computer program can bedifferentiated automatically, except perhaps branching statements, but since there are onlya finite number of them in a computer program, differentiability will be obtained almosteverywhere at worst.

The Forward Mode. Derivatives of a function can be computed from its differential form.This observation is easy to understand from the following example.

219

Page 239: Achdou and Pironneau-Computational Methods Option Pricing

220 Chapter 7. Sensitivities and Calibration

L e t J ( u ) = \u — ud\2; then its differential is

and obviously the derivative of J with respect to u is obtained by putting 8u = 1, 8114 = 0in (7.1):

Now suppose that / is programmed in C/C++ by

double J(double u, double u_d){double z = u-u_d;2 = 2*(u-u_d);return 2;

}

int main(){double u=2,u_d = 0.1;cout « J(u,u_d) « endl;

}

A program which computes J and its differential can be obtained by writing aboveeach differentiable line its differentiated form.

ALGORITHM 7.1. Automatic differentiation.

double JandDJ(double u, double u_d, double du,double du_d, double *pd2)

{ double dz = du - du_d;double 2 = u-u_d;double dJ = dz*(u-u_d) + z*(du - du_d);z = z*(u-u_d);*pdz = dz;return z;

}int mainO

{ double u=2,u_d = 0.1;double dJ;cout « J(u,u_d,1,0,&dJ) « endl;

}

Except for the embarrassing problem of returning both z,dz instead of z, theprocedure is fairly automatic. It can be automatized more systematically by introducinga structured type of differentiable variable to hold the value of the variable and the valueof its derivative,

struct {double va l [2] ;} ddouble;

and rewriting the above as follows.

Page 240: Achdou and Pironneau-Computational Methods Option Pricing

7.2. Automatic Differentiation of Computer Programs 221

ALGORITHM 7.2. AD.

ddouble JandDJ(ddouble u, ddouble u_d)

{ddouble z;z.val[l] = u.val[1]-u_d.val[1];z . v a l t O ] = u .va l [0 ] -u_d .va l [0 ] ;z .val[ l ] = z .va l [1]*(uval [0] -u_d .va l [0] )

+ z .val[0]*{uval[1]-u_d.val[1]) ;z .val[0] = z .va l [0 ]* (uva l [0 ] -u_d .va l [0 ] ) ;return z;

}int main{)

{ddouble u;u .va l [0 ]=2 ; u_d.val[0] = 0.1; u .val[ l ]=l ; u_d.val[l] = 0. ,-ddouble dJ;cout « J(u,u_d) .val [0] «'\t '« J (u,u_d, 1, 0) . val [1] « endl;

]

In C++ the program can be simplified further by redefining the operators =, —, and*. Then a class has to be used instead of a struct as follows.

ALGORITHM 7.3. AD++.class ddouble{ public:

double val[2] ;ddouble(double a, double b=0)

{ v[0] = a; v[l]=b;} // constructorddouble operator=(const ddouble& a)

{val[l] = a.val[l]; val [0] =a.val [0] ;return *this;

}friend dfloat operator - (const dfloat& a, const dfloat& b)

{ dfloat c;c.v[l] = a .v f l ] - b.v[l] ; // (a-b)'=a-'-bf

c .v[0] = a.v[0] - b . v t O ] ;return c;

}friend dfloat operator * (const dfloat& a, const dfloat& b)

{ dfloat c;c.v[l] = a.v[l] *b.v[0] + a . v t O ] * b.v[l] ;

c .v[0] = a .v[0] * b .v[0] ;return c;

}

h

As before a differentiable variable has two data fields: its value and the value of itsderivative. Then we need a constructor to initialize such a variable and also the operator"=" to assign them to another one, so that u=v triggers u.val [1] =v.val [1] andu. val [ 0 ] =v. val [ 0 ]. The operator "—" does the usual minus operation on the value

Page 241: Achdou and Pironneau-Computational Methods Option Pricing

222 Chapter 7. Sensitivities and Calibration

of the variables and also on the value of their differentials. For the product the rule for thedifferentiation of products is used. Finally the function and its calling program are

ddouble JandDJ (ddouble u, ddouble u_d) {

ddouble z= u-u_d

z = z*(u-u_d);return z;

}int main()

{ddouble u(2,l), u_d=0.1;cout « J(u ,u_d) . val [0] «'\t ' « J(u ,u_d, 1, 0) .val [1] « endl;

}

Note that « is an operator which can be redefined also inside the class ddouble.The conclusion is that a C program can be differentiated simply by replacing the

keyword doubl e by ddoubl e.Of course C programs are not only assignments, and it remains to check that branching

statements, loops, function calls, etc., have the same property.Branching statements like

are in fact a compound of two programs:

The method of differentiating each line works for both programs, giving

then we can compound these two programs into

But notice that we cannot account for B' that way, and so the differential may be wrongat the points where B changes from true to false; this does not occur if B does not dependupon the variable with respect to which the differentiation is done.

For loops it is the same; for instance,

means i=0 ; A; i = 1; A; i=2 ; A, which will be differentiated as

which in turn is

Page 242: Achdou and Pironneau-Computational Methods Option Pricing

7.3. Computation of Greeks 223

Finally each function must be redefined; for instance,

ddouble sqrt (const ddouble& x){ ddouble r ;r .val[0] = sq r t (x .va l [0 ] ) ;

r .va lC l ] = 0.5*x.val [1] / (le-30+r.val [0] ) ,-return r; }

The complete implementation of the class ddouble is given in the appendix (§7.7).Notice that +/x is not differentiable at x = 0 and so a program differentiated automat-

ically is never guaranteed to work. However, a test can be added to the function to avoidsuch trouble.

7.3 Computation of Greeks

7.3.1 Greeks for European Options

The sensitivities of an option with respect to the relevant parameters are called the Greeks:let C be the price of a vanilla European call:

• the 8 (delta) is its derivative with respect to the stock price S: 9s C;

• the 0 or time-decay is its derivative with respect to time: 3,C;

• the vega K is its derivative with respect to the volatility a;

• the rho p is its derivative with respect to the interest rate, 3rC;

• rj is its derivative with respect to the strike K',

• finally, the gamma is the rate of change of its delta, d$sC.

Equations can be derived for these directly by differentiating the partial differential equationand the boundary conditions which define C, i.e., when r and a are uniform,

Note that for S and K, a sharp evaluation of the right-hand side 855C can be tricky; automaticdifferentiation provides an approximation consistent with the numerical scheme used for C.For American options, it is not so easy to derive equations for the Greeks.

Instead of writing a new program to solve the above equations, it suffices to useAlgorithm 4.4 written in C/C++ and to change all double or float to ddouble.

Page 243: Achdou and Pironneau-Computational Methods Option Pricing

224 Chapter 7. Sensitivities and Calibration

In the case of dxC, for instance, here is the list of the necessary modifications:

• add the link to the ddouble library (# include" ddouble . hpp");

• change the definition of Real: typedef ddouble Real;

• indicate with respect to which variable the differentiation is done, i.e., replace in themain function, K=80 by K (80 ,1 ) ;

• for graphic display use u [ i ] . val [ 1 ] instead of u [ i ].

Automatic differentiation of computer codes can even be used to compute 8 = dSC, startingfrom a code for pricing the option for S e [0, 5] with a uniform grid in 5, thanks to thefollowing trick: we observe that any function f ( S ) defined for 5 e (0, 5) satisfies theidentity -j^f(XS) = S|£(S) at A = 1. The method then is to scale the array of grid points5, —> A 5, and differentiate with respect to the scaling factor. As the Black-Scholes equationis integrated on (0, 5), and the grid points are uniformly distributed here, 5,? = iS/N + 1,i = 0 , . . . , N + 1, we can differentiate with respect to 5 the solution of the Black-Scholespartial differential equation in (0, S). This gives

Figure 7.1 shows daP, 3^P, d$P, drP obtained by automatic differentiation of Al-gorithm 4.1.

Figure 7.1. Sensitivity of the European put one year to maturity with respect toK, S (vega), S, and r obtained by automatic differentiation of Algorithm 4.4.

Page 244: Achdou and Pironneau-Computational Methods Option Pricing

7.3. Computation of Greeks 225

Figure 7.2. Sensitivity with respect to K\ and K2 obtained by automatic differ-entiation of Algorithm 4.10 for the basket option with payoff Po(Si, S2) = min((/sTi —50+, (K2 - 52)+) computed for Kl = K2 = 100.

Automatic differentiation can be applied to computationally more intensive programs:for example, we have used it for a basket put option with payoff Po(Si, 82) = n\in((Ki —5i)+, (K2 — 52)+). In Figure 7.2, we have plotted the sensitivities with respect to K\ andK2 for KI = K2= 100.

7.3.2 Malliavin Calculus for Greeks

We use the notation of Chapter 1 and consider an option with payoff Q°. We assume thatthe spot price 5, satisfies (1.2) under the risk neutral probability P*.

For clarity denote by ;c the initial value So = x of the stochastic process 5,. To makeexplicit the fact that 5, depends on x, we denote it by St (x). The value of the option at t = 0is P(x) - «-rrE*(fi°(5r)).

Page 245: Achdou and Pironneau-Computational Methods Option Pricing

226 Chapter 7. Sensitivities and Calibration

To compute dx~E* ((?0(Sr (*))), one could use a finite difference approximation in theMonte-Carlo method:

However, this is not precise and sometimes also unstable.A better way to compute 3^E* (Q°(Sr)) comes from the remark that if dxSr(x) had

a meaning, we would have

Note that if the probability density p(Sr, x) of ST is known (see Broadie and Glasser-man [22]), the differentiation with respect to x could be done by an integration by parts:

More generally, the basic idea of Malliavin calculus is to use an integration by partsformula on the space of paths of the stochastic process in order to express the sensitivityof an expectation with respect to some parameter 0 as the expectation of a new randomvariable, which can be computed by the Monte-Carlo method:

For two integrable random variables F and G (see [9]) an integration by parts is said to holdif there exists an integrable random variable H(F;G} such that, for all smooth functions <I>with compact support,

Malliavin calculus provides a way to find the random variable H(Sr; dx ST). Applied to theGreeks it gives (see [53,52])

Figure 7.3 shows the performance of the formula for & and gives a comparison withautomatic differentiation applied to the partial differential equation. The computing time for8 is of the same order as the one for 5,. Automatic differentiation in the partial differentialequation is much faster.

For a generalization to American options, see [10].

Page 246: Achdou and Pironneau-Computational Methods Option Pricing

7.3. Computation of Greeks 227

Figure 7.3. The 8 (derivative with respect to SQ) of a call with a = 0.1, r —0.1, T = 1, K = 100 for SQ e (84, 118). Comparison between stochastic centered finitedifferences, the Malliavin formula, and automatic differentiation in the partial differentialequation. The number of trials for the stochastic processes is 50000 and the number of timesteps is 100.

7.3.3 Greeks for American Options

We end this section on automatic differentiation with an application to American options.By the same trick, i.e., replacing double by ddouble, we can differentiate the programwritten in §6.5.3 and compute the sensitivity of a put with respect to the strike, for instance.The result is shown in Figure 7.4.

Figure 7.4. Sensitivity dP/dK of an American put P with respect to its strike Kas a function of asset price and time to maturity.

Page 247: Achdou and Pironneau-Computational Methods Option Pricing

228 Chapter 7. Sensitivities and Calibration

7.4 An Introduction to the Calibration of Volatility

In practice financial models are not perfect and observed data differ from models predictions.A pragmatic approach to this problem is to relax the models by introducing parameters andcalibrating these parameters with the observations.

The simplest in this line of thoughts is the concept of historical volatility for the stockprice and implied volatility for European vanilla options.

• By observing the price St for various t one can find or, the historical volatility, fromthe stochastic differential equation for St.

• Similarly, if one observes today (/ = 0) the price uj K T(S, 0) of an option with strikeK at maturity T while the underlying asset is worth S0, then one finds which impliedvolatility a in the Black-Scholes analytical formulas (1.17) or (1.18) gives u = uj.

If this is done for several strikes K, in general one does not find the same volatility butrather a volatility surface a (K, T) (called a "smile" because it is usually convex).

Exercise 7.1. Write a C/C++ program to compute the implied volatility. One may use theNewton algorithm and to do so compute the derivative of the Black-Scholes formulas (1.17)or (1.18) with respect to a.

When the Black-Scholes equation with constant coefficients fails to match the ob-served prices, the simplest remedy is to use a local volatility, i.e., a carefully chosen functionof S and /: a = &(S,t). A possible way is to find a among a family of surfaces usuallydefined by a few parameters, which fits the data u^ in the sense of least squares. The problemis of the type

where Ca is the Black-Scholes partial differential operator with local volatility a. Thea)i are suitably chosen nonnegative weights. These parameters are important in practice,because the prices of the options out the money can be very small. A common way to choosethe a>i is to relate them to the vega of the option; see [31].

More precisely (7.3) means that n calls on the same asset with different strikes andmaturities are observed on the market to be worth {«# }" today when the underlying asset isworth 50; then one seeks for the best volatility surface a (a) parameterized by a e A c Mp

to fit the data.

7.4.1 Formulation with Dupire's Equation

A direct solution of (7.3) is possible but each evaluation of the cost function requires nsolutions of the Black-Scholes partial differential equation (2.12). We have seen in Chapter2 that fixing t = 0 and S = S0, the price of a vanilla call with maturity r and strike K,

Page 248: Achdou and Pironneau-Computational Methods Option Pricing

7.4. An Introduction to the Calibration of Volatility 229

u(S0, 0, K, T), as a function of T and K satisfies Dupire's equation:

where q is the dividend of the asset and r is the interest rate of the risk-free asset. If theoptions for all strikes and maturities were on the market, the local volatility would be

It is not the case, so one may try to find a as a minimizer of

In contrast to the previous minimization problem (7.3), the evaluation of the costfunction requires solving only one boundary value problem. The function v is uniquelydefined and the evaluation of the cost function can be written as

and the problem is to minimize J(a) subject to a e A.This problem is usually ill-posed and very unstable; i.e., small variations of J can be

obtained from very large variations of a. A remedy is to add to J aTychonoff regularizationfunctional, which ensures at least that J is coercive, i.e., lima6A,|a|->oo J(a) — +00.

7.4.2 First Numerical Tests

Consider the following volatility soace:

whereao, A, AT, are given constants. We take KI = 75-f50(i/7) andA, = 100; the advantageis that a2(a) is equal to ao for large and small K and never too small or too big in betweenwhen the real and imaginary parts of a, are not too large; to ensure this, we add a penaltyterm to the criteria,

In the following numerical test, a target put option is computed first by solving Dupire' sequation with a nonconstant target volatility surface given by (7.7) with a; = (j — 1 +i7')/100, j = 1, 2, 3,4. There are 5 observation points, at K - 70, 80,90,11, 120 madealternatively at T = 1 and 1.8.

Then the optimization program described below is run starting with a, = 0, i =1,. . . , 4. After a few iterations the cost function is reduced to 10~n and yet there is £

Page 249: Achdou and Pironneau-Computational Methods Option Pricing

230 Chapter 7. Sensitivities and Calibration

Figure 7.5. Results of a calibration with 8 parameters and 5 observations. Left:the volatility surface.

visible difference between the target and the computed volatility surface; see Figure 7.5.The problem is stiff in that in some domain of the parameters a large variation of a makesno noticeable change in u while in other domains it is the opposite (for example, if at someplaces a becomes very small). Note also that the amount of data is too small for practicaluse. The next section explains how the minimization of J was performed.

7.5 Finite-Dimensional Differentiable Optimization

Consider the minimization of the functional J : A c R^ -> R. When J is differentiable,gradient methods are applicable, and when J is twice differentiable, Newton and quasi-Newton methods can be used (see Polak [101], for example). Here, we cover briefly thesteepest descent method and the conjugate gradient method for unconstrained problems.

Consider the unconstrained case, A = R^: if J is lower semicontinuous, boundedfrom below, and coercive, i.e., limx_*oo J ( x ) = +00, then there is at least one solution ofthe minimization problem, and the solution is unique if in addition / is strictly convex.

Furthermore if / is differentiable, the gradient of J satisfies VJ(a*) = Oata solu-tion a*.

7.5.1 Gradient Methods

Gradient methods stem from the fact that at each point a, — V J(a) is a descent direction forJ: indeed, if p > 0 is small enough,

because

The gradient methods construct sequences by the induction relation

where the step size pm > 0 is chosen so that»

Page 250: Achdou and Pironneau-Computational Methods Option Pricing

7.5. Finite-Dimensional Differentiable Optimization 231

One possibility is to take pm constant: pm = p, with p small enough. For convexfunctions with a positive convexity modulus a and with a Lipschitz continuous gradient (withLipschitz constant A), fixed step gradient methods converge (geometrically) if p < p-. Inthe steepest descent method, the step size pm is chosen as the solution of the one-dimensionalminimization of p (->• f ( p ) := J(am — pV J(am}}. In practice, it may not be possible tocompute exactly this minimum, and line search methods are available to compute efficientlyapproximations of the minimum. Later, we discuss one of them—Armijo's rule. It can beproved that for convex functions with a positive convexity modulus a and with a uniformlyLipschitz continuous gradient, the steepest descent method converges linearly (i.e., the errortends to 0 like a geometric progression). However, if the minimum is in a very narrow valley(i.e., for C2 functionals, the Hessian matrix is very ill conditioned near the minimum), thesteepest descent method produces a lot of oscillations which slow down the convergence.The conjugate gradient method (see below) was developed to avoid these oscillations.

7.5.2 The Conjugate Gradient Method

The conjugate gradient method (Hestenes and Stiefel [69]) is a descent method am+l =am + Pmdm where the descent direction dm is a linear combination of VJ(am) and dm~~l:dm = —VJ(am) + ymdm~l and where the step size is the minimum pm of the real variablefunction p h^ f ( p ) := J(am+pdm}: pm = argmin/(/o). For a convex quadratic functionJ, the linear combination dm is chosen in order to minimize J(am + pmdm), and the methodconverges in a finite number of iterations (assuming there are no round-off errors). In thiscase, there are several ways to write the best coefficients ym. These formulas can alsobe used when J is not quadratic, but then they are not equivalent: the three best knownformulas are

• the Fletcher-Reeves formula:

the Polak-Ribiere formula:

the Hestenes-Stiefel formula:

7.5.3 Line Search by Armijo's Rule

In the gradient and conjugate gradient methods, the search for an optimal step size can bereplaced by Armijo's rule.

Let us denote

Page 251: Achdou and Pironneau-Computational Methods Option Pricing

232 Chapter 7. Sensitivities and Calibration

The following will find k such that p = p02k satisfies

Convergence of the gradient and conjugate gradient methods can be shown with sucha step size while preserving their linear and superlinear rate.

Armijo's rule is implemented as follows:

• choose po, set p = p0\

• if (E(p) < P^-\ then while (E(p) < p^-} set p := 2p;

• otherwise while (E(p) > p^lp-) set p := f.

7.5.4 An Implementation in C++

Thus it is possible to write a small program which can solve any differentiable optimizationproblem and for which only the cost function is problem-dependent.

A class is defined to encapsulate the data of a minimization problem as follows.

ALGORITHM 7.4. A class for an unconstrained minimization problem.class Minproblem{ public:

int pmax; // Number of iterationsbool beginning, finishing;int na; // nb of unknownsddouble* a; // array of unknownsdouble rho; // step size

ddouble E(); // cost functionvoid dE(double* grad); // returns the gradientMinproblem (double rhol, int pmaxl, const int nal,

rho(rhol), pmax(pmaxl), na(nal),

{beginning=true; finishing=false;a = new ddouble [nu] ;

};void descent(); // the conjugate gradient algo.double e (double rho, double EO, double* h) ;double armijorule(double rho,double dEO, double alpha, double EO,

double* h) ;

};

Thanks to automatic differentiation the function de is implemented by the followingprogram.

ALGORITHM 7.5. Computation of the gradient by automatic differentiation.void Minproblem::dE(double* grad)

{for (int i =0; i<na,- i++)

{

Page 252: Achdou and Pironneau-Computational Methods Option Pricing

7.5. Finite-Dimensional Differentiable Optimization 233

for( int j =0; j<na; j + + )a [ j ] .val [1] = 0;

a[i] .val [1]=1;grad[i] = E() .val [1] ;

}

J

Armijo's rule is programmed as follows.

ALGORITHM 7.6. Armijo's rule.double Minproblem::armijorule(double rho,double dEO, double alpha, double EO,double* h)

{double El=e(rho, EO, h); int i = 0;if (El < alpha * rho * dEO)

{do rho = 2*rho;while( e(rho, EO, h) < alpha * rho * dEO && i++ < 100);return rho/2;

}else

{do rho = rho/2;while( e(rho, EO, h) > alpha * rho * dEO && i++ < 100);return rho;

}]

The following is Armijo's rule with the auxiliary function.

ALGORITHM 7.7. Auxiliary function for Armijo's rule.double Minproblem::e(double rho, double EO, double* h)

{for(int i = 0; i < nu; i++)

u[i] += rho*h[i] ;double aux = E ( ) . v a l [ 0 ] - EO;for(int i = 0; i < nu; i++)

u[i] -= rho*h[i] ;

return aux;]

Finally the conjugate gradient with Armijo's rule is given below.

ALGORITHM 7.8. Conjugate gradient with Armijo's rule.void Minproblem::descent (){double normg2old = Ie60;for(int i =0; i<nu; i++)h[i]=0;

for(int p = 0; p < pmax; p++)(

Page 253: Achdou and Pironneau-Computational Methods Option Pricing

234 Chapter 7. Sensitivities and Calibration

double EO = E().val[0], normg2 =0;dE () ;

for(int i =0; i<nu; i + +)normg2 += grad[i]*grad[i];

double gam = normg2/normg2old;for(int i =0; i<nu; i + +)

h[i] = -grad[i] + gam*h[i];normg2old = normg2;double dE2 = 0;for(int i =0; i<nu; i++)

dE2 += grad[i] *h[i] ;for(int i =0; i<nu; i++)

u[i] += rho*h[i] ;double El = E().val[0];if(fabs(El-EO)<le-30)

cout«"exit: no variation of Cost"«endl;if(fabs(El-EO)<le-30)

break ,-double rhom = armijorule(rho,dE2,0.3, EO, h) ;for(int i =0; i<nu; i++)

u[i] += rhom*h[i];cout«p«' \t' «EO«' ' «normg2«' \t' «rhom«' \t' «gam«endl;El = E() .val[0] ;if(E1>EO)

cout«El«" cost grows, wrong gradient "«endl;if(normg2<eps*eps)cout« "optimization done\n";

if (E1>EO || normg2<eps*eps)break;

}}

7.6 Application: Calibration on a Basis of Solutions

7.6.1 The Method

In the Black-Scholes model for an option of maturity T and strike AT, the calibration of thevolatility so as to fit observable data is difficult because of stability issues. In the remainingchapters, we will give a general inverse method based on Tychonoff regularizations.

Let us go back to the least squares problem (7.6). From formula (7.5), we see that theknowledge of the pricing function (K, T) H> v(K, r) implies the local volatility: therefore,a possibility is to look for a pricing function which fits the observed prices, then deduce thevolatility. Instead of solving (7.4) by a finite element method, let us look for v in the form

where the u; are linearly independent solutions to Dupire's equation (7.4) with a givenvolatility field aj(K, r) and such that vj(K, 0) = (K — S)+, with the natural conditionsvi (T, 0) = 0, Iimjf^.oo(v7(r, K) — K) = S. Once the nonnegative parameters Oj are foundsuch that the function v fits the observed prices, the local volatility will be given by (7.5).In that context, it seems important to obtain as many analytical solutions vj of Dupire'sequations as possible.

Page 254: Achdou and Pironneau-Computational Methods Option Pricing

7.6. Application: Calibration on a Basis of Solutions 235

For example, assume that the pricing functions u; correspond to constant volatilitiesaj (K, T) = aj for j = 1, . . . , n; then the parametrization (fl/)./=i,...,« H» a is

This approach is very simple and very fast, and all equations are satisfied; however, thestability is ensured only if the basis {<r;-} is cleverly chosen (this is an open problem).

7.6.2 Numerical Results

The numerical procedure of §7.6 was tested with the idea of recovering the target volatility

Several put options on the same underlying asset S on day 0 with strike Kf and maturity7} are observed (their price are udi). We took five different options, which is a very smallnumber. The results of the calibration procedure with n = 5 and n = 20 are given in Figure7.6. This method seems to have a good stability and a fair accuracy. It is clear that forpractical use, more data are necessary.

Figure 7.6. Result of the procedure in §1.6 with parameterization (7.9). Top: 5basis Junctions have been used. Bottom: 20 basis functions have been used (note that thecentering and the zoom are different from above).

Page 255: Achdou and Pironneau-Computational Methods Option Pricing

236 Chapter 7. Sensitivities and Calibration

Project 7.1. Build the program that produced the numerical results above and replacethe optimization module by the BFGS optimization function of the GSL: gsl_multimin_fdfminimizer_vector_bfgs. Then propose some other parameterization for a(such as B-splines) and rerun the calibration.

7.7 Appendix

The complete implementation of the class ddouble is given below. It can also be foundonline at www.ann.jussieu.fr/pironneau.

ALGORITHM 7.9. The ddouble library for automatic differentiation.// file ddouble.h, for automatic differentiation w/r one variable

// adapted from M. Grundmann's MIPADtfifndef _DDOUBLE H_tfdefine _DDOUBLE H_

# include <stdlib.h>^include <math.h>tfinclude <iostream.h>

class ddouble{public: double val[2]; // val [0]=value, val[l]= derivative

ddouble() { val[0] = 0; val[l] =0;}ddouble(const ddoublefc a){ val [0] = a.val[0]; val[l] = a.val[l]; }ddouble(double a, double b=0){ val[0]=a; val[l]=b;}

ddoublefc operator=(double a){ val[0] = a; val[l] = 0.0; return *this,-}

ddouble& operator=(const ddoublefc a){ val[0] = a.valEO]; val[l] = a.valfl]; return *this,-}

doublet operator[] (const int ii) { return this->val[ii] ;}double operator[] (const int ii) const { return this->val[ii] ; }

ddoublefc operator + 0 {return *this,-};ddoublefc operator += (double);ddouble& operator += (const ddouble&);ddouble& operator -= (double );ddouble& operator -= (const ddouble&);ddouble& operator *= (double);ddouble& operator *= (const ddouble&);ddouble& operator /= (double) ;ddouble& operator /= (const ddouble&) ;

ddouble operator++(int);ddouble operator--(int);ddouble& operator++();ddouble& operator--();

friend ostream& operator « (ostream&, const ddouble&);friend ddouble& operator « (ddouble&,double) ;

Page 256: Achdou and Pironneau-Computational Methods Option Pricing

7.7. Appendix 237

friend ddouble parameter(double);

friend int operator != (const ddouble&,const ddoubleSc);friend int operator != (double,const ddouble&);friend int operator != (const ddouble&,double);friend int operator == (const ddouble&,const ddoubleSc);friend int operator == (double,const ddouble&);friend int operator == (const ddouble&,double);friend int operator >= (const ddouble&,const ddouble&);friend int operator >= (double, const ddoubleSc);friend int operator >= (const ddouble&,double);friend int operator <= (const ddouble&,const ddoubleSc);friend int operator <= (double,const ddoubleSc);friend int operator <= (const ddouble&,double);friend int operator > (const ddouble&,const ddoubleSc);friend int operator > (double,const ddoubleSc);friend int operator > (const ddouble&,double);friend int operator < (const ddoubleSc,const ddoubleSc);friend int operator < (double,const ddouble&);friend int operator < (const ddouble&,double);

friend ddouble operator + (const ddoubleSc x) ;friend ddouble operator + (const ddoubleSc, const ddoubleSc) ,-friend ddouble operator + (double, const ddouble&);friend ddouble operator + (const ddoubleSc, double);friend ddouble operator - (const ddoubleSc x ,double y);friend ddouble operator - (const ddoublefc,const ddouble&);friend ddouble operator - (double, const ddouble&);friend ddouble operator - ( const ddouble& );friend ddouble operator * (const ddouble&,const ddouble&);friend ddouble operator * (double, const ddoubleSc ) ;friend ddouble operator * (const ddoubleSc x, double y) ;friend ddouble operator / (const ddoubleSc x, double y) ;friend ddouble operator / (const ddoubleSc, const ddoublefc) ;friend ddouble operator / (double, const ddoubleSc) ;friend ddouble exp (const ddoubleSc) ;friend ddouble log (const ddoubleSc) ;friend ddouble sqrt (const ddoubleSc) ;friend ddouble sin (const ddoubleSc) ;friend ddouble cos (const ddoubleSc) ,-friend ddouble tan (const ddoubleSc) ;friend ddouble pow (const ddoubleSc,double) ;friend ddouble pow (const ddoubleSc,const ddoubleSc);friend ddouble pow (const ddoubleSc, const int) ;friend ddouble abs (const ddoubleSc) ;

};

inline double sign (const ddoubleSc x){ return ( x < 0.0 ? -1.0 : 1.0) ; }

inline double sign (const ddoubleSc x, double y){ return ( x < 0.0 ? -fabs(y) : fabs (y) ); }

// used with f2c

inline ddouble d_abs(ddouble * x){ return abs(*x); }

Page 257: Achdou and Pironneau-Computational Methods Option Pricing

238 Chapter 7. Sensitivities and Calibration

inline ddouble d_cos(ddouble * x){ return cos(*x); }inline ddouble d_sin(ddouble * x){ return sin(*x); }

inline ddouble d_tan(ddouble * x){ return tan(*x); }inline ddouble d_exp(ddouble * x){ return exp(*x); }inline ddouble d_log(ddouble * x){ return log(*x); }

inline ddouble d_sign(ddouble * x){ return sign(*x); }inline ddouble d_sign(ddouble * x,double*y){ return sign(*x,*y); }

inline ddouble d_sqrt(ddouble * x){ return sqrt(*x); }

inline ddouble pow_dd(ddouble * x,ddouble*y) { return pow(*x,*y); }inline ddouble pow_dd(double * x,ddouble*y) { return pow(*x,*y); }inline ddouble pow_dd(ddouble * x,double*y) { return pow(*x,*y); }inline ddouble pow_di(ddouble * x,int*y) { return pow(*x,*y); }

tfendif

ALGORITHM 7.10. The file ddouble.cpp.

// file ddouble.cpp, for AD with one variableftinclude "ddouble.h"

const double eps = l.Oe-50; // avoids NaN in (sqrt(y))'at 0

ostream& operator« (ostream& f, const ddouble& a){ f « "[" « a[0] « ','« a[l] « "]"; return f;}

ddouble ddouble::operator++(int){ ddouble r=(*this); r[0]++; return r;}

ddouble ddouble::operator--(int){ ddouble r=(*this); r[0]--; return r;}

ddouble& ddouble::operator++(){ (*this) [0]++; return *this;}

ddouble& ddouble::operator--(){ (*this) [0]--; return *this;}

ddoublefc ddouble::operator += (double y){ (*this)[0] += y; return *this; }

ddouble operator - (const ddoublefc a){ ddouble r; r[0] = -a[0]; r[l] = -a[l]; return r;}

ddouble& ddouble::operator -= (double y){ (*this)[0]-=y; return *this;}

ddouble& ddouble::operator += (const ddouble& y){ (*this) [0]+=y[0] ; (*this) [l]+=y[l] ; return * this; }

ddouble& ddouble::operator -= (const ddouble& y){ (*this) [0]-=y[0] ; (*this) [1]-=y[l] ; return * this,- }

ddoublefc ddouble::operator *= (double y){ (*this) [0] *=y; (*this) [1] *=y; return *this;}

Page 258: Achdou and Pironneau-Computational Methods Option Pricing

7.7. Appendix 239

ddoublek ddouble::operator *= (const ddoublefc y){ return *this = *this * y;}

ddouble& ddouble::operator /= (const ddouble& y){ return *this = *this / y;}

ddouble& ddouble::operator /= (double y){ const double inv = 1.0 / y;

(*this) [1] *= inv; (*this) [1] *= inv;return *this;

}

int operator != (const ddoublefc u,const ddoublefc v)

{ return u[0] != v[0] ; }

int operator != (double u,const ddouble& v){ return u != v[0];}

int operator != (const ddouble& v,double u){ return v[0] != u; }

int operator == (const ddouble& u,const ddouble& v){ return u[0] == v[0] ; }

int operator == (double u,const ddoublefc v){ return u == v[0];}

int operator == (const ddouble& v,double u){ return'v[0] == u;}

int operator <= (const ddoublek u,const ddouble& v)

{ return u[0] <= v[0];}

int operator <= (double u,const ddouble& v){ return u <= v[0];}

int operator <= (const ddoublefc v,double u){ return v[0] <= u;}

int operator >= (const ddouble& u,const ddouble& v){ return u[0] >= v[0];}

int operator >= (double u,const ddoublefc v){ return u >= v[0];}

int operator >= (const ddoublefc v,double u){ return v[0] >= u;}

int operator > (const ddoublefc u,const ddouble& v){ return u[0] > v[0];}

int operator > (double u,const ddouble& v){ return u > v[0];}

int operator > (const ddoublefc v,double u){ return v[0] > u;}

int operator < (const ddouble& u,const ddouble& v){ return u[0] < v[0];}

int operator < (double u,const ddoublefc v){ return u < v[0];}

int operator < (const ddouble& v,double u){ return v[0] < u;}

ddouble operator + (const ddouble& x, const ddoublefc y){ ddouble r;

r[0] = x[0] + y[0];r[l] = x[l] + y[l]; return r;

}

Page 259: Achdou and Pironneau-Computational Methods Option Pricing

240 Chapter 7. Sensitivities and Calibration

ddouble operator + (double x, const ddouble& y){ ddouble r ( y ) ; r [0] += x; return r;}

ddouble operator + (const ddouble& y, double x){ ddouble r ( y ) ; r [0] += x; return r; }

ddouble operator - (const ddouble& x, const ddoublefc y){ ddouble r; r [0 ] = x [0 ] - y [ 0 ] ; r [ l ] = x[l] - y [ l ] ; return r; }

ddouble operator - (double x, const ddouble& y){ ddouble r; r[l] = - y [ l ] ; r [0] = x - y [ 0 ] ; return r;}

ddouble operator - (const ddoublefc x, double y){ ddouble r ( x ) ; r [0] -= y; return r; }

ddouble operator * (const ddoublefc x, const ddoublefc y){ ddouble r; r[0] = x [ 0 ] * y [ 0 ] ; r [1] =x[0] *y[l] +x [1] *y [0] ; return r; }

ddouble operator * (double x, const ddouble& y){ddouble r; r [0] = x * y [ 0 ] ; r[l] = x * y[ l ] ; return r;}

ddouble operator * ( const ddouble& y, double x){return x * y;}

ddouble operator / (const ddouble& x, const ddoublefc y){ ddouble r; r[0] = x [ 0 ] / y [ 0 ] ; r [1] = (x [1]-x [0] *y[l]/y [0] ) /y [0] / re tu rn r;}

ddouble operator / (double x, const ddouble& y){ ddouble r; r[0] = x /y[0] ; r [1] =-x*y[ l ] /y [0] /y [0] ; return r;}

ddouble operator/(const ddoublefc x, double y){ddouble r; r[0] = x[0] /y ; r [1] =x [1]/y; return r;}

ddouble exp (const ddoublefc x){ ddouble r ;r[0] = exp(x[0] ) ; r[l] = x [1] *r[0] ; return r,-}

ddouble log (const ddoublefc x){ ddouble r ;r[0] = log(x [0] ) ;r [1] = x [1]/x [0] ; return r;}

ddouble sqrt (const ddoublet x){ ddouble r , - r [0] = sqr t (x[0] ) ; r[l] = 0.5*x[1]/(eps+r [0]);return r; }

ddouble sin (const ddoublefc x){ ddouble r; r [0] =sin(x[0] ) ; r [1] =x [1] *cos (x[0] ) ; return r;}

ddouble cos (const ddouble& x){ ddouble r,- r [0] =cos (x [0] ) ; r [1] =-x [1] *sin(x [0] ) ; return r;}

ddouble tan (const ddouble& x){ return (sin(x) / c o s ( x ) ) ; }

ddouble pow (const ddouble& x,double y){return expdog(x) * y) ;}

ddouble pow (const ddoublefc x,const int y){return expdog(x) * (double)y) ;}

Page 260: Achdou and Pironneau-Computational Methods Option Pricing

7.7. Appendix 241

ddouble pow (const ddouble& x,const ddouble& y){return expdog(x) * y) ;}

ddouble abs (const ddouble& x){ ddouble y;if (x[0] >= 0) y=x; else y = -x; return y; }

ALGORITHM 7.11. An example of automatic differentiation.^include "ddouble.h"void main(void)

{ddouble x(0,l);ddouble a (1),b,c;

b = sin(x); c = (a+x) * b ; cout « "the derivative of(l+x)*sin(x) at x=0 is "«c « endl; }

Page 261: Achdou and Pironneau-Computational Methods Option Pricing

This page intentionally left blank

Page 262: Achdou and Pironneau-Computational Methods Option Pricing

Chapter 8

Calibration ofLocal Volatility withEuropean Options

In this chapter, we describe a least squares algorithm to calibrate the local volatility by fittingthe prices of a set of vanilla European calls available on the market. As seen in Chapter 7,using Dupire's equation saves a lot of work for evaluating the least squares functional. Forcomputing the gradient of the cost function with respect to volatility, we propose an optimalcontrol approach involving an adjoint state.

Coleman, Li, and Verma [29], Jackson, Siili, and Howison [77], and Lagnado andOsher [83, 84] use a rather similar method, but they do not rely on Dupire's equation, sothey have to perform as many partial differential solves as observed prices. Also, theirmethod differs in the computation of the gradient of the cost function: Coleman, Li, andVerma use automatic differentiation or finite differences to evaluate the gradient of the costfunctional, and Jackson, Siili, and Howison use finite differences, whereas Lagnado andOsher derive a partial differential equation for the gradient of the option price with respectto a. Let us also mention Andersen and Brotherton-Ratcliffe [6] for another method specialto vanilla options using discrete Green's functions, and Boyle and Thangaraj [17].

We will close the chapter by reviewing a different and attractive method proposedby Avellaneda et al. [7], using dynamic programming. It has the advantage of not relyingon any parametrization of the volatility, and of leading to an unconstrained optimizationproblem, at the cost of solving nonlinear Hamilton-Jacobi-Bellman equations.

Finally, note that other models also need calibration: for example, Cont and Tankov[31] calibrate jump diffusion models.

8.1 The Least Squares Problem

Hereafter, we shall call rj the square of the local volatility. We shall localize Dupire'sequation by picking K and f large enough, and by considering Dupire's equation in therectangle Q = [0, K] x [0, f]. We must impose an artificial boundary condition on K = K,so we take C(K = K, T) = 0 for all T € (0, f]. Calling 50 the spot price, the price

243

Page 263: Achdou and Pironneau-Computational Methods Option Pricing

244 Chapters. Calibration of Local Volatility with European Options

C(K,-c} := C(S0,0, K,r) isa solution to the boundary value problem

Here, 77 is a function of T and K. For simplicity only, we assume that the interest rate andthe dividend yield are constant.

Remark 8.1. Note that the boundary condition C(r, 0) = S0e~qT need not be imposed,because it is implied by the other equations in (8.1).

As in Chapter 2, the notion of weak solution to (8.1) is helpful: denote V = [v eL2((0, K)) : x% € L2((0, #)), v(K) = 0}, and

There exists a unique function C e C°([0, T]; L2((0, £))) n L2(0, T; V) such thatC(0, K) = (S0 - K)+ and for a.e. T € (0, f),

as soon as

• ;/ is bounded;

• rj is bounded from below by a positive constant r;;

• | K |£ | is a bounded function.

Exercise 8.1. Prove that since we work with the localized problem instead of the orig-inal one, the last condition above can be replaced by jfc e L°°((0, f); L2(0, K)) and

II $k HL°°((o,f);L2(0,*)) smal1 enough (compared to j]).

The calibration problem consists in finding rj from the observations of

• the spot price 50 today;

• the prices (c,),e/ of a family of European vanilla calls with different maturities anddifferent strikes (T,-, /iT,),€/.

Page 264: Achdou and Pironneau-Computational Methods Option Pricing

8.2. Which Space for 77 and Which Tychonoff Functional? 245

We can choose, for example, f > max;e/ TJ andK ^> max((^T,-)/€/, 50). We considerthe least squares problem: find 77 e 1-Lh minimizing

where Hh is a suitable closed subset of a possibly infinite-dimensional function space,JR is a suitable Tychonoff regularization functional, and C is the solution to (8.1). Ofcourse, with straightforward modifications, all that follows would carry over to the functionalJ(rf) — Y^iei wi\C(Ki' TJ) ~ ci:I2> where Wj are nonnegative weights.

8.2 Which Space for i) and Which Tychonoff Functional?

The squared volatility rj will eventually belong to a finite-dimensional space (for example,a space made of piecewise polynomial functions), but since the dimension of this spacemay be large (especially if the degrees of the polynomials are low), it is safer to define JRin an infinite-dimensional space Y, in which it is meaningful to impose bounds on rj andits partial derivative with respect to K. Similarly, since K may be very large, it is safer tochoose the functional JR as if K was infinite.

We have seen above that we must impose constraints of the type 77 < 77 < fj and

\Kj^\ < M. On the one hand, the space 7 must be chosen in such a way that theseconstraints define a closed subset of Y for the minimization problem to have a solution.On the other hand, we wish Y to be a Hilbert space, because Hilbertian norms are easy todifferentiate.

Let X be the space

which is a Hilbert space with the norm

We can check the Sobolev-type embedding X c L°°(R+) n C°(R+) with continuous in-jection. This comes from the facts that Hl(I) c C°(I) for any compact interval and thatKrj(K) = J0 K-j$(K)dic — J0 r](ic)dic, and the Cauchy-Schwarz inequality yields that

for all K > 0, \rj(K)\2 < f /0* (k||(/c)|2 + rjV)) die. In fact, from this inequality,we deduce that the embedding X c L°°(R+) is also compact, because it is possible toapproximate a function 77 € X by means of a piecewise constant function 77^ with

• nN(K) = OforK >N;

• rjN(K) = 1 J^ n(K)dK for i + i < K < i + ̂ ±i, 0 < i, ; < AT - 1,

and prove that there exists a positive constant C such that \\rj — TJN ||L°°(R+) < -7^ IMIx-

Page 265: Achdou and Pironneau-Computational Methods Option Pricing

246 Chapter 8. Calibration of Local Volatility with European Options

We denote by Y the space of functions from E+ x (0, f) —> R defined by

which is a Hilbert space with the norm

We have that

with a continuous and compact embedding. Therefore,

• the set n = {rj e Y, 0 < rj < rj < rj, \KjL\ < M} is a closed subset of Y;

• from a bounded sequence (rjn) in Y, one can extract a subsequence (rjn>) that convergesin L°°(R+ x (0, f)) and such that K^- converges in L°°(R+ x (0, f)).

Now, we change the definitions of X and Y by replacing R+ by (0, K) in (8.4), (8.5),(8.6). If the least squares minimization is set in Yh n "H, where Yh is a finite-dimensionalsubspace of Y, a good choice for the Tychonoff regularization functional is of the form

with suitable positive parameters a/, / = 0, . . . , 5.A possible example for Yh C Y is the space of bicubic splines whose control nodes

lie on the nodes of a quadrangular mesh of Q; see [39] for a review on splines, and [77] fora detailed description of splines in calibration.

If the space Yh is not a subspace of Y, then the definition of JR has to be modifiedby using, for example, mesh dependent norms: for example, if Yh is made of piecewisebilinear functions on a quadrangular mesh Th of Q, then |^y is not a function, so it has tobe replaced in each element by some differential quotient involving -j^ on the left and rightadjacent elements.

Remark 8.2. If the space where the minimization is carried out is of very small dimensionwith regular functions which are constant for K large enough, then almost any squarednorm can be used for JR.

Page 266: Achdou and Pironneau-Computational Methods Option Pricing

8.3. Existence of a Minimizer 247

For simplicity, we shall assume hereafter that the least squares minimization is set in*Hh = Y}, n "H, where Yh is a finite-dimensional subspace of Y, and that JR is given by (8.8).

Remark 8.3. It is possible to add to J a squared error between rj and a Junction rj chosen apriori, often from historical considerations. For example, fj could be the result of calibrationon a previous day. Adding such a term prevents the local volatility from varying too muchfrom one day to another.

8.3 Existence of a Minimizer

Lemma 8.1. Let Q = (0, K) x (0, f), with 0 < max(50, £,-) < K < K. Consider twofunctions r/i and n]i in T-ih, call 8rj = r]\ — rj2 and C(r/i) (resp., C(r/2)) the weak solutionsto (8.1) corresponding to rj = n\ (resp., rj = rj2), and 8C = C(rji) — C(rj2). Then, for aconstant c,

Proof. It is possible to prove an analogue to Proposition 2.13, i.e., denoting V = {v e

L2((0, K)): K^- e L2((0, £))}, that the weak solution to (8.1) belongs to C°([0, f]; V),QA

is such that K2d^KC e L2(Q),and l|C07)llLoo((o,f);V) and \\K2dKKC(1l)\\L2(Q) are boundedindependently of 77 for rj e Hh-

The function 8C satisfies

Therefore, PC||Lcc({0!f);L2(0^)) + ||5C||L2((0ff);V) < c||5i/||Loc(C). By using an argumentclose to the proof of Proposition 2.13, it is even possible to prove that ||<$C||LOO((0 ^.y) —c\\^rl\\L°o(Q)- Then (8.9) follows from a Sobolev-type estimate.

Corollary 8.2. The functional J is continuous with respect to the norm || • ||L°°(0-

Proposition 8.3. There exists a minimizer of J + Jr in Hh-

Proof. A minimizing sequence (r]n) is bounded in the norm || • ||y because JR is coercive.It is possible to extract a subsequence (r]n>) which converges in Y/, to 77 e "H^. Therefore,from the continuity of JR and from Corollary 8.2, J(nn>) + JR(r]n>} converges to J(n)+ JR(TI).

Remark 8.4. The conclusions of Proposition 8.3 hold if the minimization is performed inH because T-L is closed and J + JR is lower semicontinuous.

Page 267: Achdou and Pironneau-Computational Methods Option Pricing

248 Chapter 8. Calibration of Local Volatility with European Options

8.4 The Gradient of J

Theorem 8.4. The functional rj K-> J(ri) is Frechet differentiable in ~Hh> and its differentialis

where P(rj) e L2(Q) is the unique function such that, for any v e L2((0, r), V) with3Tv e L2(Q)andK2d2

KKv e L2(Q),

The function P(r]) is called the adjoint state.

Proof. Consider 77 e HH and the variation of J produced by a small admissible variationof 77: Sri. The cost function J varies like

From Lemma 8.1, there exists a constant c such that X^€/ ^(^M */)2 — cP77lli«'(2)- The

variation 8C is a solution to

Of course, the regularity results for C hold for <5C.To express 8J explicitly in terms of Sq, an adjoint state function P is introduced:

consider the adjoint problem

where on the right-hand side the SK,T denote Dirac functions in time and strike, at r andK. The problem (8.14) is a backward parabolic problem in Q with singular data (singular

Page 268: Achdou and Pironneau-Computational Methods Option Pricing

8.5. The Discrete Problem 249

in r and K}. Yet, it is possible to find very weak solutions to (8.14) by considering first theauxiliary boundary value problem

If r] e Hh, (8.15) has a unique weak solution which is piecewise continuous in time withvalues in L2(0, K) and which belongs to L2((0, f), V), where V = [v e L2(0, K); KdKv eL2(0, K)}. The function P = 3jfW is the unique solution in L2(Q) to the followingproblem: find P e L2(g), such that for any u € L2((0, f), V) with 3Tu e L2(Q) and#232^ € L2(0),

which is a very weak solution to (8.14).Then by multiplying (8.14) by 8C and integration on Q, the following is found:

Note that K2 d 2KKC € L2(Q),P e L2(Q),andSrj e L°°(Q), so the previous integral makes

sense. Therefore,

which implies that J is Frechet differentiable, and its differential is given by (8.11).

Proposition 8.5 (necessary optimality conditions). A necessary condition for rj in Hh tobe a minimum of J + JR is that for any n' 6 Hh,

where P(rj) is the solution to (8.12).

8.5 The Discrete ProblemWe introduce a partition of the interval [0, f] into subintervals [tn-i,tn], 1 < n < N, withAfj = ti — ti-i, At = max, A*,-, and we assume that all the maturities r,, i e /, coincidewith some grid node. We also introduce a partition of the interval [0, K] into subintervalsa),- — [/c,_i, K{], 1 < i < Nh + 1, such that 0 = KQ < K\ < • • • < K^h < KA^+I = K. The

Page 269: Achdou and Pironneau-Computational Methods Option Pricing

250 Chapters. Calibration of Local Volatility with European Options

size of the interval o>, is called hj and we set h = max,=i Nt,+\ ht. The mesh Th of [0, K]is the set [u>\, . . . , coNh+i}. We assume that So and the strikes Ki,i € /, coincide with somemesh node.

We use piecewise linear finite elements for the discretization with respect to K: wedefine the discrete space Vh by

where P\ (a)) is the space of linear functions on a).The discrete problem arising from Euler's implicit scheme is as follows:Find (Cn)o<«<# e Vh satisfying

and for all m, 1 < m < N,

where ar is defined in (8.2).Let (tu')i=o,...,Ar» be the nodal basis of Vh, and let M and Am in RW+DxM+D be the

mass and stiff ness matrices defined by M,I; = (w1, wj),A.™j = a,m(w->, wl),0 < /, j < Nh-The matrix Am is tridiagonal and its entries are

Denoting C" = (C"(/c0),..., Cm(KNJ)T, (8.19) is equivalent to

The cost function is now

Note that a variation Sr) of rj produces a variation <5Am of Ar

Page 270: Achdou and Pironneau-Computational Methods Option Pricing

8.6. A Taste of the Program 251

whereas the variation of Cm satisfies <5C° = 0 and

We have

The discrete adioint state (PmWm<w is a solution to P^ = 0. and

where Ar>m is the matrix obtained by transposing Am. Therefore, we have

m=l

From this and from (8.21), it is easy to compute grad(J(n)).

Exercise 8.2. Write down the adjoint problem when a Crank-Nicolson scheme is used forcomputing Cm.

Exercise 8.3. Write down the adjoint problem when a transparent boundary condition isused for Dupire 's equation along with an Euler or Crank—Nicolson scheme.

8.6 A Taste of the ProgramHere, we focus on the code for computing the gradient of the functional J, assuming that(Cm)m=o,...,M has already been computed: the routine is as follows.

Page 271: Achdou and Pironneau-Computational Methods Option Pricing

252 Chapter 8. Calibration of Local Volatility with European Options

ALGORITHM 8.1. Gradient

template <class Vecto, class Tab, class Mat>void dupire_cost<Vecto, Tab,Mat>: :comp_grad_J (const Tab &eta, const Tab &c, Tab & grad)

{for(int t i t=0; t i t<grad.size() ; t i t++)

grad[ti t]=0;for(int j=0;j<p.size();j++)p[j]=0;// constructs the right-hand side for the adjoint backward parabolic

// problem// the observed prices are contained in the array c_ob

for( int i_ob=0;i_ob<c_ob.size() ; i_ob++)p[maturities [i_ob] ] [strikes [i_ob]] +=

2*weights_ [i_ob] * (c [maturities [i_ob] ] [strikes [i__ob] ] -c_ob [i_ob] ) ;// solves the adjoint backward parabolic problem

scheme->backward_loop(eta, p) ;// computes summ(Pm)TSAmUm

scheme->Dif f_loop_CP (c,p,grad, eta) ;

}

The programs for the backward loop for computing the adjoint state and the programfor (8.23) are as follows.

ALGORITHM 8.2. Backward loop: Adjoint problem.

template <class Vecto, class Tab, class Mat>void euler_scheme<Vecto,Tab, Mat>: :backward_loop_iv(const int init_time,const Tab& eta, Tab& y, const Tab &p, const Vecto & ob, const int strike)

// p .- price of the put// y : adjoint state

// ob: obstacle (K-x)_+// strike: the index of the strike in the mesh

{int ti=t.size()-1;dt=t [ti] -t[ti-l] ;

// builds the matrix AT at final timedisc- >Build_Imp_Euler_LHS_Matrix_T(dt, eta [ti] ,LhsmatT) ;

// modifies the adjoint system in the exercise zonefor (int i=0;i<p [ t i ] . s i ze ( ) ; i++)

if (p[ti] [ i ]==ob[i]&& disc->meshpoints () [ i ]<2* disc-xneshpoints() [strike])

{LhsmatT (i, i) = 1. ;if (i< p[ti] .sizeO -1)

LhsmatT (i, i + 1) =0 . ;if ( i>0)LhsmatT(i,i-l)=0;

y[ti] [i]=0;}

// solves for adjoint state at final timegauss(LhsmatT,y [ti] ) ;

// loop on tfor(int tit=t.size()-1;tit>init_time+l;tit--)

Page 272: Achdou and Pironneau-Computational Methods Option Pricing

8.6. A Taste of the Program 253

{dt = t [ t i t -1]- t [ t i t -2] ;

disc->rate()=rate [tit-1] ;// builds the matrix AT

disc->Build_Imp_Euler_LHS_Matrix_T(dt,eta[tit-l],LhsmatT);// modifies the adjoint system in the exercise zone

for (int i = 0 ; i < p [ t i t - 1 ] . s i z e ( ) ; i + + )if (p[t i t- l] [ i ] = = o b [ i ] & & disc->meshpoints () [ i ]<2

* disc->meshpoints()[strike]){

LhsmatT( i , i )=1 . ;if (i< p [tit-1] .sizeO -1)LhsmatT(i,i+1)=0.;

if (i>0)LhsmatT(i,i-1)= 0;

}// Jbuilds the right-hand side of the adjoint problem

for (int i=0; i < y [ 0 ] . s i z e ( ) ; i + + )y [tit-1] [ i ]+=Massmat( i , i )*y[ t i t ] [i];

for (int i=0; i<y [0 ] . s i z e ( ) -1 ; i++)y [tit-1] [ i ]+=Massmat( i , i+l )*y[ t i t ] [i + 1] ;

for (int i=l; i<y[0] . s ize( ) ; i++)y [tit-1] [ i]+=Massmat(i , i -1)*y[t i t ] [i-1] ;

// modifies the right-hand side in the exercise zonefor (int i=0;i<p [tit-1] . s i ze ( ) ; i + +)

if (p [tit-1] [ i ] = = o b [ i ] & & disc->meshpoints () [i] <2*disc->meshpoints() [strike] )

y[tit-l] [ i ]=0 ;// solves for the adjoint state

gauss(LhsmatT,y[ti t-1]);}

y[init_time]=0;

}

It calls the following routine.

ALGORITHM 8.3. Formula (8.23).

template <class Vecto, class Mat>void dupire_fem<Vecto,Mat>::_Diff_LHS_matrix_UP(const double dt,const Vecto& u,const Vecto & p,Vecto & v,const Vecto & eta)

{v=0;int i ;double xx,hp,hn;double a,b,c,d;double e=-0.5*dt;hn=h[0] ;for( 1=1;i<h.size()-1;i++)

{hp=hn ; // diameter of previous elementhn=h[i]; // diameter of current elementxx=x[i]; // current nodea=xx*xx;

Page 273: Achdou and Pironneau-Computational Methods Option Pricing

254 Chapter 8. Calibration of Local Volatility with European Options

b=a/hp;c=a/hn;v[i] +=e* (b+c) *u[i] *p[i] ;v[i] -=e*b*u[i-l] *p[i] ;v[i] -=e*c*u[i + l] *p[i] ;

}hp=hn; // diameter of previous elementhn=h[i] ; // diameter of last elementxx=x[i]; // last nodea=xx*xx;b=a/hp;c=a/hn;v[i] +=e* (b+c)*u[ i ] *p[i] ;v[i] -=e*b*u[i-l]*p[i] ;

]

8.7 Results

We consider a family of calls on the S&P 500 index. The spot price is 590 and the impliedvolatilities for the family of calls are given in Table 8.1.

The volatility is discretized by functions that are the sum of

• a piecewise affine function in the jc-variable which is constant in the regions K < 250and x > 830 and affine in the region 250 < x < 830;

• a bicubic spline in the region 250 < x < 830, —0.1 < T < 5.5, whose value andderivatives vanish on the boundary of this rectangle. The control points of the splineare plotted in Figure 8.1. We see that the control points are not uniformly distributed:the mesh is refined for small times r and at the money region.

In the least squares functional, we have chosen to put a larger weight on the optionswith a strike close to the money region. Table 8.2 contains the relative errors between theactual observed prices (c,),e/ and the prices computed by the algorithm.

The local volatility surface obtained after calibration is plotted in Figure 8.2.

Table 8.1. The implied volatility observed on call options on the S&P 500.

T\f II 0.85 I 0.9 I 0.95 I I I 1.05 I LI I 1.15 I L2 I L3 I L4 I5° II I I I0.175 II 0.19 I 0.168 I 0.133 I 0.113 I 0.102 I 0.097 I 0.120 I 0.142 I 0.169 I (X2~0.425 0.177 0.155 0.138 0.125 0.109 0.103 0.100 0.114 0.130 0.1500.625 0.172 0.157 0.144 0.133 0.118 0.104 0.100 0.101 0.108 0.1240.94 0.171 0.159 0.149 0.137 0.127 0.113 0.106 0.103 0.100 0.110

1 0.171 0.159 0.150 0.138 0.128 0.115 0.107 0.103 0.099 0.1081.5 0.169 0.160 0.151 0.142 0.133 0.124 0.119 0.113 0.107 0.1022 0.169 0.161 0.153 0.145 0.137 0.130 0.126 0.119 0.115 0.1113 0.168 0.161 0.155 0.149 0.143 0.137 0.133 0.128 0.124 0.1234 0.168 0.162 0.157 0.152 0.148 0.143 0.139 0.135 0.130 0.1285 || 0.168 | 0.164 | 0.159 | 0.154 | 0.151 | 0.148 | 0.144 | 0.140 | 0.136 | 0.132

Page 274: Achdou and Pironneau-Computational Methods Option Pricing

8.7. Results 255

Figure 8.1. The grid used for the local volatility.

Table 8.2. The relative error between the observed and computed prices.

T\f- II 0.85 | 0.9

0.1750.4250.6250.94

11.52345

-0.00050360-0.006577-0.005356-0.004170-0.00416-0.00222-0.003215-0.002092-0.001912-0.000979

T\K || 1.1

0.1750.4250.6250.94

11.52345

0.0119657-0.047604-0.027442-0.0007990.0005520.0007110.01359830.0158470.00946480.0026771

-0.00134184-0.011745-0.004013-0.003589-0.00274-0.00124-0.0020360.00063710.0006624-0.001172

1.15

-0.023659-0.0688500.01963970.01109190.027384-0.004200.04616940.02082920.0128830.0072061

0.95

0.00874306-0.022311-0.004495-0.011314-0.01173-0.00422-0.0024880.00099230.00111790.0003663

1.2

0.00352020.0445737-0.0516590.02625970.1138460.0177560.1723740.04445840.01868730.0136582

1

-0.00011394-0.000725-0.0001880.0008474-0.000611.76366e-50.00219650.00364070.00309710.0036968

1.3

-0.411383-0.7220290.4920770.662910.7527140.1907950.12785

0.08866750.03847310.0167708

1.05

0.0009618930.00531180.0007585-0.0054440.002959-0.000260.00642080.00783160.00336060.0035785

1-4-0.975634-0.925981-0.753774-0.1186130.0189570.8965640.08837460.01628670.03221940.0421486

Page 275: Achdou and Pironneau-Computational Methods Option Pricing

256 Chapter 8. Calibration of Local Volatility with European Options

Figure 8.2. Two views of the local volatility surface obtained by calibration.

Page 276: Achdou and Pironneau-Computational Methods Option Pricing

8.8. A Stochastic Control Approach 257

8.8 A Stochastic Control ApproachThe method described below was proposed by Avellaneda et al. [7] and studied in a deeperway by Samperi [108]. It has the advantages of not relying on any parametrization of thevolatility and of leading to an unconstrained optimization problem.

8.8.1 A Minimax Dual Program

Following Avellaneda et al. [7], we assume that the risk neutralized price of the asset is theprocess

where B, is a standard Brownian motion and where r is the interest rate, assumed constanthere. From the observations, we know that

where E'' is the expectation with respect to the measure on path space corresponding to agiven choice of 77,.

Let H be the set of real-valued processes for t € [0, f] that are progressively measur-able with respect to some reference probability system and that satisfy 0 < r] < r]t < fj.

Let 770 be a given value such that Q<T]0<fj. This value is a prior squared volatilitywhich may be fixed from historical considerations. Let H be a smooth and strictly convexreal-valued function defined on R, with minimal value 0 at r]0.

The approach to calibration proposed in [7] consists of finding 77* that solves

subject to the constraints (8.25).Note that E^/J e~rtH(nt)dt) depends on rjt through H(r)t) but also through the

probability measure.

Remark 8.5. It is possible to localize the problem for prices lying in [S_, S]. Then thefunctional in (8.26) should be changed.

Remark 8.6. In [7], the function H is called a pseudoentropy, as a reference to relativeentropies of probability measures.

We define /fo) = -E"(/Qf e^'H^dt), and gt(n) = ̂ (e~^(STi - £,)+).

Assuming that the data (c,),e/ and 50 are such that the problem is solvable, and callingni the cardinal of /, then the problem is equivalent to finding 77* e H that solves

and it is clear that

Page 277: Achdou and Pironneau-Computational Methods Option Pricing

258 Chapter 8. Calibration of Local Volatility with European Options

Denoting U(n) = infM€R», f ( n ) + £\e/ ^(gi(rj) - c,) and V(fi) = &upnen f ( n ) +Y^iei Al'^'(^)' me problem of maximizing U on H is called the primal program, whereasthe problem of minimizing W(yu-) = V(^JL) — ̂ i€l faCi on W is called the dual program.The gap between sup11€-H U(n) and inf MeR"/ W(^) is called the duality gap.

The following lemma can be found in Samperi [108].

Lemma 8.6. Assume that there exists a convex open subset A ofR"' such that

1. for all [M G A, there exists a unique n(/A) e H such that u (u) solves V ( u ) =/(»7(A*)) + E,-€/ /*i& W/*))/

2. the function V is differentiable in A and W(/LI) = (gi( /7(/<0), . . . , gn,(n(^}}}T','

3. the function V is twice differentiable and strictly convex in A.

Assume also that there exists ft* e A such that W (/A*) = (c,),r€/. Then the problem (8.26)has a solution, and the corresponding Lagrange multiplier can be found as a local minimumofW.

Proof. We know that there exists fi* such that VV(u*) = (c,)fe/. This implies on the onehand that VW(u*) = 0, and since A is convex, and W is strictly convex, thanks to item 3,IJL* is the minimum of W on A. On the other hand, from item 2, gi(n(n*)) = c,, i e 7.

Therefore, calling 77* = n(n*), we know that n* satisfies the constraints (8.25). Onthe other hand, it is clear that

but

which implies that f/(r/*) = sup,^ U(n).

In [108], Samperi proves that under some assumptions, the modified value functionV corresponding to the regularized problem

where 0, (5, t) are smooth approximations of (5 — Ki)+8t=Ti with compact support in (5, 5),satisfies assumptions 1, 2, 3 of Lemma 8.6. To our knowledge, the theory for the genuineV is not complete. With this partial justification, the idea is to now to solve the dualprogram—minimize W on R";—rather than the primal one.

Following the theory for stochastic dynamic programming (see [48,49] and §8.8.2 fora formal derivation), even though the regularity assumptions needed by the theory are notsatisfied in the present case, one finds V(^JL) = V(S0,0) by solving the Hamilton-Jacobi-Bellman (HJB) nonlinear partial differential equation:

Page 278: Achdou and Pironneau-Computational Methods Option Pricing

8.8. A Stochastic Control Approach 259

with the Cauchy condition V(-, T) — 0. Here

is the Legendre dual of O; the function <3> is convex, and we have

Furthermore, 77 such that f(rj) + 5Z«e/ faSi(n) — ̂ (/-0 *s given by

\ /

The theory of HJB equations exceeds the scope of the book. The notion of viscositysolution [37, 49] was developed for that purpose.

For the well-posedness, the following lemma is useful.

Lemma 8.7. The function 4> is C1-regular and satisfies 4>(0) — 0, <3>'(0) = rj0, and

where^^-issetto^>'(0)forx = 0. Furthermore, <$> is smooth and strictly convex in the openregion where rj < <&'(x) < 77. There exists x\ < 0 < X2 such that 4>'(jc) = r\ o x < x\,and <J>'(x) = rj -o- x > x2, and <&" jumps at xi andx2.

8.8.2 Formal Derivation of (8.30)

Let us replace the term e~rTi £];e/ /*,- (5T. - Jf,-)+ — /QT e~r V/ (Sv ~ Ki)+8v=ridv in ^-^ (T/)

by J0r e~rv/jiify (Sv, v)dv, where 0, is a smooth function with compact support. The goal is

to compute the function sup^e^ f(rj) + ^GCie/ fa lo e~rv4>i(Sv^ v)dv).The principle of dynamic programming is as follows: Define

where Sv is the process given by (8.24) with St = S and where nv = r}(Sv, v). Let 77* be anoptimal volatility, and denote V(S, t) = ertj(t, S, 77*).

Take the volatility 771 to be

We have that

Page 279: Achdou and Pironneau-Computational Methods Option Pricing

260 Chapter 8. Calibration of Local Volatility with European Options

Bute~rtV(S, 0 > J(t, S, rii)ande-"V(Ss,s) = J(s, Ss, r/*); therefore

But Ito's formula yields that

This is formal, because we do not check the assumptions required by Ito's lemma. Let ussubtract (8.35) from (8.34), divide by 5 — t, and let s tend to r+; this gives, formally,

and equality holds if rjt = rf: we have obtained formally the analogue of (8.30):

8.8.3 Verification

To verify formally why (8.30) and (8.33) lead to the value function, let us assume that weare interested in computing V(/^), the value function of the regularized problem

where </>, are smooth functions of 5 and t.Let V be a smooth enough solution to the HJB equation

Page 280: Achdou and Pironneau-Computational Methods Option Pricing

8.8. A Stochastic Control Approach 261

with the Cauchy condition V(•, f) = 0. From Ito's lemma, we know that

where the inequality stems from the definition (8.31) of O. Integrating with respect to timeand taking the expectation, we obtain that

This proves that V(S0, 0) is greater than V(X). Moreover, this inequality is an equality if r\satisfies H ( n ) = rj^djsV(St, 0 - <D(f djsV(St, 0), and from (8.32) and the fact that Q

is Cl -regular, if and only if rjt — 4>'(-^-9|5 V (5,, ?))• We have proved that if V is a smoothsolution to (8.38), then the value function is V(50, 0) and that the minimum is reached for77, given by rjt = <D'(f d2

ssV(St, t)).

8.8.4 Algorithm

Knowing the function V (S, t), the partial derivative Vt = av/aui is computed by solving thelinear parabolic equation

with the Cauchy condition V, (•, T) = 0.Therefore, it is possible to use a gradient-based algorithm for solving the dual problem,

and when the dual problem is solved, a tentative solution to the primal problem is given by(8.33).

The dual problem is unconstrained. The evaluation of V (/u.) necessitates W, solves ofHJB equations, and VV (u) is computed by solving NI linear parabolic problems.

Page 281: Achdou and Pironneau-Computational Methods Option Pricing

This page intentionally left blank

Page 282: Achdou and Pironneau-Computational Methods Option Pricing

Chapter 9

Calibration ofLocal Volatility withAmerican Options

263

9.1 The Calibration ProblemIn this chapter, we describe a least squares method to calibrate the local volatility a byfitting the prices of a set of vanilla American puts available on the market. In contrast tocalibration with European options, it is not possible to use Dupire's equation here, becauseof the nonlinear character of the American options pricing problem. Therefore, as we shallsee below, calibration with American options necessitates many more computations.

The calibration problem consists in finding 77 = a2 from the observations of

• the spot price 50 today;

• the prices (P,),€/ of a family of American puts with different maturities and differentstrikes (Ti, £",)i€/.

We call T = max,e/ 7}. We consider the following least squares problem: find 77 e T-Lminimizing

where 'H is a suitable closed subset of a possibly infinite-dimensional function space, JR isa suitable Tychonoff regularization functional, and

Page 283: Achdou and Pironneau-Computational Methods Option Pricing

264 Chapter 9. Calibration of Local Volatility with American Options

In [2], the inverse problem is studied and optimality conditions are given for suitablechoices of T-L and JR. Here, we are interested in the discrete counterpart of the previousleast squares problem. As in Chapter 6, we localize the problem (i.e., we consider only5 e (0, S) for S » max(50, max,6/ AT,-)). We introduce a partition of the interval [0, T]into subintervals [tn-i,tn], 1 < n < N, with Af, = f/ — f,-_i , Af = max, Af,-, and apartition of the interval [0, 5] into subintervals o>, = [5,_i, 5,], 1 < i < Nh + 1, such that0 = SQ < Si < • • • < SNh < SNh+i = S. The size of the interval o>, is called hi and we seth = max/^.^A^+i hi. We assume that for any i e /, the maturity 7} coincides with somenode of the time grid, i.e., there exists Nf < N such that tNi = 7). We also assume that forany i e I, the strike K{ is a node of the 5-grid, i.e., there exists K, < Nh such that Ki = SKi.

We introduce the function P0j(S) = (AT,- — S)+. We know from Theorem 6.3 thatthere exists a constant YQ, 0 < yQ < min,e/ AT,, independent of rj in the class of functionssatisfying (9.8) and (9.9) below, such that for all i e /, P, (S, t) coincides with P0,/ (S) in therectangle [0, 2yo] x [0, 7}]. We choose a mesh node 5 smaller than YQ. Let p < min,€/ /c,be the index such that Sp = 5.

With V = [v € L2((0, S)) : 5f| e L2((0, 5)) u(5) = 0}, we introduce Vh as in(6.25), the nodal basis functions (u;')o<i<^» an(^ me closed sets

With this notation, the new calibration problem is as follows:

where 'H is a suitable closed subset of a finite-dimensional function space, JR is a suitableTychonoff regularization functional, and P" is the solution of the following discrete problem:

Find (/y)o<«<jv,., P" € /Cfcil- satisfying

and for all n. 1 < n < Ni.

with a, given by

Many choices are possible for 'H. For example, let Y be a finite-dimensional vectorspace of Cl and piecewise smooth real-valued functions on [0, 5] x [0, T] (Y may be aspace of bicubic spline functions on [0, S] x [0, T]). Then it will be convenient for whatfollows to take

With 0 < ffmin < 1] < T] < TJmax and 0 < Ci-

Page 284: Achdou and Pironneau-Computational Methods Option Pricing

9.2. A Penalized Problem 265

The space Y can also be made of less regular functions such as continuous and piece-wise bilinear functions of S and t on the elements of a Cartesian mesh. In any case, thefunctions of "H must be continuous and satisfy, for fixed constants Nmuin, rjmSK, and C,,,

and

With (9.8) and (9.9), the bilinear form at is continuous on V and we have Garding's in-equality: there exists X > 0 independent of rj for rj satisfying (9.8) and (9.9), such that

The Tychonoff functional JR is chosen as in Chapter 8.

9.2 A Penalized Problem

Orientation. We want to find necessary optimality conditions for the least squares prob-lem (9.3). A straightforward derivation of these conditions does not seem possible. For thisreason, we are going to prove that the solutions P to (9.4), (9.5) can be found as the limitsof the solutions Pe to suitably penalized nonlinear problems, when the penalty parameter€ tends to zero. This result, stated in Proposition 9.1 below, is the discrete counterpartof the result stated in Theorem 6.1. Then, in Proposition 9.2 below, we derive optimalityconditions for a new least squares problem where the state functions P are replaced by P€.Finally, we will pass to the limit in the optimality conditions as e —> 0. The final result isstated in Theorem 9.6 below.

The Penalized Problem. We fix a strike K (assumed to be a mesh point) and a maturityT, we call P0(S) = (K - 5)+, 1C = [v e Vh, v > P0 v = P0 in (0, S)}, and we considerthe following problem:

Find (Pn)o<n<N, P" € 1C satisfying

and for all n, 1 < n < N,

We consider a smooth nonincreasing convex function V satisfying assumptions (6.16) (seeFigure 6.2), and we denote Ve(x} = V(f). We denote Vh = {vh e Vht vh(Sfi = 0 Vi < p]and we define the discrete penalized problem as follows:

Find fP^W.^v. P" e Vi, satisfvine

Page 285: Achdou and Pironneau-Computational Methods Option Pricing

266 Chapter 9. Calibration of Local Volatility with American Options

and for all n, 1 < n < N, P£ - P0 e Vh, and for any v e Vh,

where Q, = Qt n (0, K) and £2, c (0, 5) is the support of u/, so ̂ = f* wi, where wj

is the nodal basis function associated to 5,.In matrix form, (9.14) becomes the following:Find P" e RNh+l such that

where M and A" are the mass and stiffness matrices introduced in §4.3 and where G€ is thenonlinear function in R^*"*"1 such that, with obvious notation, (Ge(P))/ = lp<i<K^Ve(Pi —P0(5,)). The function G€ is obviously monotone, i.e.,

Denoting by X the constant in the Garding's inequality (9.10), we obtain, by using theLipschitz regularity, the monotonicity of VE and a fixed point argument due to Stampacchia,that for A/ < ^-, (9.13), (9.14) has a unique solution.

It is also possible to prove a priori bounds on (P")o<n<N- For this, using the identity

for all v e Vh, and defining e" = P" — P0, we obtain that for any v € Vh,

Taking v = e" in (9.17), using (9.10) and the nonincreasing character of V€, we obtain that

Page 286: Achdou and Pironneau-Computational Methods Option Pricing

9.2. A Penalized Problem 267

since there exists a constant C such that, for any v e V,

rn-lMultiplying (9.18) by Yi"=l (1 — 2AAf,-) and summing the equations on n, we obtai

This proves that maxo<n<Ar Ik" II is bounded uniformly with respect to € (and also withrespect to r\ for r\ satisfying assumptions (9.8) and (9.9)). This implies that (P")o<n<jv isbounded (in any norm since (V/,)N+1 is a finite-dimensional space) uniformly with respectto € (and also to 77). It is also clear that the real numbers Ve(P"(S{) — P0(St)) are boundeduniformly with respect to €.

We aim at proving that the sequence (P")o<n<N converges to (Pn)o<n<N as e -> 0.To do so, we extract a subsequence that converges, and we want to prove that the limit isprecisely (Pn)o<n<N- The main point consists in proving that the limit belongs to ()QN+1.For this, we need to use a discrete maximum principle. As seen in Chapter 3, this amountsto looking for monotonicity properties of the matrix M -f- AfwA". The matrix M + A?nA"

cannot be an M-matrix, since the diffusion coefficient ^|- vanishes at S = 0. However, it isvery reasonable to assume that the block of M + AfwA" associated to the nodes 5, greaterthan a given value is an M-matrix. If S_ > 0 and if the block of M + Afw A" associated tothe nodes 5, greater than 5 is an M-matrix, then we will prove that P" € /C so the propertywill hold at the limit. For a matrix A , we call A^ the block of A corresponding to row andcolumn indices greater than or equal to t.

Assumption 9.1. We assume that S > 0, i.e., p > 0, and that the parameters h and ̂ At

are small enough so that the matrices A" and M/ + AfnA" are tridiagonal irreducible M-matrices for all n, 1 < n < N, and /, p < I < Nh, and for all the functions 77 satisfying(9.8) and (9.9).

Proposition 9.1. Let 77 satisfy (9.8) and (9.9), and choose At < -j, with X given in (9.10).Let Assumption 9.1 be satisfied. The sequence (P")o<n<N given by (9.13), (9.14) convergesto (Pn)o<n<N given by (9.11), (9.12) in (Vh)

N+l as € tends to 0.

Proof. For p < i < Nh let us define IJL" f to be the real number,

It is clear that the numbers /J," i are bounded uniformly with respect to €. From the uniformbounds on P" and //£,., we know that we can find a sequence €k converging to 0 such that

Page 287: Achdou and Pironneau-Computational Methods Option Pricing

268 Chapter 9. Calibration of Local Volatility-with American Options

(p?k)o<n<N converges to (Pn)Q<n<N in VhN+1, and ^ . converges to tf, p < i < Nh,

i < 1 < N,ask tends to oc. It is clear that P° = P0, and that /n" > 0, p < i < Nh. Passingto the limit in (9.21), we obtain that

By using (9.17) and the discrete maximum principle (because Mp -\- AfrtA£ is an M-matrix),it is possible to prove by induction on n that

Passing to the limit, we obtain that

Assume that for some i, p < i < Nh, and for some a > 0, P"(5,) > P0(S{) + a. Then fork large enough, P^(5,-) > P0(S«) + f. This and (9.21) yield that lim^oo ^ , = 0, i.e.,/j,f = 0. We have proved that

Therefore (Pn)0<n<N satisfies (9.22), (9.24), (9.25) and P"(S,) = P0(St) for i < p. Theseproperties are equivalent to (9.12). Since (9.12) has a unique solution, we have proved thatP" = P". The uniqueness of the limit shows that lime^0 P? = Pn- D

Remark 9.1. As proven in [4], the result stated in Proposition 9.1 holds with Assumption9.1 replaced with the following weaker assumption.

Assumption 9.2. Let K' be the integer such that xt> y <£>• K' < i < Nh- We assume thatthe parameters h and ^ Af are small enough so that the matrices A" and M\ + A/n A"are tridiagonal irreducible M-matrices for all n, 1 < n < N, and I, K' < I < Nh, and forall the functions rj satisfying (9.8) and (9.9).

With this assumption, we have P" — P0 > — Ce for a positive constant C.

9.3 Necessary Optimality Conditions

For ease of exposition only, we first simplify problem (9.3) by assuming that only one option(with strike K and maturity 7) is observed; i.e., the family / has only one element. Thesimpler least squares problem reads as follows:

Find r] € U minimizing J(n) + JR(n), J(rf) = \PN(S0) - P\2, where

It is possible to formulate the discrete variational inequality (9.5) as an identity involv-ing Pn and the real numbers /n" = (Pn - Pn~l, w') + AtnaT-tn(P

n, w'), with additional

Page 288: Achdou and Pironneau-Computational Methods Option Pricing

9.3. Necessary Optimality Conditions 269

constraints: P" > P0, $ > 0, and ^(Pn(St) - P0(Sj}) - 0. It is then tempting to use theLagrange machinery for the least squares problem. However, as observed by Bergougniouxand Mignot [ 15] for optimal control of obstacle problems, it is generally not possible to finda necessary optimality condition with as many Lagrange multipliers as there are constraints,because the additional constraints are not qualified and the Lagrange system that one wouldobtain has no solutions. So it is not easy to derive suitable optimality conditions from thevariational inequality itself. Instead, following Ito and Kunish [75] and Hintermiiller [73],it is possible to consider a least squares problem for the penalized version of the inequalityin (9.26):

Find 77 e U minimizing Je(tf + JR(rj), J6(rj) = \P£N(S0) - P\\ where P° = P0.

For 1 < n < N, P? - P0 € Vh, and for any v e Vh,

Proceeding as in Chapter 8, it is possible to find necessary optimality conditions for(9.27). To do so, we introduce the adjoint state (y")i<n<N, y" e Vh, such that for all v e Vh,

The existence and uniqueness of (9.28) are ensured if Af < -^, A. in (9.10). Theexistence of a solution to the least squares problem (9.27) is obtained by the same argumentsas for Proposition 8.3.

We state the necessary optimality condition for (9.27) without any proof.

Proposition 9.2. Let n* be a solution of (9.27), and define P*'n to be the correspondingstate junction and y*'n the adjoint state solution to (9.28) with rj = n*. For all rj e 1-1,denoting 8n = n — n*, we have

Page 289: Achdou and Pironneau-Computational Methods Option Pricing

270 Chapter 9. Calibration of Local Volatility with American Options

which can also be written as

Let (e/),-€N be a sequence of penalty parameters tending to zero, and let 77* be aminimizer of (9.27) with 6 = €,;. Since H is a compact subset of Y, it is possible to extracta subsequence, still denoted £,, such that 77* converges to 77* in H. Arguing exactly as inthe proof of Proposition 9.1, it is possible to prove the following result.

Lemma 9.3. Let Assumption 9.1 or Assumption 9.2 be satisfied. Let (e,) be a sequence ofpenalty parameters converging to 0 and let n* be a minimizer of '(9.27) with € = €f. Let 77*converge to n* in 1-L as i -> oo; then (P*.'n)o<n<N converges to (P*'")o<n<N. P*'n € /C/,,the solution to

where a>, u,) - (^Sff, Sff) + «~r + ̂ <5'0 + 5S?s <5' 0)S jj, 10) + r(u, u;).

Furthermore, for any j, p<j< Nh, /**;". = rK Atn]-^-Vei(P*'n(Sj) - P0(Sj)) converges

to At*'" = (P*-n - P*'"-1, wi) + &tna*j_tn(P*<n, w*).

Proposition 9.4. With the assumptions of Lemma 9.3, let (e,-) fce a sequence of penaltyparameters converging to 0, a/us? /ef n* fee a solution of (9.27) with e = e,. Let n* fee ?/ie/zmi'f 0/77* as / —> oo; f/ien 77* is a solution of (9.26).

Proof. For 77 e H, /e.C?*,) + /R^*,) - ^e,(^) + JR(n) because 77* is a minimizer for(9.27) withe = e,*. But /e,ifo*.) = |P*iJV(50) - P\2 converges to J(n*)' = |P*'N(50) - P|2

from Lemma 9.3, and ^,(77) converges to J(N) from Proposition 9.1. Therefore, from thecontinuity of JR in H, we see that, for all 77 e H,

Let 77* be a solution of (9.26) that can be approached by 77*, a solution of (9.27), withe = €,•. In what follows, we drop the index i in e, in order to alleviate the notation. Theaim is to find optimality conditions satisfied by 77* by passing to the limit in the optimalityconditions obtained for (9.27). For this, the following assumption can be useful.

Assumption 9.3. Let 5 be positive. We assume that the parameters h and . h2^t aresmall enough so that the matrices (A")r and (M/ + AfnA")r are tridiagonal irreducible

Page 290: Achdou and Pironneau-Computational Methods Option Pricing

9.3. Necessary Optimality Conditions 271

M-matrices for all n, 1 < n < N, and /, p < I < TV/,, and for all the functions r\ satisfying(9.8) and (9.9).

Theorem 9.5. Let Assumption 9.1 or Assumption 9.2 be satisfied. Let n* be a solution oj(9.26) that can be obtained as the limit of a sequence (^*)e of solutions of'(9.27). Then there

exist (y*'n)i<n<N> y*'n G Vh, and real numbers a", p < i < Nh, 1 < n < N, satisfying

Vu e Vfc, (y*-N, v) + A^ (fl*(u, y*>N) + (aN', u>) = 2(M*'W(50) - P)u(50),

V u e V i , , (y*'B - y*'"+l, u) + Arn ( a t . (u, y*'B) + <a", u)) = 0, 1 < « < N,

where a" is the linear form on Vh defined by

with

and

such that for any rj € 'H, noting by Srj = rj — n*,

which can also be written as

0 < (DJR(ri*), Srj)

IfP*>N(S0) - P = 0, then y*>n = 0 and a" = Ofor \<n<N.If Assumption 9.3 is verified and P*'N(S0) - P ^ 0, then

Page 291: Achdou and Pironneau-Computational Methods Option Pricing

272 Chapter9. Calibration of Local Volatility with American Options

Proof. We take v = y*'N in the first line of (9.28), and v = y*'" in the second line. Usingthe nonincreasing character of V€, we obtain that

Using (9.19) and the uniform bounds on (P*'n)o<n<N with respect to e and rj e H, we obtainthat (y*'")i<n<N is uniformly bounded with respect to e and r] in H, and furthermore that

where C depends neither on € nor on r\ eH.From (9.28) and the uniform bound on (y*'n)i<n<N, we infer that the real numbers

are all bounded (in absolute value) by a constant independent of 6.Therefore, we can extract a subsequence still called (e) such that P*'n ->• P*'n in V/,,

y*,» _^ y*,n m yh^ an(j an _^ an fQT ^j j^ n, p < j < NH, 1 < » < N, and passing to thelimit in (9.28) (thanks to Lemma 9.3), we obtain (9.32).

Assume that for i < K, P*'H(St) > P0(Si) + £, £ > 0. Fore small enough, P€*'"(5,-) >P0(Si) + | > P0(Si) + €, which implies that aj,- = 0.

We have proved that

or in equivalent manner (9.34). From the fact that a", v*'"^,) > 0 we deduce (9.35).The next thing to do is to study n*'"y*'n(St) as € -» 0:

Page 292: Achdou and Pironneau-Computational Methods Option Pricing

9.3. Necessary Optimality Conditions 273

because Ve(e) = 0. Since Ve is convex, 0 < Ve(P*'n –ªP0) - H(e) < Vf(P*'n –P0)(Pe*'" – PC - €). However, Ve(P*<n - P0) ^ 0 <s> Pe*'" – P0 < e, and on the otherhand P*-n — P0 > —Ce (see the proof of Proposition 9.1 and Remark 9.1). Therefore,|V/(p*,« _ po)(pe*,« _ Po _ 6)| < Ce|V;(P;-n - P0)|. This implies that

where we have used the fact that | Ve \ < 7. Finally, from (9.40) we obtain that

which implies (9.36).Finally, (9.37) is obtained by passing to the limit in (9.29).Assume that P*'*(S0) - P /= 0 and, without limitations, that P*'N(So) - P > 0.

Then for € small enough, P*'N(S0) — P > 0. If Assumption 9.3 is satisfied, then thematrix of the system of linear equations satisfied by (y*'")p<t<Nh is an M-matrix, because—rK V'e > 0. Using the discrete maximum principle, we can prove by induction on N — nthat for all 1 < n < N and for all p < j < Nf,, y*'" > 0, and by passing to the limit thatyTn > 0. P < l < Nh, 1 < n < N. We have proved (9.39). D

Remark 9.2. With the assumptions of Theorem 9.5, and if, at the optimum, we have thestrict complementarity

then the pairs (y*'n, an)i<«<# are defined uniquely by (9.32), (9.34), (9.36). In particular,y*'n e Vh satisfies, for all i, p < i < Nh,

In this case, the whole sequence (y*'n) converges to (y*'n).

Remark 9.3. In the case where the solution P*n" exhibits a free boundary, i.e., there existN real numbers y£, 1 < n < N, such that for all i, 0 < i < Nh, P*'"(5,-) = P0(5I-) <=>Si < Yh>tnen tne la°k of strict complementarity can occur only at (tn, Yh)i<n<N- From thea priori estimates on y*'n, we can even say that if the strict complementarity condition isnot true at (tn, y^)i<w<Ar, then |y*'"(>/^)| < c\fh. Then imposing y*'n(y£) = 0 does notyield a large error on the optimality condition.

Page 293: Achdou and Pironneau-Computational Methods Option Pricing

274 Chapter 9. Calibration of Local Volatility with American Options

Summary on the Optimality Conditions. We go back to problem (9.3). We have provedthe following result.

Theorem 9.6. Let n* be a minimizer of (9.3) which can be found as a limit of a sequencerfe of minimizers for the penalized problem, and let (P*'n ),-e/ be the solutions to (9.4), (9.5)with n — n*. There exist y*'n e Vh and a"j e R, 1 < n < Nir p < j < Nh, i e I, such

that for all v e Vh,

with, for all j, n, p < j < Nh, 1 < n < Af,-,

such that for any n e H, denoting Sr/ = r/ — r]*,

9.4 Differentiability

In [4], the following result is proved.

Proposition 9.7. Let Assumption 9.1 or Assumption 9.2 be satisfied for all rj obeying (9.8)and (9.9). Let r] e 1-L be such that the strict complementarity conditions

are fulfilled for all i 6 I and for all j, p < j < Nh, where P" is the solution to (9.4), (9.5),andtfj = (P/1 – P/1"1, tu') -|- AtnaT-.tn(P?, wj). The functional J is differentiate at n,and for any admissible variation x ofr/,

Page 294: Achdou and Pironneau-Computational Methods Option Pricing

9.5. Algorithm 275

where yf = >'"(??),• e Vh, a"j e R, p < j < Nh, are the solution to, for all v e Vh,

with

Another way of writing (9.46) is

9.5 Algorithm

We describe the simplest possible projected descent method in the space Y, where the descentdirection is computed thanks to the considerations above. The degrees of freedom of afunction x € Y are the values of x at some nodes of a grid and we call them (A£ (X))I<£<L(A^ is the linear form on Y which maps x to its value at a given node). We endow Ywith the basis (A£(X))I<^<L defined by A^(A^) = 8^, and we define the inner product

(/C*=i atA^' !^=i bt^t)y - Z}/=i atbt-

Algorithm.

• Choose r] € %, € > 0 and p > 0, set e = +00.

• While e > € do

1. Compute (Pi)i€i by (9.4), (9.5), by using, for example, one of the algorithmsproposed in §6.5 and J(n) + /afo), J(n) - £*€/ l/f'(So) – £ I2.

2. For all i e 7, compute (yf)!<«<#,., jf € \4 satisfying (9.44).

3. Compute £ € F such that for all x e 7,

(C,X)y

Page 295: Achdou and Pironneau-Computational Methods Option Pricing

276 Chapter 9. Calibration of Local Volatility with American Options

4. Set rj = nH(r] - p(gradJR(rj) + £)), e = \\ij - /y| | , r> = fj, where TTH is theprojection on K.

• end_do

The complete justification of the algorithm above is still an open question because it isnot proved that -gradJ^(r/) — £ is always a descent direction. However, from Proposition9.7 and Remark 9.3, we know that most often £ is exactly gradJ(rj): in this case, thealgorithm coincides with a projected gradient method.

In the numerical tests below, we have used variants of this algorithm (an interior pointalgorithm due to Herskovits [68]—a quasi-Newton algorithm which can handle generalconstraints), which have proved very robust. In particular, we never experienced breakdowncaused by the fact that the direction Õ is not a descent direction.

Parallelism. The algorithm above can be parallelized in a very natural way on a distributedmemory machine with Np processors, because the computations of the pairs (P,, y,), i € /,

Nare independent of each other. We split I in / = U^/* in order to balance the amountof work among the processors, the processor labeled k being responsible for the sums overi e Ik in J(rj) and (9.48). Note that the complexity of the computation of P,, y{ dependson i, so load balancing is not straightforward. The data for TJ and £ are replicated on the Np

processors. The processor labeled k computes its own contribution to J(rj) and to (9.48),i.e., the sums over i e /*, in an independent manner; then communications are needed forassembling the sums over i e I in J(n) and in (9.48).

For programming, we have used C++ with the message passing library mpi.The following is a simple version of the code for computing the adjoint state y,•.

ALGORITHM 9.1. Backward loop for the adjoint problem.

template <class Vecto, class Tab, class Mat>void euler_scheme<Vecto,Tab, Mat>::backward_loop_iv(const int init_time,const Tab& eta, Tab& y, const Tab &p, const Vecto & ob,const int strike)

// p .- price of the put// y : adjoint state

// ob: obstacle (K-x)_+// strike: the index of the strike in the mesh

{int ti=t.size()-1;dt=t[ti]-t[ti-l];

// builds the matrix AT at final timedisc->Build_Imp_Euler_LHS_Matrix_T(dt,eta[ti],LhsmatT);

// modifies the adjoint system in the exercise zonefor (int i=0 ; i<p [ t i ] . s i ze ( ) ; i++)

if (p[ti] [ i ]==ob[i ]&& disc->meshpoints () [i] <2* disc->meshpoints() [strike])

{LhsmatT(i , i )=1. ;if (i< p[ti] .sizeO -1)

LhsmatT(i , i+1)=0.;if ( i>0)

LhsmatT(i,i-l)=0;y[ti] [ i ]=0;

Page 296: Achdou and Pironneau-Computational Methods Option Pricing

9.6. Results 277

}// solves for adjoint state at final time

gauss(LhsmatT,y[ t i ] ) ;

// loop on t

for(int t i t=t .s ize()-1; t i t>ini t_t ime+l; t i t --)

{dt=t [ti t-1]-t[ti t-2] ;

disc->rate()=rate[t i t -1];

// builds the matrix AT

disc->Build_Imp_Euler_LHS_Matrix_T(dt,eta[tit-1],LhsmatT);

// modifies the adjoint system in the exercise zone

for (int i=0 ; i<p [ t i t - 1 ] . s i ze ( ) ; i++)

if (p [tit-1] [ i ] = = o b [ i ] & & disc->meshpoints () [ i ]<2

* disc->meshpoints () [strike])

{LhsmatT( i , i )= l . ;

if (i< p[tit-l] .sizeO-1)LhsmatT(i,i + 1 ) = 0 . ;

if ( i>0 )

LhsmatT(i, i-1)= 0;

}// builds the right-hand side of the adjoint problem

for (int i=0; i<y[0] .size ( ) ; i + + )

y[tit-l] [i]+=Massmat ( i , i )*y[ t i t ] [i] ;

for (int i=0; i<y[0] .size ( ) - 1 ; i + + )

y [tit-1] [ i ]+=Massmat( i , i+l)*y[t i t ] [i+1];

for (int i=l; i<y[0] .size ( ) ; i + + )

y [tit-1] [ i]+=Massmat(i , i - l )*y[t i t ] [i-1];

// modifies the right-hand side in the exercise zone

for (int i=0; i<p[ t i t -1] . s ize( ) ; i++)

if (p [tit-1] [ i ]==ob[ i ]&& disc->meshpoints() [i] <2

*disc->meshpoints() [strike] )

y[tit-l] [ i ]=0;

// solves for the adjoint state

gauss(LhsmatT,y[tit-1]);

}y [init_time]=0;

}

9.6 Results

9.6.1 Testing the Method with a Target Volatility

In order to test the method, we choose a given target squared volatility function rjg, andwe compute the prices of a series of American puts (with ten different maturities and tendifferent strikes) by solving (9.4), (9.5) with rj = rjg. The chosen (squared) volatility surface

Page 297: Achdou and Pironneau-Computational Methods Option Pricing

278 Chapter 9. Calibration of Local Volatility with American Options

is plotted in Figure 9.1. It is the interpolation on a Cartesian grid of the piecewise constantfunction

Figure 9.1. The squared volatility surface to be found by the calibration algorithm.

and 5 and T are given below. We are aware that such a volatility is not realistic. The reasonfor choosing it is that the exercise prices of the options are not monotone functions of time.Note also that the function r)g is piecewise affine, and that 0.03 < r/g < 0.05. The otherparameters of the computation are

• interest rate: 0.06;

• observed price: S0 = 590;

• 5 = 5 x S0;

• the maturities are TI = 0.5i, 1 < i < 10; we set T = 5;

• the strikes are at 0.8550,0.950,0.95S0, 50, 1.05S0, 1.150, 1.250, 1.350, and 1.450;

• the constraints on rj are 0.005 < r\ < 0.1.

By running the calibration program, we aim at recovering the surface plotted in Figure 9.1.

Page 298: Achdou and Pironneau-Computational Methods Option Pricing

9.6. Results 279

Finite Elements with a Uniform Mesh. In the first test, the squared volatility is describedby piecewise bilinear functions (Q\) of S and t, with a uniform 10x10 mesh. The discretespace for rj has dimension 100.

The Tychonoff functional is of the form

where a, b, c, and d are positive functions to be chosen properly. In particular, thesefunctions play an important role in the out-of-money region, where we do not have anyinformation.

The mesh for u is obtained by refining the mesh for 77. It is uniform in the t variableand 25 times finer than the mesh for n. It is nonuniform in the S variable, with a refinementin the money region.

The optimization loop is initialized with a uniform volatility: r] = 0.04. At conver-gence, we obtain the surface plotted in Figure 9.2. We see that the volatility obtained bythe algorithm is very close to the goal. It is interesting to plot the relative error between theobserved prices and the prices computed with the volatility rj at convergence: In Figure 9.3,we see that the relative error does not exceed 10~3 and is more often of the order 10~5. InFigure 9.4, we plot the graphs showing the convergence of the optimization loop: In the toppanel, we see the value of J (n) as a function of the number of iterations, in logarithmic scale.We see that J is reduced by a factor 107. In the bottom panel, the norm of £ -f gradJR(n),with £ given by (9.48), is displayed. We see the typical behavior of the Newton algorithm,with a quadratic rate near convergence. At convergence, £ + gradJR(n) is 0, because theconstraints on 77 are not active.

Figure 9.2. The squared volatility surface obtained by running the calibration program.

Page 299: Achdou and Pironneau-Computational Methods Option Pricing

280 Chapter 9. Calibration of Local Volatility with American Options

Figure 9.3. Relative errors between the observed prices and those obtained withr] found after running the calibration program.

It is also possible to use nonuniform meshes for the volatilities (see [4]). However,with finite elements, the number of unknowns for the volatility grows very rapidly, and thequasi-Newton method becomes rapidly expensive in terms of memory and CPU time.

Bicubic Splines. We run the same test case, but now, the squared volatility is describedby bicubic splines. More precisely, rj is chosen as the sum of

• a piecewise affine function of 5 which takes two constant values in the regions 5 <0.5S0 and S > 1.5S0, and which is linear in the region |5 - 50| < 0.550;

• a bicubic spline in the region |5 - 50| < 0.550, \t - T/2\ < T/2, whose value andderivatives vanish on |5 — 50| = 0.5S0 and on \t — T/2\ = T/2. In this experiment,there are 10 x 10 control points.

Therefore, the number of degrees of freedom for the volatility is 10 x 10 + 2. The opti-mization loop is initialized with a uniform volatility: 77 = 0.04. At convergence, we obtainthe surface plotted in Figure 9.5. We see that the volatility obtained by the algorithm is notas close to the goal as when discretized by finite elements. The reason for that is clearly thatng is piecewise affine and cannot be represented exactly by bicubic splines. Nevertheless,the main qualitative features of the volatility surface are recovered. The accuracy of themethod is best seen when we plot the relative errors between the observed prices and theprices computed with the volatility rj at convergence: In Figure 9.6, we see that the relativeerror does not exceed 5 x 10~3 and is most often smaller than 10~3. In Figure 9.7, we plotthe graphs monitoring the optimization loop: we see that the convergence is much fasterthan with finite elements.

Page 300: Achdou and Pironneau-Computational Methods Option Pricing

9.6. Results 281

Figure 9.4. J(t]) as a function of the number of iterations and the norm oft; +grad//j(77), with £ given by (9.48) as a Junction of the number of iterations.

9.6.2 Results with American Puts on the FTSE 100 Index

In this paragraph, we consider American puts on the FTSE 100 index. The data correspondto June 6, 2001. We thank Jose" Da Fonseca for providing us with the data.

The price of the underlying asset is JCQ = 5890. The American puts correspond to fourdifferent maturities: 0.122, 0.199, 0.295, and 0.55 years. We set T = 0.55. The interestrate r varies with time, so r is replaced by r(t) in (9.6), and this function is known. For

Page 301: Achdou and Pironneau-Computational Methods Option Pricing

282 Chapter 9. Calibration of Local Volatility with American Options

Figure 9.5. The squared volatility surface obtained by running the calibration program.

Figure 9.6. Relative errors between the observed prices and those obtained with77 found after running the calibration program.

these maturities, the prices of the observed options versus strike are plotted in Figure 9.8.The aim is to find the volatility surface from these prices. The volatility is discretized byfunctions that are the sum of

• a piecewise affine function in the 5-variable which is constant in the regions 5 < 1000and 5 > 9000 and affine in the region 1000 < 5 < 9000;

• a bicubic spline in the region 1000 < 5 < 9000, \t - T/2\ < T/2 + 0.1, whosevalue and derivatives vanish on the boundary of this rectangle. The control points ofthe spline are plotted in Figure 9.9, where the time variable is T — t. We see that the

Page 302: Achdou and Pironneau-Computational Methods Option Pricing

9.6. Results 283

Figure 9.7. J(n) as a function of the number of iterations and the norm of t; +grad7/?(^), with £ given by (9.48) as a junction of the number of iterations.

control points are not uniformly distributed: the mesh is refined for small times t andat the money region.

The grid for u is nonuniform with 745 nodes in the S-direction and 210 nodes inthe f-direction. For simplicity, the grid is chosen in such a way that the points (7}, J£,),e/coincide with some grid nodes.

Page 303: Achdou and Pironneau-Computational Methods Option Pricing

284 Chapter 9. Calibration of Local Volatility with American Options

Figure 9.8. The data for the inverse problem: the prices of a family of Americanputs on the FTSE 100 index.

Figure 9.9. The control points of the bicubic splines.

The (squared) volatility obtained at convergence is displayed in Figure 9.10: the sur-face has a smile shape. The relative errors between the observed prices and those computedat convergence are plotted in Figure 9.11, top. They are larger than those observed for thetest problem in §9.6.1. However, we have to realize that the available observed prices arethemselves given with a roundoff error, which is exactly 0.5. In Figure 9.11, bottom, we

Page 304: Achdou and Pironneau-Computational Methods Option Pricing

9.6. Results 285

Figure 9.10. The squared volatility surface obtained by running the calibration program.

have plotted the relative roundoff error on the observed prices. Doing so, we see that therelative errors on the prices at convergence are of the same order as the roundoff error on theobserved prices. Therefore, it is very natural that the optimization program cannot improveon this level of error.

Page 305: Achdou and Pironneau-Computational Methods Option Pricing

286 Chapter 9. Calibration of Local Volatility with American Options

Figure 9.11. Top: relative errors between the observed prices and those obtainedwith rj found after running the calibration program. A curve corresponds to a given maturity.Bottom: relative roundoff error on observed prices. The two errors are of the same order.

Page 306: Achdou and Pironneau-Computational Methods Option Pricing

Bibliography

[1] Milton Abramowitz and Irene A. Stegun, editors. Handbook of Mathematical Func-tions with Formulas, Graphs, and Mathematical Tables. Dover, New York, 1992.

[2] Yves Achdou. An inverse problem for a parabolic variational inequality arising involatility calibration with American options. SIAMJ. Control Optim., 43:1583–1615,2005.

[3] Yves Achdou, Bruno Franchi, and Nicoletta Tchou. A partial differential equationconnected to option pricing with stochastic volatility: Regularity results and dis-cretization. Math. Comp., 74:1291-1322, 2005.

[4] Yves Achdou and Olivier Pironneau. A numerical procedure for the calibration ofAmerican options. To appear inAppl. Math. Finance.

[5] Yves Achdou and Nicoletta Tchou. Variational analysis for the Black and Scholesequation with stochastic volatility. M2ANMath. Model. Numer. Anal, 36:373-395,2002.

[6] L.B.G Andersen and R. Brotherton-Ratcliffe. The equity option volatility smile: Animplicit finite difference approach. J. Comput. Finance, 1:5-32, 1998.

[7] M. Avellaneda, M. Friedman, C. Holmes, and D. Samperi. Calibrating volatilitysurfaces via relative entropy minimization. Appl. Math. Finance, 4:37–64, 1997.

[8] Owe Axelsson. Iterative Solution Methods. Cambridge University Press, New York,1994.

[9] Vlad Bally. An elementary introduction to Malliavin calculus. INRIA ResearchReport, 4718(February), 2003.

[10] Vlad Bally, L. Caramello, and A. Zanette. Pricing and hedging American option byMonte-Carlo methods using a Malliavin calculus approach. INRIA Research Report,4804(April), 2003.

[11] Guy Barles, Julien Burdeau, Marc Romano, and Nicolas Samsoen. Estimation de lafrontiere libre des options amdricaines au voisinage de 1'e'che'ance. C. R. Acad. Sci.Paris Ser. I Math., 316:171–174, 1993.

[12] A. Bensoussan. On the theory of option pricing. ActaAppl. Math., 2:139158–,1984.

287

Page 307: Achdou and Pironneau-Computational Methods Option Pricing

288 Bibliography

[13] Alain Bensoussan and Jacques-Louis Lions. Impulse Control and QuasivariationalInequalities. \JL. Gauthier-Villars, Montrouge, 1984. Translated from the French byJ. M. Cole.

[14] Amal Bergam, Christine Bernardi, and Zoubida Mghazli. A posteriori analysis of thefinite element discretization of a nonlinear parabolic equation. Math. Comput., 74:1097–1116,2005.

[15] Mai'tine Bergounioux and Fulbert Mignot. Optimal control of obstacle problems:Existence of Lagrange multipliers. ESAIM Control Optim. Calc. Var., 5:45-70, 2000.

[16] F. Black and M. Scholes. The pricing of options and corporate liabilities. J. Pol.Econ., 81:637–659, 1973.

[17] Phelim P. Boyle and Draviam Thangaraj. Volatility estimation from observed optionprices. Decis. Econ. Finance, 23:31-52, 2000.

[18] Dietrich Braess. Finite Elements: Theory, Fast Solvers, and Applications in SolidMechanics. Cambridge University Press, Cambridge, 2001. Second Edition.

[19] Michael J. Brennan and Eduardo S. Schwartz. The valuation of the American putoption. J. Finance, 32:449-462, 1977.

[20] S.C. Brenner and R. Scott. The Mathematical Theory of Finite Element Methods.Volume 15 of Texts in Applied Mathematics. Springer-Verlag, New York, 1994.

[21] H. Brezis. Analyse Fonctionnelle, Theorie et Applications. Masson, Paris, 1983.

[22] Mark Broadie and Paul Glasserman. Pricing American-style securities using simu-lation. J. Econom. Dynam. Control, 21:1323-1352, 1997.

[23] Hans-Joachim Bungartz and Michael Griebel. Sparse grids. Acta Numerica, 13:1–123, 2004.

[24] P. Carr and D. Madan. Option valuation using the fast Fourier transform. J. Comput.Finance, 2:61-73, 1998.

[25] Thierry Cazenave and Alain Haraux. An Introduction to Semilinear Evolution Equa-tions. The Clarendon Press, Oxford University Press, New York, 1998. Translatedfrom the 1990 French original by Yvan Martel and revised by the authors.

[26] Terence Chan. Pricing contingent claims on stocks driven by Le'vy processes. Ann.Appl. Probab., 9:504–528, 1999.

[27] P.G Ciarlet. The Finite Element Method for Elliptic Problems. North-Holland,Amsterdam, 1978. Revised Edition: SIAM, Philadelphia, PA, 2002.

[28] P.G Ciarlet. Basic error estimates for elliptic problems. In Handbook of NumericalAnalysis, Vol. II, 17-351. North-Holland, Amsterdam, 1991.

[29] T.F. Coleman, Y. Li, and A. Verma. Reconstructing the unknown local volatilityfunction. J. Comput. Finance, 2:77-102, 1999.

Page 308: Achdou and Pironneau-Computational Methods Option Pricing

Bibliography 289

[30] R. Cont and P. Tankov. Financial Modelling with Jump Processes, Chapman andHall, Boca Raton, FL, 2003.

[31] Rama Cont and Peter Tankov. Nonparametric calibration of jump-diffusion optionpricing models. J. Comput. Finance, 7:1-49, 2004.

[32] Rama Cont and Ekaterina Voltchkova. Finite Difference Methods for Option Pricingin Jump-Diffusion and Exponential Levy Models. Rapport Interne 513, CMAP, EcolePolytechnique, 2003.

[33] Rama Cont and Ekaterina Voltchkova. Integra-differential Equations for OptionPrices in Exponential Levy Models. Rapport Interne 547, CMAP, Ecole Polytech-nique, 2004.

[34] R. Courant. Variational methods for the solution of problems of equilibrium andvibrations. Bull. Amer. Math. Soc., 49:1-23, 1943.

[35] R. Courant, K. Friedrichs, and H. Lewy. On the partial difference equations ofmathematical physics. IBM J. Res. Develop., 11:215-234, 1967.

[36] J.C. Cox and M. Rubinstein. Option Market. Prentice-Hall, Englewood Cliffs, NJ,1985.

[37] Michael G. Crandall, Hitoshi Ishii, and Pierre-Louis Lions. User's guide to viscositysolutions of second order partial differential equations. Bull. Amer. Math. Soc. (N.S.),27:1-67, 1992.

[38] lonut Danaila, Fre'de'ric Hecht, and Olivier Pironneau. Simulation Numerique enC++. Dunod, Paris, 2003.

[39] Carl de Boor. A Practical Guide to Splines. Volume 27 of Applied MathematicalSciences. Springer-Verlag, New York, 2001. Revised Edition.

[40] S. DelPino and O. Pironneau. FreeFemBD. www.ann.jussieu.fr.

[41] B. Dupire. Pricing with a smile. Risk, 7:18-20, 1994.

[42] Ernst Eberlein. Application of generalized hyperbolic LeVy motions to finance. InLevy Processes, 319-336. Birkhauser Boston, Boston, MA, 2001.

[43] Ernst Eberlein and Karsten Prause. The generalized hyperbolic model: Financialderivatives and risk measures. In Mathematical Finance—Bachelier Congress, 2000(Paris), Springer Finance, 245-267. Springer-Verlag, Berlin, 2002.

[44] Ernst Eberlein and Sebastian Raible. Term structure models driven by general Levyprocesses. Math. Finance, 9:31-53, 1999.

[45] Kenneth Eriksson, Don Estep, Peter Hansbo, and Claes Johnson. Introduction tocomputational methods for differential equations. In Theory and Numerics of Or-dinary and Partial Differential Equations (Leicester, 1994), Adv. Numer. Anal., IV,77-122. Oxford University Press, New York, 1995.

Page 309: Achdou and Pironneau-Computational Methods Option Pricing

290 Bibliography

[46] Kenneth Eriksson and Claes Johnson. Adaptive finite element methods for parabolicproblems. I. A linear model problem. SIAM J. Numer. Anal., 28:43–77, 1991.

[47] Kenneth Eriksson and Claes Johnson. Adaptive finite element methods for parabolicproblems. II. Optimal error estimates in L^L-i and L^Loo- SIAM J. Numer. Anal.,32:706–740, 1995.

[48] Wendell H. Fleming and Raymond W. Rishel. Deterministic and Stochastic OptimalControl. Volume 1 of Applications of Mathematics. Springer-Verlag, New York,1975.

[49] Wendell H. Fleming and H. Mete Soner. Controlled Markov Processes and ViscositySolutions. Volume 25 of Applications of Mathematics. Springer-Verlag, New York,1993.

[50] P.A. Forsyth and K.R. Vetzal. Quadratic convergence for valuing American optionsusing a penalty method. SIAM J. Sci. Comput., 23:2095-2122, 2002.

[51] Jean-Pierre Fouque, George Papanicolaou, and K. Ronnie Sircar. Derivatives in Fi-nancial Markets with Stochastic Volatility. Cambridge University Press, Cambridge,2000.

[52] Eric Fournie", Jean-Michel Lasry, Je'rome Lebuchoux, and Pierre-Louis Lions. Appli-cations of Malliavin calculus to Monte-Carlo methods in finance. II. Finance Stock.,5:201-236,2001.

[53] Eric Fournie', Jean-Michel Lasry, Je'rome Lebuchoux, Pierre-Louis Lions, and NizarTouzi. Applications of Malliavin calculus to Monte Carlo methods in finance. FinanceStock., 3:391^12, 1999.

[54] Leopoldo P. Franca, Sergio L. Frey, and Thomas J. R. Hughes. Stabilized finiteelement methods. I. Application to the advective-diffusive model. Comput. MethodsAppl. Meek. Engrg., 95:253-276, 1992.

[55] A. Friedman. Partial Differential Equations of Parabolic Type. Prentice-Hall, En-glewood Cliffs, NJ, 1964.

[56] Avner Friedman. Regularity theorems for variational inequalities in unbounded do-mains and applications to stopping time problems. Arch. Rational Meek. Anal.,52:134–160, 1973.

[57] Avner Friedman. Stochastic games and variational inequalities. Arch. Rational Meek.Anal, 51:321-346, 1973.

[58] K.O. Friedrichs. The identity of weak and strong extensions of differential operators.Trans. Amer. Math. Soc., 55:132-151,1944.

[59] M. Galassi, J. Davies, J. Theiler, B. Gough, G Jungman, M. Booth, and F. Rossi. TheGNU Scientific Library, www.gnu.org/software/gsl.

Page 310: Achdou and Pironneau-Computational Methods Option Pricing

Bibliography 291

[60] Paul Glasserman. Monte Carlo Methods in Financial Engineering. Volume 53 ofApplications of Mathematics. Springer-Verlag, New York, 2004.

[61] Roland Glowinski, Jacques-Louis Lions, and Raymond Tremolieres. NumericalAnalysis of Variational Inequalities. Volume 8 of Studies in Mathematics and ItsApplications. North-Holland, Amsterdam, 1981. Translated from the French.

[62] Gene H. Golub and Charles F. Van Loan. Matrix Computations. The Johns HopkinsUniversity Press, Baltimore, MD, 1989. Second Edition.

[63] M. Griebel. Adaptive sparse grid multilevel methods for elliptic PDEs based on finitedifferences. Computing, 61:151-179, 1998.

[64] M. Griebel and P. Oswald. Tensor-product-type subspace splittings and multileveliterative methods for anisotropic problems. Adv. Comput. Math., 4:171–206, 1995.

[65] M. Griebel, M. Schneider, and C. Zenger. A combination technique for the solutionof sparse grid problems. In Proceedings of the IMACS International Symposium onIterative Methods in Linear Algebra, 263-281, Elsevier, Amsterdam, 1992.

[66] Andreas Griewank. Evaluating Derivatives: Principles and Techniques of Algo-rithmic Differentiation. Volume 19 of Frontiers in Applied Mathematics. SIAM,Philadelphia, PA, 2000.

[67] J. Michael Harrison and Stanley R. Pliska. Martingales and stochastic integrals inthe theory of continuous trading. Stochastic Process. AppL, 11:215–260, 1981.

[68] J. Herskovits. Feasible direction interior-point technique for nonlinear optimization.J. Optim. Theory AppL, 99:121-146, 1998.

[69] Magnus R. Hestenes and Eduard Stiefel. Methods of conjugate gradients for solvinglinear systems. J. Research Nat. Bur. Standards, 49:409-436, 1952.

[70] S. Heston. A closed-form solution for options with stochastic volatility with appli-cation to bond and currency options. Rev. Financial Studies, 6:327-343, 1993.

[71] N. Hilber, A.M. Matache, and C. Schwab. Sparse Wavelets Methods for Option Pric-ing under Stochastic Volatility. Technical report, Seminar for Applied Mathematics,ETH Zurich, 2004.

[72] M. Hintermuller, K. Ito, and K. Kunisch. The primal-dual active set strategy as asemismooth Newton method. SIAM J. Optim., 13:865-888, 2002.

[73] Michael Hintermuller. In verse coefficient problems for variationa! inequalities: Op-timality conditions and numerical realization. M2AN Math. Model. Numer. Anal.,35:129–152,2001.

[74] J.C. Hull and A. White. The pricing of options on assets with stochastic volatilities.J. Finance, 42:281-300, 1987.

Page 311: Achdou and Pironneau-Computational Methods Option Pricing

292 Bibliography

[75] K. Ito and K. Kunisch. Optimal control of elliptic variational inequalities. Appl.Math. Optim., 41:343–364, 2000.

[76] Kazufumi Ito and Karl Kunisch. Semi-smooth Newton methods for variational in-equalities of the first kind. M2AN Math. Model. Numer. Anal., 37:41–62, 2003.

[77] N. Jackson, E. Siili, and S. Howison. Computation of deterministic volatility surfaces.App. Math. Finances, 2:5-32, 1998.

[78] Patrick Jaillet, Damien Lamberton, and Bernard Lapeyre. Variational inequalitiesand the pricing of American options. ActaAppl. Math., 21:263-289, 1990.

[79] I. Karatzas and S. E. Shreve. Brownian Motion and Stochastic Calculus. Springer-Verlag, New York, 1991. Second Edition.

[80] Joseph B. Keller and Dan Givoli. Exact nonreflecting boundary conditions. J.Comput. Phys., 82:172-192, 1989.

[81] C.T. Kelley. Iterative Methods for Linear and Nonlinear Equations. Volume 16 ofFrontiers in Applied Mathematics. SIAM, Philadelphia, PA, 1995.

[82] D. Kinderlehrer and G Stampacchia. An Introduction toVariational Inequalities andTheir Application. Academic Press, New York, 1980.

[83] R. Lagnado and S. Osher. Reconciling differences. Risk, 10:79-83, 1997.

[84] R. Lagnado and S. Osher. A technique for calibrating derivative security pricingmodels: Numerical solutions of an inverse problem. J. Comput. Finance, 1:13-25,1997.

[85] D. Lamberton and B. Lapeyre. Introduction au Calcul Stochastique Applique a laFinance. Ellipses, Paris, 1997.

[86] Damien Lamberton. Critical price for an American option near maturity. In Seminaron Stochastic Analysis, Random Fields and Applications (Ascona, 1993). Volume 36of Progress in Probability, 353-358. Birkhauser, Basel, 1995.

[87] B. Lapeyre and A. Sulem. Simulation of Financial Models: Mathematical Founda-tions and Applications. Cambridge University Press, Cambridge, to appear.

[88] P.D. Lax and R.D. Richtmyer. Survey of the stability of linear finite differenceequations. Comm. Pure Appl. Math., 9:267-293, 1956.

[89] Jacques-Louis Lions. Quelques Methodes de Resolution des Problemes aux Limitesnon Lineaires. Dunod, Paris, 1969.

[90] Jacques-Louis Lions and Enrico Magenes. Problemes aux Limites non Homogeneset Applications, Vols. I and II. Dunod, Paris, 1968.

[91] Yuh-Dauh Lyuu. Financial Engineering and Computation: Principles, Mathematics,Algorithms. Cambridge University Press, Cambridge, 2002.

Page 312: Achdou and Pironneau-Computational Methods Option Pricing

Bibliography 293

[92] D. Madan. Financial modeling with discontinuous price processes. In O.E. Barndorff-Nielsen, T. Mikosh, and S. Resnick, editors, Levy Processes—Theory and Applica-tions. Birkhauser Boston, Boston, MA, 2001.

[93] A.-M. Matache, P.-A. Nitsche, and C. Schwab. Wavelet Galerkin Pricing of AmericanOptions on Levy Driven Assets. 2003. Research Report SAM 2003-06.

[94] A.-M. Matache, C. Schwab, and T.P. Wihler. Fast Numerical Solution of ParabolicIntegra-differential Equations with Applications in Finance. Technical report no.1954, IMA University of Minnesota, Minneapolis, MN, 2004.

[95] A.-M. Matache, T. von Petersdoff, and C. Schwab. Fast deterministic pricing of Levydriven assets. M2AN Math. Model. Numer. Anal, 38:37–72, 2004.

[96] Stephen F. McCormick, editor. Multigrid Methods. Volume 3 of Frontiers in AppliedMathematics. SI AM, Philadelphia, PA, 1987.

[97] Robert C. Merton. Theory of rational option pricing. Bell J. Econom. ManagementSci., 4:141–183, 1973.

[98] A. Pazy. Semigroups of Linear Operators and Applications to Partial DifferentialEquations. Volume 44 of Applied Mathematical Sciences. Springer-Verlag, NewYork, 1983.

[99] HuyenPham. Optimal stopping of controlled jump-diffusion processes: A viscositysolution approach. J. Math. Systems, 8:1-27,1998.

[100] O. Pironneau and F. Hecht. freefem++, www.freefem.org.

[101] Elijah Polak. Optimization: Algorithms and Consistent Approximations. Volume 124of Applied Mathematical Sciences. Springer-Verlag, New York, 1997.

[102] M.H. Protter and H.F. Weinberger. Maximum Principles in Differential Equations.Springer-Verlag, New York, 1984. Corrected reprint of the 1967 original.

[103] P.-A. Raviart and J.-M. Thomas. Introduction a Vanalyse numerique des equationsauxderivees partielles. Masson, Paris, 1983.

[104] A. Revuz and M. Yor. Continuous Martingale Calculus. Springer-Verlag, New York,1990.

[105] Robert D. Richtmyer and K. W. Morton. Difference methods for initial-value prob-lems. Interscience Tracts in Pure and Applied Mathematics, No. 4. John Wiley &Sons, New York, London, Sydney, 1967. Second Edition.

[106] Y. Saad. Iterative Methods for Sparse Linear Systems. PWS Publishing Company,Boston, MA, 1996. Second Edition: SLAM, Philadelphia, PA, 2003.

[107] Y. Saad and M.H. Schultz. GMRES: A generalized minimal residual algorithm forsolving nonsymmetric linear systems. SIAM J. Sci. Statist. Comput., 7:856–869,1986.

Page 313: Achdou and Pironneau-Computational Methods Option Pricing

294 Bibliography

[108] Dominick Samperi. Calibrating a diffusion pricing model with uncertain volatility:Regularization and stability. Math. Finance, 12:71–87, 2002.

[109] Dominik Schotzau and Christoph Schwab, /z/7-discontinuous Galerkin time-steppingfor parabolic problems. C. R. Acad. Sci. Paris Ser. I Math., 333:1121–1126, 2001.

[110] E. Stein and J. Stein. Stock price distributions with stochastic volatility: An analyticapproach. Rev. Financial Studies, 4:727-752, 1991.

[Ill] G Strang and GJ. Fix. An Analysis of the Finite Element Method. Prentice-Hall,Englewood Cliffs, NJ, 1973.

[112] Vidar Thomee. Galerkin Finite Element Methods for Parabolic Problems. Volume 25of Springer Series in Computational Mathematics. Springer-Verlag, Berlin, 1997.

[113] H.A. van der Vorst. Bi-CGSTAB: A fast and smoothly converging variant ofBi-CG for the solution of nonsymmetric linear systems. SIAMJ. Sci. Statist. Comput.,13:631-644, 1992.

[114] T. von Petersdoff and C. Schwab. Numerical solutions of parabolic equations in highdimensions. M2AN Math. Model. Numer. Anal., 38:93-128, 2004.

[115] T. Werder, K. Gerdes, D. Schotzau, and C. Schwab, hp-discontinuous Galerkin timestepping for parabolic problems. Comput. Methods Appl. Mech. Engrg., 190:6685-6708,2001.

[116] Paul Wilmott, Jeff Dewynne, and Sam Howison. Option Pricing. Oxford FinancialPress, Oxford, 1993.

[117] Paul Wilmott, Sam Howison, and Jeff Dewynne. The Mathematics of FinancialDerivatives: A Student Introduction. Cambridge University Press, Cambridge, 1995.

[118] C. Zenger. Sparse grids. In W. Hackbusch, editor, Parallel Algorithms for PartialDifferential Equations. Volume 31 of Notes on Numerical Fluid Mechanics. Vieweg,Braunschweig/Wiesbaden, 1991.

[119] R. Zvan, P.A. Forsyth, and K.R. Vetzal. Penalty methods for American options withstochastic volatility. /. Comput. Appl. Math., 91:199-218, 1998.

Page 314: Achdou and Pironneau-Computational Methods Option Pricing

Index

A posteriori error estimates, 96A posteriori error indicators, 156A priori error estimates, 95Adaptive mesh refinement, 151Adaptive method

for American options, 208for basket options, 172for European options, 165

Adjoint state, 248, 269Algorithm

Brennan and Schwartz, 201front tracking, 201projected SOR, 199SOR, 199

Algorithms for the American puts, 198American options, 185

calibration with, 263Antithetic variate, 13Arbitrage, 2Armijo's rule, 231Asian option, 85Automatic differentiation, 222

Barrier options, 43Barycentric coordinates, 101Basket options, 46, 83, 126, 172Binomial option pricing, 17Binomial tree, 17Black–Scholes

formula, 6Brownian motion, 3

Calibration, 4of jump diffusion models, 243stochastic control approach, 257

with American options, 263with European options, 243

Central limit theorem, 11CFL condition, 63CMGY process, 45, 117Compressed row storage, 137Consistency

definition, 60of the Crank–Nicolson scheme, 70of the Euler explicit scheme, 61of the Euler implicit scheme, 67

Control variate, 13Convergence

definition, 61of the Euler explicit scheme, 64of the Euler implicit scheme, 69of the Euler implicit scheme in the

primitive variables, 80of the finite element method, 95of the finite element method for the

American put, 195Convexity of the European put's price, 38Crank–Nicolson scheme, 69

Diagonal dominant matrix, 72, 199Dividends, 27

discretely paid dividends, 27Drift, 3Dupire's equation, 40

for calibration, 243

Entropy, 257Euler explicit scheme, 58Euler implicit scheme, 66Exercise boundary, 189

discrete, 198

295

Page 315: Achdou and Pironneau-Computational Methods Option Pricing

296 Index

Filtration, 2natural, 2

Finite difference scheme, 57for Asian options, 85for basket options, 83for European options, 81

Finite elementsadaptive, for American options, 208adaptive, for basket options, 172adaptive, for European options, 165adaptivity, 151for American options, 192for basket options, 126for European options, 107for options on Levy driven assets,

114for stochastic volatility models, 133stabilization, 103with variable meshes, 155

Free boundaryfor the American put, 189in the discrete problem for the Amer-

ican put, 198

Garding's inequality, 32–35, 77, 153,187, 193, 194, 196, 198

GNU Scientific library, 7Gradient method, 230Greeks, 223

delta, 223gamma, 223kappa, 223rho, 223time–decay, 223

Hamilton–Jacobi–Bellman equation, 258Hedging, 4High dimensions, 142

Infinitesimal generator, 24Interest rate, 3Ito's formula, 23, 24, 51, 260

multidimensional, 46two–dimensional, 49, 50

Jump diffusion, 44

Lagrange finite elements, 99Least squares inverse problem, 243Line search rules, 232Local volatility, 27, 104, 209Localization, 39Logarithmic prices, 26Levy driven assets, 44, 114LeVy process, 44

M–matrix, 72, 267, 268Martingale, 2Mass lumping, 102, 106Mass matrix, 100Matrix assembly in the finite element

method, 128Maturity, 1Maximum principle, 35, 190

consequences, 37discrete, 72, 267, 268

Monte–Carlo, 8

Nodal basis, 101

Optimality conditionsfor calibration with American op-

tions, 268for calibration with Dupire's equa-

tion, 249Optimization problem

ill–posed, 229stiff, 230unstable, 229

OptionAmerican, 15Asian, 16barrier, 5, 10cash or nothing, 5European call, 1European put, 5exercise the, 1lookback, 17on a basket, 6vanilla, 1

Payoff, 5Penalized problem for the American put,

188

Page 316: Achdou and Pironneau-Computational Methods Option Pricing

Index

discrete, 265Primitive variables (Black-Scholes equa-

tion in the), 76Put-call parity, 5, 38

Random variablenumerical, 8with the GSL, 12

Security, 1Shape functions, 102Smile, 228Sparse tensor product spaces, 142Spot price, 1Stability

by the energy method, 79definition, 60in the finite element method, 156of the Crank-Nicolson scheme, 70of the Euler explicit scheme, 61of the Euler implicit scheme, 68of the Euler scheme for the Ameri-

can puts, 194Stability condition, 63Steepest descent, 231Step size, 230

297

Stiffness matrix, 100Stochastic control, 257Stochastic volatility, 48, 133Stopping time, 2Strike, 1Super-replication principle, 38

Transparent boundary condition, 110Triangulation, 95Tychonoff functional, 245Tychonoff regularization, 229

Underlying asset, 1Upwinding, 71, 85

Variance Gamma process, 45Variance reduction, 12Variational inequality, 186Volatility, 3

historical, 228implied, 228local, 4, 228

Wavelets, 142Weak (or variational) formulation, 31, 96,

186