finite element methods for option pricing

12
Finite Element Methods for Option Pricing Yves Achdou & Olivier Pironneau LJLL, Universit´ e Pierre et Marie Curie, Place Jussieu, Paris F-75005 E-mail: [email protected] Abstract The finite element method is well suited to the numerical solution of the partial differential equations arising in finance because they al- low for a posteriori error estimates and mesh adaptivity. The method will be described on three simple examples and its advantages will be emphasized. Introduction The Finite Element Method (FEM) has been invented by engineers around 1950 for solving the partial differential equations arising in solid mechan- ics; the main idea was to use the principle of virtual work for designing discrete approximations of the boundary value problems. The most popu- lar reference on FEM in solid mechanics is the book of Zienckienwicz [5]. Generalizations to other fields of physics or engineering have been done by applied mathematicians through the concept of variational formulations and weak forms of the partial differential equations (see Ciarlet[6] for ex- ample). In finance, partial differential equations (PDE) or partial integro-differential equations (PIDE) may be used for option pricing. For approximating their solutions, at least four classes of numerical methods can be used: Finite Difference Methods are by far the simplest, except when mesh adaptivity is required in which case it is rather difficult to control the numerical error. Finite Volume Methods are not really natural, because these meth- ods are better suited for hyperbolic PDEs. In finance, they may be useful, for example for Asian options when the PDE becomes close to hyperbolic near maturity. 1

Upload: daniel-fernandez-odogherty

Post on 05-Jan-2016

12 views

Category:

Documents


2 download

DESCRIPTION

Yves Achdou Olivier Pironneau

TRANSCRIPT

Page 1: Finite Element Methods for Option Pricing

Finite Element Methods for Option Pricing

Yves Achdou & Olivier PironneauLJLL, Universite Pierre et Marie Curie, Place Jussieu, Paris F-75005

E-mail: [email protected]

Abstract

The finite element method is well suited to the numerical solutionof the partial differential equations arising in finance because they al-low for a posteriori error estimates and mesh adaptivity. The methodwill be described on three simple examples and its advantages willbe emphasized.

Introduction

The Finite Element Method (FEM) has been invented by engineers around1950 for solving the partial differential equations arising in solid mechan-ics; the main idea was to use the principle of virtual work for designingdiscrete approximations of the boundary value problems. The most popu-lar reference on FEM in solid mechanics is the book of Zienckienwicz [5].Generalizations to other fields of physics or engineering have been done byapplied mathematicians through the concept of variational formulationsand weak forms of the partial differential equations (see Ciarlet[6] for ex-ample).

In finance, partial differential equations (PDE) or partial integro-differentialequations (PIDE) may be used for option pricing. For approximating theirsolutions, at least four classes of numerical methods can be used:

• Finite Difference Methods are by far the simplest, except when meshadaptivity is required in which case it is rather difficult to control thenumerical error.

• Finite Volume Methods are not really natural, because these meth-ods are better suited for hyperbolic PDEs. In finance, they may beuseful, for example for Asian options when the PDE becomes closeto hyperbolic near maturity.

1

Page 2: Finite Element Methods for Option Pricing

• Spectral Methods are Galerkin methods with Fourier series of highdegree polynomials. They are ideal when the coefficients of the PDEare constant, which is rarely the case in financial engineering. For avery efficient adaptation of spectral methods to finance see Oosterleeet al[3].

• Finite Element Methods seem at first glance unnecessarily complexfor finance where a large class of problems are one dimensional inspace. Yet, they are very flexible for mesh adaptivity and the imple-mentation difficulties are only apparent.

1 A Simple Example

Take the simplest case, the Black-Scholes model for a put option with astrike K and a maturity T . The price of the underlying asset is assumedto be a geometric Brownian motion

dSt = St(µdt + σdWt),

and the volatility σ is allowed to depend on St and t. If the volatilityfunction satisfies suitable regularity conditions, the Black-Scholes formulagives the option’s price at time t < T :

Pt = E∗(e−r(T−t)(K − ST )+|Ft), (1)

where E∗(|Ft) stands for the conditional expectation with respect to therisk neutral probability. It can be proved that with σ = σ(St, T − t), thenPT−t = u(ST−t, T − t), where u is the solution of

∂tu− σ2x2

2 ∂xxu− rx∂x + ru = 0, for x > 0, 0 < t ≤ T,u(x, 0) = (K − x)+.

(2)

The variational formulation of (2) consists of finding a continuous functionu defined on the time interval [0, T ] with value in a Hilbert space V (see(4) below) such that

d

dt(u, w) + at(u, w) = 0 for a.a. t ∈ (0, T ),∀w ∈ V, u(x, 0) = (K − x)+,

(3)where

V =

v ∈ L2(R+) : xdv

dx∈ L2(R+)

,

at(u, w) =(

σ2x2

2∂xu, ∂xw

)+(x∂xu, (σ2 + xσ∂xσ − r)w

)+ (ru, w),

(u, w) =∫ ∞

0

u(x)w(x)dx.

(4)

2

Page 3: Finite Element Methods for Option Pricing

Problem (3) is obtained by multiplying (2) by w(x), integrate on R+ andintegrate by part the term containing ∂xxu. The precise meaning of (3) andthe conditions for (3) to have a unique solution are subtle. The choice ofthe space V is dictated by the following: the integrals in equation (3) mustexist, and the bilinear form at must be continuous on V × V uniformlyin time and satisfy Garding’s coercivity inequality, i.e. that there existconstants c and λ, c > 0 and λ ≥ 0 such that

at(v, v) ≥ c‖v‖2V − λ‖v‖2L2(R+) ∀v ∈ V.

Proposition 1.1 If σ is a continuous function such that for all x, t, σ(x, t) ∈[σm, σM ], σm > 0, and if x 7→ xσ is Lipschitz continuous with a Lispschitzconstant independent of t, then (3) has a unique solution.

The simplest finite element methods are discrete versions of (3) obtainedby replacing V with a finite dimensional space Vh, i.e. finding a continu-ous function uh defined on the time interval [0, T ] with value in the finitedimensional space Vh ⊂ V such that

d

dt(uh, wh) + at(uh, wh) = 0 for a.a. t ∈ (0, T ) (5)

If wiN1 is a basis of Vh then (5) is equivalent to

d

dt

(N∑1

ujwj , wi

)+ at

(N∑1

ujwj , wi

)= 0 ∀i = 1, . . . , N, (6)

which is a system of differential equations

BdU

dt+ A(t)U = 0, where Bij = (wj , wi), Aij(t) = at(wj , wi). (7)

A discrete time stepping scheme has still to be applied to (7), for instancethe Euler implicit scheme

BUm+1 − Um

δtm+ Am+1Um+1 = 0, (8)

where Am = A(tm). The easiest choice is to take Vh as a space of piecewiselinear functions, (linear finite elements), i.e.

Vh = vh continuous, linear on each subinterval [xi−1, xi], vh(L) = 0

where (xi)i=1,...,N is an increasing sequence in the interval [0, L] ≈ R+,with x1 = 0 and xN = L. Then a good choice for wi is to be the (hat)

3

Page 4: Finite Element Methods for Option Pricing

function of Vh which is equal to one at xi and zero at xj , j 6= i (see [1]).With this basis, called the nodal basis, the integrals Bij and Aij can becomputed exactly, up to quadrature errors due to σ if it is not piecewisepolynomial.It is easy to show that the matrices A and B are tridiagonal so that aresolution of the linear system (8) at each time step is best done with aGaussian elimination method or a LU factorization. In the end the com-putational complexity is the same as for a finite difference method witheither an explicit or an implicit time scheme.

Convergence in the V -norm can be proved to be of the order of h + δt(h2 + δt in the L2-norm); it is possible to improve it by using Crank-Nicolson scheme and higher order polynomials instead of the linear ones.Most interesting is the following a posteriori estimate:

Proposition 1.2

[[u− uh,δt]](tn) ≤ c(u0)δt

+cµ

σ2m

0@ nXm=1

ηm2 + (1 + ρ)2 max(2, 1 + ρ)

nXm=1

δtm

σ2m

m−1Yi=1

(1− 2λδti)X

ω∈Tmh

ηm,ω2

1A 12

where µ is the continuity constant of at, ρ = max2≤n≤Nδtn

δtn−1, Tmh is the

partition of (0, L) in small intervals ω at time tm and

η2m = δtme−2λtm−1

σ2m

2|um

h − um−1h |2V ,

ηm,ω =hω

xmax(ω)

∥∥∥∥umh − um−1

h

δtm− rx

∂umh

∂x+ rum

h

∥∥∥∥L2(ω)

,

and hω is the diameter of ω.

Note that everything is known after the computation of uh; the mesh canthen be adapted by using the error indicators ηm and ηm,ω. Figure 1 showsthe computed a posteriori error and the actual error for a vanilla put withconstant volatility and comparison with the Black-Scholes analytic formula.

2 Stochastic Volatility Models

We now discuss a more involved stochastic volatility model where dSt =St(µdt + σtdWt), with σt = f(Yt) and Yt is a mean-reverting Onrstein-Uhlenbeck process

dYt = α(m− Yt)dt + βdZt

4

Page 5: Finite Element Methods for Option Pricing

0 50

100 150

200 250

300 0

0.1

0.2

0.3

0.4

0.5

-0.25

-0.2

-0.15

-0.1

-0.05

0

0.05

"u.txt" using 1:2:5

0 50

100 150

200 250

300 0

0.1

0.2

0.3

0.4

0.5

0 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008

"u.txt" using 1:2:6

0 50

100 150

200 250

300 0

0.1

0.2

0.3

0.4

0.5

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8

"u.txt" using 1:2:7

Figure 1: The first graph displays the error between the computed solutionon a uniform mesh and one computed with Black-Scholes formula. Thesecond graph show ρδt; the third graphs shows ηn,ω as a function of x andt. The parameters are : K = 100, T = 0.5, r = 0, σ = 0.3, 50 time stepsand 100 mesh points.

and Zt = ρWt +√

1− ρ2Zt, Wt and Zt are two uncorrelated Brownianmotions. In the Stein-Stein model, see [4], f(Yt) = |Yt|.If P (S, y, T − t) is the pricing function of a put option, it is convenient tointroduce

u(S, y, t) = P (S, y, T − t)e−(1−η)(y−m)2

2ν2 , (9)

where η is any parameter between 0 and 1 and ν2 = β2/(2α).A clever financial argument (see [2]) shows that when ρ = 0 for simplicity,the new unknown u satisfies, for all x > 0, y ∈ R, t > 0

∂u

∂t− 1

2y2x2 ∂2u

∂x2− 1

2β2 ∂2u

∂y2− rx

∂u

∂x+ e

∂u

∂y+ fu = 0,

u(x, y, 0) = (K − x)+, for x > 0, y ∈ R,(10)

wheref

e = −(1− 2η)α(y −m) + βγ

f = r + 2α2

β2 η(1− η)(y −m)2 + 2(1− η)αβ (y −m)γ − α(1− η)

(11)

and γ is a risk premium factor, possibly a function of x, y, t, see [7] for thedetails.This parabolic equation is degenerate near the axis y = 0 because thecoefficient in front of x2 ∂2P

∂x2 vanishes on y = 0. Following [7], see also[1, 8], let us consider the weighted Sobolev space V on Q = R+ × R):

V =

v : v√

1 + y2,∂v

∂y, x|y|∂v

∂x∈ L2(Q)

, (12)

which is a Hilbert space such that all the properties needed by the varia-tional arguments sketched above hold.

5

Page 6: Finite Element Methods for Option Pricing

Theorem 2.1 If the data are smooth, (see [7, 8]) and if

r(t) ≥ r0 > 0, α2 > 2β2, 2α2η(1− η) > β2,

then (10) has a unique weak solution.

2.1 Finite Element Solution

As usual we localize the problem in Ω := (0, Lx)×(−Ly, Ly). No boundarycondition is needed on the axis x = 0 since the PDE is degenerate there.Notice also that u is expected to tend to zero as x tends to infinity. Forlarge y no arguments seems to give a boundary condition. However, if Ly

is chosen such that α(Ly ± m) β2, then for y ∼ ±Ly, the coefficientof the advection term in the y direction, i.e. α(y − m), is much largerin absolute value than the coefficient of the diffusion in the y direction,i.e. β2

2 . Furthermore, near y = ±Ly, the vertical velocity α(y − m) isdirected outward Ω. Therefore, the error caused by an artificial conditionon y = ±Ly will be damped away from the boundaries, and localized inboundary layers whose width is of the order of β2

αy . We may thus apply aNeumann condition.Then one must write the problem in variational form: find u in V0 thesubset of V of functions which are zero at x = Lx and

d

dt(u, w) + a(u, w) = 0, ∀w ∈ V0,

u(x, y, 0) given.(13)

with

a(u, w) =∫

Ω

y2x2

2∂xu∂xw +

β2

2∂yu∂yw

+ (y2 − r)x∂xu + (e + β∂yβ)∂yu + fu)w (14)

Now Ω is triangulated into a set of non-intersecting triangles ωkK1 in such

a way that no vertices lie in the middle of an edge of another triangle. V0

is approximated by V0h the space of continuous piecewise linear functionson the triangulation which vanish at x = Lx.The functions of V0h are completely determined by their values at thevertices of the triangles, so if we denote by wi the function in V0h whichtakes the value zero at all vertices except the ith one where it is one, thenwiN

1 is a basis of V0h if N is the number of vertices not on x = Lx (itis convenient for the presentation to number the nodes on the boundarylast).

6

Page 7: Finite Element Methods for Option Pricing

Mesh size Gauss-LU [s] Relative error superLU[s] Relative error101× 101 10.094 3.532 % 2.39 3.076 %126× 126 14.547 1.338 % 4.016 1.797 %151× 151 22.313 0.751 % 6.203 0.489 %176× 176 31.985 1.131 % 8.735 0.790 %201× 201 43.938 0.432 % 12.109 0.670%

Table 1: Comparison of CPU time for the LU algorithm and superLU fora product put option on a uniform mesh and 200 step time (computed byN. Lantos).

As in the one dimensional case

umh (x, y) =

N∑1

umi wi(x, y)

is an approximation of u(tm) if the um+1i are solutions of

BUm+1 − Um

δtm+ AUm+1 = 0 (15)

with Bij = (wj , wi) and Aij = a(wj , wi).

2.2 Numerical Implementation

Integrals of polynomial expressions of x, y can be evaluated exactly ontriangles (formula (4.19) in [1]). The difficulty is in the strategy to solvethe linear systems (15). Multigrid seems to give the best results in termof speed ([9]) but the computer program may not be so easy to solve foran arbitrary triangulation. Since the number of vertices are not likely toexceed a few thousands, fast multifrontal libraries such as SuperLU [10] canbe used with a minimum programming effort. Table 2.2 shows the gain intime over more classical algorithms.

Alternatively one could also use a Preconditioned Conjugate Gradient-like iterative method (see eqf12/005 in this book). Another way is to useFreeFem++,[11] which is a general two dimensional PDE solver particularlywell suited to these option pricing models where the coefficients are involvedfunctions and one may want to try to change them often. Results for (15)obtained with the following FreeFem++ code are on figure 2 :

real T=1, K=100, r=0.05, alpha=1, beta=1 , m=0.2 , gamma=0, eta=0.5;

int Lx=800, Ly=3, Nmax=50;

real scale=100, dt =T/Nmax;

7

Page 8: Finite Element Methods for Option Pricing

mesh th = square(50,50,[x*Lx,(2*y-1)*Ly*scale]);

fespace Vh(th,P1);

func u0 = max(K-x,0.)*exp(-(1-eta)*(y/scale-m)^2 * alpha/(beta^2));

func e = beta*gamma -(1-2*eta)*alpha*(y/scale-m);

func f = r + 2*(alpha/beta)^2 * eta*(1-eta)*(y/scale-m)^2

+ 2*(1-eta)*(alpha/beta)*(y/scale-m)*gamma - alpha*(1-eta);

Vh uold=u0,u,v;

problem stein(u,v,init=n) = int2d(th)( u*v*(f+1/dt)

+ dx(u)*dx(v) *(x*y/scale)^2/2 + dy(u)*dy(v) *(beta*scale)^2/2

+ dx(u)*v *x*((y/scale)^2-r) + dy(u)*v *e*scale

) - int2d(th)(uold*v/dt) + on(2,u=0) ;

for (int n=0; n<Nmax ; n++) stein; uold=u; ;

// call to keyword adaptmesh not shown....

IsoValue5.1007915.302425.503935.705545.907156.108766.310376.511886.713496.915107.117117.318127.52137.721147.923158.124168.326178.528188.729198.931

Figure 2: Solution of (10) for a put with maturity T=1, strike K=100 withr = 0.02, β = α = 1 and m = 0.2. We have used the automatic meshadaptivity of FreeFem++; the contours and the triangulation are shown.

A similar program has been developped in 3D by S. Delpino: freefem3d.However mesh refinement is not yet implemented. A basket option has beencomputed for illustration (figure 3). The script that drives the program isself explainatory and gives the values used.

double N = 25; double L=200.0; double T=0.5;

8

Page 9: Finite Element Methods for Option Pricing

double dt = T / 15 ; double K=100; double r = 0.02;

double s1 = 0.3; double s2 = 0.2; double s3 = 0.25;

double q12 = -0.2*s1*s2; double q13 = -0.1*s1*s3;

double q23 = -0.2*s2*s3; double s11 = s1*s1/2;

double s22=s2*s2/2; double s33=s3*s3/2;

vector n = (N,N,N);

vector a = (0,0,0);

vector b = (L,L,L);

mesh M = structured(n,a,b);

femfunction uold(M) = max(K-x-y-z,0);

femfunction u(M);

double t=0; do

solve(u) in M cg(maxiter=900,epsilon=1E-10)

pde(u) (1./dt+r)*u-dx(s11*x*x*dx(u))-dy(s22*y*y*dy(u))-dz(s33*z*z*dz(u))

- dx(q12*x*y*dy(u)) - dx(q13*x*z*dz(u)) - dy(q23*y*z*dz(u))

- r*x*dx(u) - r*y*dy(u) - r*z*dz(u) = uold/dt;

dnu(u)=0 on M;

; t = t + dt;

while(t<T);

save(medit,"u",u,M); save(medit,"u",M);

Figure 3: A put on a basket of 3 assets computed with freefem3d[12] withmaturity T=0.5, strike K=100 etc (see the listing). The visualization isdone with medit also public domain [13]

9

Page 10: Finite Element Methods for Option Pricing

3 Asian Calls

For the financial modeling of Asian options, we refer to [14] and the refer-ences therein.We consider an Asian put with fixed strike whose payoff is P0(S, y) =(y−K)+, calling y the average value of the asset in time, y = 1

t

∫ t

0S(τ)dτ .

The price of the option is found by solving for all x, y, t ∈ R+×R+×(0, T ]

∂tu− ∂x(σ2x2

2∂xu) + (σ2 − r)x∂xu +

y − x

T − t∂yu + ru = 0,

u(x, y, 0) = (y −K)+, ∂xu|+∞,y,t ≈

∣∣∣∣∣ tT e−rtif y < KT

T−t1−re−rt

Tr otherwise.(16)

The difficulties of this problem is that the second order part of the differen-tial operator is incomplete and the convective velocity v = ((σ2−r)x, y−x

T−t )T

tends to infinity as t → T ; so great care must be taken for the upwindingof these first order terms. One of the best upwinding is the characteristicfinite element method whereby

∂tu + v · ∇u|x,y,tm+1 ≈1δt

(um+1(q)− um(Q)),

with (Q = q − δtv(q − v(q)δt

2) where q = (x, y)T . (17)

The discontinuous P 2 reconstruction with characteristic convection of thegradient and of the value at the center of gravity is applied. The domain islocalized to (0, L)×(0, L), with L = 250, i.e. greater than twice the contractprice K = 100, in this example; the interest rate is r = 3% and the volatilityσ = 0.3. the square domain is triangulated by a uniform 50× 50 mesh andwe have taken 50 time steps over the 4 years period of this example (T=4).The results are shown on figure 4 at time t = 0.96, 1.96, 3.96.

References

[1] Y. Achdou and O. Pironneau. Computational methods for option pric-ing, volume 30 of Frontiers in Applied Mathematics. Society for In-dustrial and Applied Mathematics (SIAM), Philadelphia, PA, 2005.

[2] J.P. Fouque, G. Papanicolaou, and K.R. Sircar. Derivatives in finan-cial markets with stochastic volatility. Cambridge University Press,Cambridge, 2000.

[3] Xinzheng Huang and Cornelis W. Oosterlee Adaptive integration formulti-factor portfolio credit loss models. Finance and Stochastics (toappear in 2008)

10

Page 11: Finite Element Methods for Option Pricing

IsoValue3.3866110.196917.007223.817530.627837.43844.248351.058657.868964.679271.489578.299785.1191.920398.7306105.541112.351119.161125.972132.782

IsoValue2.961878.8882614.814620.74126.667432.593838.520244.446650.37356.299462.225868.152274.078580.004985.931391.857797.7841103.71109.637115.563

IsoValue1.954695.86499.7751113.685317.595521.505725.41629.326233.236437.146641.056844.96748.877252.787456.697660.607964.518168.428372.338576.2487

Figure 4: Solution of (16) for an Asian option of maturity T=4 and strikeK=100 when the interest rate is 0.03 and the volatility 0.3. The threefigures show the contours at times 0.96, 1.96 and 3.96.

[4] E. Stein and J. Stein. Stock price distributions with stochastic volatil-ity : an analytic approach. The review of financial studies, 4(4):727–752, 1991.

[5] O. C. Zienkiewicz and R. L. Taylor. The finite element method. Vol.1. Butterworth-Heinemann, Oxford, fifth edition, 2000. The basis.

[6] P. G. Ciarlet. Basic error estimates for elliptic problems. In Handbookof Numerical Analysis, Vol. II, pages 17–351. North-Holland, Amster-dam, 1991.

[7] Yves Achdou and Nicoletta Tchou. Variational analysis for the Blackand Scholes equation with stochastic volatility. M2AN Math. Model.Numer. Anal., 36(3):373–395, 2002.

[8] Yves Achdou and Olivier Pironneau. Handbook on Mathematical Fi-nance, chapter Partial differential equations for option pricing. Else-vier, 2007. to appear.

[9] S. Ikonen and J. Toivanen. Efficient numerical methods for pricingamerican options under stochastic volatility. to appear in NumericalMethods for Partial Differential Equations, 2006.

[10] J.W. Demmel, J.R. Gilbert and X.S. Li. SuperLU users’ guide. LBNL–44289, Ernest Orlando Lawrence Berkeley National Laboratory, Berke-ley, CA (US) 1999.

11

Page 12: Finite Element Methods for Option Pricing

[11] F. Hecht and O. Pironneau. freefem++. www.freefem.org

[12] S. Delpino freefem3d. www.freefem.org

[13] P. Frey medit a visualization software.

www.ann.jussieu.fr/frey/logiciels/medit.html

[14] Paul Wilmott, Jeff Dewynne, and Sam Howison. Option Pricing. Ox-ford Financial Press, Oxford, 1993.

12