Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Abstract
The finite element method is well suited to the numerical solution
of the partial differential equations arising in finance because they allow 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 mechanics; the main idea was to use the principle of virtual work for designing
discrete approximations of the boundary value problems. The most popular 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 example).
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 methods 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.
A Simple Example
Take the simplest case, the Black-Scholes model for a put option with a
strike K and a maturity T . The price of the underlying asset is assumed
to be a geometric Brownian motion
dSt = St (dt + dWt ),
and the volatility is allowed to depend on St and t. If the volatility
function satisfies suitable regularity conditions, the Black-Scholes formula
gives the options price at time t < T :
Pt = E (er(T t) (K ST )+ |Ft ),
(1)
where E (|Ft ) stands for the conditional expectation with respect to the
risk neutral probability. It can be proved that with = (St , T t), then
PT t = u(ST t , T t), where u is the solution of
2 2
t u 2x xx u rxx + ru = 0, for x > 0, 0 < t T,
(2)
u(x, 0) = (K x)+ .
The variational formulation of (2) consists of finding a continuous function
u defined on the time interval [0, T ] with value in a Hilbert space V (see
(4) below) such that
d
(u, w) + at (u, w) = 0 for a.a. t (0, T ), w V, u(x, 0) = (K x)+ ,
dt
(3)
where
dv
V = v L2 (R+ ) : x
L2 (R+ ) ,
dx
2 2
x
at (u, w) =
x u, x w + xx u, ( 2 + xx r)w + (ru, w), (4)
2
Z
(u, w) =
u(x)w(x)dx.
0
v V.
(5)
(6)
dU
+ A(t)U = 0, where Bij = (wj , wi ), Aij (t) = at (wj , wi ).
dt
(7)
A discrete time stepping scheme has still to be applied to (7), for instance
the Euler implicit scheme
B
U m+1 U m
+ Am+1 U m+1 = 0,
tm
(8)
tn
tn1 ,
Tmh is the
2
m1 2
2
m
= tm e2tm1 m |um
|V ,
h uh
2m
m1
uh uh
h
um
m
h
+ ruh
,
rx
m, =
xmax ()
tm
x
L2 ()
and h is the diameter of .
Note that everything is known after the computation of uh ; the mesh can
then be adapted by using the error indicators m and m, . Figure 1 shows
the computed a posteriori error and the actual error for a vanilla put with
constant volatility and comparison with the Black-Scholes analytic formula.
0.05
0.008
0.007
0.006
0.005
0.004
0.003
0.002
0.001
0
0
-0.05
-0.1
-0.15
-0.2
-0.25
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0.5
0.5
0.4
0
0.3
50
100
0.2
150
200
0.1
250
3000
0.5
0.4
0
0.3
50
100
0.2
150
200
0.1
250
3000
0.4
0
0.3
50
100
0.2
150
200
0.1
250
3000
Figure 1: The first graph displays the error between the computed solution
on a uniform mesh and one computed with Black-Scholes formula. The
second graph show t ; the third graphs shows n, as a function of x and
t. The parameters are : K = 100, T = 0.5, r = 0, = 0.3, 50 time steps
and 100 mesh points.
p
and Zt = Wt + 1 2 Zt , Wt and Zt are two uncorrelated Brownian
motions. 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 to
introduce
(ym)2
u(S, y, t) = P (S, y, T t)e(1) 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
u
u 1 2 2 2 u 1 2 2 u
y x
rx
+e
+ f u = 0,
(10)
t
2
x2
2 y 2
x
y
+
u(x, y, 0) = (K x) , for x > 0, y R,
wheref
e = (1 2)(y m) +
2
2
f = r + 2
2 (1 )(y m) + 2(1 ) (y m) (1 )
(11)
and is a risk premium factor, possibly a function of x, y, t, see [7] for the
details.
This parabolic equation is degenerate near the axis y = 0 because the
2
coefficient in front of x2 xP2 vanishes on y = 0. Following [7], see also
[1, 8], let us consider the weighted Sobolev space V on Q = R+ R):
p
v
v
2
2
V = v : v 1+y ,
, x|y|
L (Q) ,
(12)
y
x
which is a Hilbert space such that all the properties needed by the variational arguments sketched above hold.
5
Theorem 2.1 If the data are smooth, (see [7, 8]) and if
r(t) r0 > 0,
2 > 2 2 ,
22 (1 ) > 2 ,
2.1
2
+ (y r)xx u + (e + y )y u + f u)w
Z
a(u, w) =
(14)
Mesh size
101 101
126 126
151 151
176 176
201 201
Gauss-LU [s]
10.094
14.547
22.313
31.985
43.938
Relative
3.532
1.338
0.751
1.131
0.432
error
%
%
%
%
%
superLU[s]
2.39
4.016
6.203
8.735
12.109
Relative error
3.076 %
1.797 %
0.489 %
0.790 %
0.670%
Table 1: Comparison of CPU time for the LU algorithm and superLU for
a product put option on a uniform mesh and 200 step time (computed by
N. Lantos).
As in the one dimensional case
um
h (x, y) =
N
X
i
um
i w (x, y)
U m+1 U m
+ AU m+1 = 0
tm
(15)
2.2
Numerical Implementation
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....
IsoValue
5.10079
15.3024
25.5039
35.7055
45.9071
56.1087
66.3103
76.5118
86.7134
96.915
107.117
117.318
127.52
137.721
147.923
158.124
168.326
178.528
188.729
198.931
Figure 2: Solution of (10) for a put with maturity T=1, strike K=100 with
r = 0.02, = = 1 and m = 0.2. We have used the automatic mesh
adaptivity 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 been
computed for illustration (figure 3). The script that drives the program is
self explainatory and gives the values used.
double N = 25;
double L=200.0;
double T=0.5;
double
double
double
double
double
dt = T / 15 ; double K=100;
double r = 0.02;
s1 = 0.3;
double s2 = 0.2;
double s3 = 0.25;
q12 = -0.2*s1*s2;
double q13 = -0.1*s1*s3;
q23 = -0.2*s2*s3;
double s11 = s1*s1/2;
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);
Asian Calls
For the financial modeling of Asian options, we refer to [14] and the references therein.
We consider an Asian put with fixed strike whose payoff is P0 (S, y) =
Rt
(y K)+ , calling y the average value of the asset in time, y = 1t 0 S( )d .
The price of the option is found by solving for all {x, y, t} R+ R+ (0, T ]
2 x2
yx
x u) + ( 2 r)xx u +
y u + ru = 0,
2
T t
t ert if y < KT
T
T t
(16)
u(x, y, 0) = (y K)+ , x u|+,y,t 1re
rt
T r otherwise.
t u x (
The difficulties of this problem is that the second order part of the differenT
tial operator is incomplete and the convective velocity v = (( 2 r)x, yx
T t )
tends to infinity as t T ; so great care must be taken for the upwinding
of these first order terms. One of the best upwinding is the characteristic
finite element method whereby
1 m+1
(u
(q) um (Q)),
t
t
with (Q = q tv(q v(q) ) where q = (x, y)T .
2
t u + v u|x,y,tm+1
(17)
References
[1] Y. Achdou and O. Pironneau. Computational methods for option pricing, volume 30 of Frontiers in Applied Mathematics. Society for Industrial and Applied Mathematics (SIAM), Philadelphia, PA, 2005.
[2] J.P. Fouque, G. Papanicolaou, and K.R. Sircar. Derivatives in financial markets with stochastic volatility. Cambridge University Press,
Cambridge, 2000.
[3] Xinzheng Huang and Cornelis W. Oosterlee Adaptive integration for
multi-factor portfolio credit loss models. Finance and Stochastics (to
appear in 2008)
10
IsoValue
3.38661
10.1969
17.0072
23.8175
30.6278
37.438
44.2483
51.0586
57.8689
64.6792
71.4895
78.2997
85.11
91.9203
98.7306
105.541
112.351
119.161
125.972
132.782
IsoValue
2.96187
8.88826
14.8146
20.741
26.6674
32.5938
38.5202
44.4466
50.373
56.2994
62.2258
68.1522
74.0785
80.0049
85.9313
91.8577
97.7841
103.71
109.637
115.563
IsoValue
1.95469
5.8649
9.77511
13.6853
17.5955
21.5057
25.416
29.3262
33.2364
37.1466
41.0568
44.967
48.8772
52.7874
56.6976
60.6079
64.5181
68.4283
72.3385
76.2487
Figure 4: Solution of (16) for an Asian option of maturity T=4 and strike
K=100 when the interest rate is 0.03 and the volatility 0.3. The three
figures show the contours at times 0.96, 1.96 and 3.96.
[4] E. Stein and J. Stein. Stock price distributions with stochastic volatility : 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 Handbook
of Numerical Analysis, Vol. II, pages 17351. North-Holland, Amsterdam, 1991.
[7] Yves Achdou and Nicoletta Tchou. Variational analysis for the Black
and Scholes equation with stochastic volatility. M2AN Math. Model.
Numer. Anal., 36(3):373395, 2002.
[8] Yves Achdou and Olivier Pironneau. Handbook on Mathematical Finance, chapter Partial differential equations for option pricing. Elsevier, 2007. to appear.
[9] S. Ikonen and J. Toivanen. Efficient numerical methods for pricing
american options under stochastic volatility. to appear in Numerical
Methods 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, Berkeley, CA (US) 1999.
11
12