SlideShare a Scribd company logo
Numerical Solution of
Stochastic Differential Equations
in Finance
Timothy Sauer
Department of Mathematics
George Mason University
Fairfax, VA 22030
tsauer@gmu.edu
Abstract. This chapter is an introduction and survey of numerical solution
methods for stochastic differential equations. The solutions will be continuous
stochastic processes that represent diffusive dynamics, a common modeling
assumption for financial systems. We include a review of fundamental con-
cepts, a description of elementary numerical methods and the concepts of
convergence and order for stochastic differential equation solvers.
In the remainder of the chapter we describe applications of SDE solvers to
Monte-Carlo sampling for financial pricing of derivatives. Monte-Carlo simu-
lation can be computationally inefficient in its basic form, and so we explore
some common methods for fostering efficiency by variance reduction and the
use of quasi-random numbers. In addition, we briefly discuss the extension of
SDE solvers to coupled systems driven by correlated noise, which is applicable
to multiple asset markets.
1 Stochastic differential equations
Stochastic differential equations (SDEs) have become standard models for fi-
nancial quantities such as asset prices, interest rates, and their derivatives. Un-
like deterministic models such as ordinary differential equations, which have
a unique solution for each appropriate initial condition, SDEs have solutions
that are continuous-time stochastic processes. Methods for the computational
solution of stochastic differential equations are based on similar techniques for
ordinary differential equations, but generalized to provide support for stochas-
tic dynamics.
We will begin with a quick survey of the most fundamental concepts from
stochastic calculus that are needed to proceed with our description of nu-
merical methods. For full details, the reader may consult Klebaner (1998);
Oksendal (1998); Steele (2001).
2 Timothy Sauer
A set of random variables Xt indexed by real numbers t ≥ 0 is called a
continuous-time stochastic process. Each instance, or realization of the stochas-
tic process is a choice from the random variable Xt for each t, and is therefore
a function of t.
Any (deterministic) function f(t) can be trivially considered as a stochastic
process, with variance V (f(t)) = 0. An archetypal example that is ubiquitous
in models from physics, chemistry, and finance is the Wiener process Wt, a
continuous-time stochastic process with the following three properties:
Property 1. For each t, the random variable Wt is normally distributed with
mean 0 and variance t.
Property 2. For each t1 < t2, the normal random variable Wt2
−Wt1
is indepen-
dent of the random variable Wt1 , and in fact independent of all Wt, 0 ≤ t ≤ t1.
Property 3. The Wiener process Wt can be represented by continuous paths.
The Wiener process, named after Norbert Wiener, is a mathematical con-
struct that formalizes random behavior characterized by the botanist Robert
Brown in 1827, commonly called Brownian motion. It can be rigorously de-
fined as the scaling limit of random walks as the step size and time interval
between steps both go to zero. Brownian motion is crucial in the modeling of
stochastic processes since it represents the integral of idealized noise that is in-
dependent of frequency, called white noise. Often, the Wiener process is called
upon to represent random, external influences on an otherwise deterministic
system, or more generally, dynamics that for a variety of reasons cannot be
deterministically modeled.
A typical diffusion process in finance is modeled as a differential equation
involving deterministic, or drift terms, and stochastic, or diffusion terms, the
latter represented by a Wiener process, as in the equation
dX = a(t, X) dt + b(t, X) dWt (1)
Notice that the SDE (1) is given in differential form, unlike the derivative form
of an ODE. That is because many interesting stochastic processes, like Brow-
nian motion, are continuous but not differentiable. Therefore the meaning of
the SDE (1) is, by definition, the integral equation
X(t) = X(0) +
Z t
0
a(s, y) ds +
Z t
0
b(s, y) dWs,
where the meaning of the last integral, called an Ito integral, will be defined
next.
Let c = t0 < t1 < . . . < tn−1 < tn = d be a grid of points on the interval
[c, d]. The Riemann integral is defined as a limit
Z d
c
f(x) dx = lim
∆t→0
n
X
i=1
f(t0
i)∆ti,
Numerical Solution of Stochastic Differential Equations in Finance 3
where ∆ti = ti −ti−1 and ti−1 ≤ t0
i ≤ ti. Similarly, the Ito integral is the limit
Z d
c
f(t) dWt = lim
∆t→0
n
X
i=1
f(ti−1)∆Wi
where ∆Wi = Wti − Wti−1 , a step of Brownian motion across the interval.
Note a major difference: while the t0
i in the Riemann integral may be chosen at
any point in the interval (ti−1, ti), the corresponding point for the Ito integral
is required to be the left endpoint of that interval.
Because f and Wt are random variables, so is the Ito integral I =
R d
c
f(t) dWt. The differential dI is a notational convenience; thus
I =
Z d
c
f dWt
is expressed in differential form as
dI = fdWt.
The differential dWt of Brownian motion Wt is called white noise. A typical
solution is a combination of drift and the diffusion of Brownian motion.
To solve SDEs analytically, we need to introduce the chain rule for stochas-
tic differentials, called the Ito formula:
If Y = f(t, X), then
dY =
∂f
∂t
(t, X) dt +
∂f
∂x
(t, X) dx +
1
2
∂2
f
∂x2
(t, X) dx dx (2)
where the dx dx term is interpreted by using the identities
dt dt = 0
dt dWt = dWt dt = 0
dWt dWt = dt (3)
The Ito formula is the stochastic analogue to the chain rule of conventional
calculus. Although it is expressed in differential form for ease of understanding,
its meaning is precisely the equality of the Ito integral of both sides of the
equation. It is proved under rather weak hypotheses by referring the equation
back to the definition of Ito integral (Oksendal, 1998).
Some of the important features of typical stochastic differential equations
can be illustrated using the following historically-pivotal example from fi-
nance, often called the Black-Scholes diffusion equation:

dX = µX dt + σX dWt
X(0) = X0
(4)
4 Timothy Sauer
with constants µ and σ. Although the equation is comparatively simple, the
fact that it can be exactly solved led to its central importance, by making
a closed-form formula available for the pricing of simple options (Black and
Scholes, 1973).
The solution of the Black-Scholes stochastic differential equation is geo-
metric Brownian motion
X(t) = X0e(µ−
1
2 σ2
)t+σWt
. (5)
To check this, write X = f(t, Y ) = X0eY
, where Y = (µ − 1
2 σ2
)t + σWt. By
the Ito formula,
dX = X0eY
dY + 1
2 eY
dY dY
where dY = (µ − 1
2 σ2
) dt + σ dWt. Using the differential identities from the
Ito formula,
dY dY = σ2
dt,
and therefore
dX = X0eY
(r − 1
2 σ2
) dt + X0eY
σ dWt + 1
2 σ2
eY
dt
= X0eY
µ dt + X0eY
σ dWt
= µX dt + σX dWt
as claimed.
Fig. 1 shows a realization of geometric Brownian motion with constant drift
coefficient µ and diffusion coefficient σ. Similar to the case of ordinary differen-
tial equations, relatively few stochastic differential equations have closed-form
solutions. It is often necessary to use numerical approximation techniques.
2 Numerical methods for SDEs.
The simplest effective computational method for the approximation of or-
dinary differential equations is Euler’s method (Sauer, 2006). The Euler-
Maruyama method (Maruyama, 1955) is the analogue of the Euler method
for ordinary differential equations. To develop an approximate solution on the
interval [c, d], assign a grid of points
c = t0  t1  t2  . . .  tn = d.
Approximate x values
w0  w1  w2  . . .  wn
will be determined at the respective t points. Given the SDE initial value
problem
Numerical Solution of Stochastic Differential Equations in Finance 5

dX(t) = a(t, X)dt + b(t, X)dWt
X(c) = Xc
(6)
we compute the approximate solution as follows:
Euler-Maruyama Method
w0 = X0
wi+1 = wi + a(ti, wi)∆ti+1 + b(ti, wi)∆Wi+1 (7)
where
∆ti+1 = ti+1 − ti
∆Wi+1 = W(ti+1) − W(ti). (8)
The crucial question is how to model the Brownian motion ∆Wi. Define
N(0, 1) to be the standard random variable that is normally distributed with
mean 0 and standard deviation 1. Each random number ∆Wi is computed as
∆Wi = zi
p
∆ti (9)
where zi is chosen from N(0, 1). Note the departure from the deterministic
ordinary differential equation case. Each set of {w0, . . . , wn} produced by
the Euler-Maruyama method is an approximate realization of the solution
stochastic process X(t) which depends on the random numbers zi that were
chosen. Since Wt is a stochastic process, each realization will be different and
so will our approximations.
As a first example, we show how to apply the Euler-Maruyama method to
the Black Scholes SDE (4). The Euler-Maruyama equations (7) have form
w0 = X0 (10)
wi+1 = wi + µwi∆ti + σwi∆Wi.
We will use the drift coefficient µ = 0.75 and diffusion coefficient σ = 0.30,
which are values inferred from the series of market close share prices of Google,
Inc. (NYSE ticker symbol GOOG) during the 250 trading days in 2009. To
calculate the values µ and σ2
, the mean and variance, respectively, of the daily
stock price returns were converted to an annual basis, assuming independence
of the daily returns.
An exact realization, generated from the solution (5), along with the cor-
responding Euler-Maruyama approximation, are shown in Fig. 1. By corre-
sponding, we mean that the approximation used the same Brownian motion
realization as the true solution. Note the close agreement between the solution
and the approximating points, plotted as small circles every 0.2 time units.
In addition, the original time series of Google share prices is shown for com-
parison. Both the original time series (grey curve) and the simulation from
(5) (black curve) should be considered as realizations from the same diffusion
process, with identical µ, σ and initial price X0 = 307.65.
6 Timothy Sauer
0 1
time (years)
300
600
price
Fig. 1. Solution to the Black Scholes stochastic differential equation (4).
The exact solution (5) is plotted as a black curve. The Euler-Maruyama approxima-
tion with time step ∆t = 0.2 is plotted as circles. The drift and diffusion parameters
are set to µ = 0.75 and σ = 0.30, respectively. Shown in grey is the actual stock
price series, from which µ and σ were inferred.
As another example, consider the Langevin equation
dX(t) = −µX(t) dt + σ dWt (11)
where µ and σ are positive constants. In this case, it is not possible to ana-
lytically derive the solution to this equation in terms of simple processes. The
solution of the Langevin equation is a stochastic process called the Ornstein-
Uhlenbeck process. Fig. 2 shows one realization of the approximate solution.
It was generated from an Euler-Maruyama approximation, using the steps
w0 = X0 (12)
wi+1 = wi − µwi∆ti + σ∆Wi
for i = 1, . . . , n. This stochastic differential equation is used to model systems
that tend to revert to a particular state, in this case the state X = 0, in
the presence of a noisy background. Interest-rate models, in particular, often
contain mean-reversion assumptions.
3 Strong convergence of SDE solvers.
The definition of convergence is similar to the concept for ordinary differential
equation solvers, aside from the differences caused by the fact that a solution
Numerical Solution of Stochastic Differential Equations in Finance 7
0 1 2 3 4
−1
1
Fig. 2. Solution to Langevin equation (11). The upper path is the solution
approximation for parameters µ = 10, σ = 1, computed by the Euler-Maruyama
method.
to an SDE is a stochastic process, and each computed trajectory is only one
realization of that process. Each computed solution path w(t), using Euler-
Maruyama for example, gives a random value at T, so that w(T) is a random
variable as well. The difference between the values at time T, e(T) = X(T) −
w(T), is therefore a random variable.
A discrete-time approximation is said to converge strongly to the solution
X(t) at time T if
lim
∆t→0
E{|X(T) − w∆t(T)|} = 0
where w∆t is the approximate solution computed with constant stepsize ∆t,
and E denotes expected value. For strongly convergent approximations, we
further quantify the rate of convergence by the concept of order. An SDE
solver converges strongly with order m if the expected value of the error is of
mth order in the stepsize, i.e. if for any time T,
E{|X(T) − w∆t(T)|} = O((∆t)m
)
for sufficiently small stepsize ∆t. This definition generalizes the standard con-
vergence criterion for ordinary differential equations, reducing to the usual
definition when the stochastic part of the equation goes to zero.
Although the Euler method for ordinary differential equations has order
1, the strong order for the Euler-Maruyama method for stochastic differential
equations is 1/2. This fact was proved in Gikhman and Skorokhod (1972),
under appropriate conditions on the functions a and b in (6).
In order to build a strong order 1 method for SDEs, another term in
the “stochastic Taylor series” must be added to the method. Consider the
8 Timothy Sauer
stochastic differential equation

dX(t) = a(X, t)dt + b(X, t)dWt
X(0) = X0.
(13)
Milstein Method
w0 = X0
wi+1 = wi + a(wi, ti)∆ti + b(wi, ti)∆Wi
+ 1
2 b(wi, ti)
∂b
∂x
(wi, ti)(∆W2
i − ∆ti) (14)
The Milstein Method has order one. Note that the Milstein Method is
identical to the Euler-Maruyama Method if there is no X term in the diffusion
part b(X, t) of the equation. In case there is, Milstein will in general converge
to the correct stochastic solution process more quickly than Euler-Maruyama
as the step size ∆ti goes to zero.
For comparison of the Euler-Maruyama and Milstein methods, we apply
them to the Black Scholes stochastic differential equation
dX = µX dt + σX dWt. (15)
We discussed the Euler-Maruyama approximation above. The Milstein Method
becomes
w0 = X0 (16)
wi+1 = wi + µwi∆ti + σwi∆Wi + 1
2 σ(∆W2
i − ∆ti)
Applying the Euler-Maruyama Method and the Milstein Method with de-
creasing stepsizes ∆t results in successively improved approximations, as Table
1 shows:
The two columns represent the average, over 100 realizations, of the error
|w(T)−X(T)| at T = 8. The orders 1/2 for Euler-Maruyama and 1 for Milstein
are clearly visible in the table. Cutting the stepsize by a factor of 4 is required
to reduce the error by a factor of 2 with the Euler-Maruyama method. For
the Milstein method, cutting the stepsize by a factor of 2 achieves the same
result. The data in the table is plotted on a log-log scale in Fig. 3.
The Milstein method is a Taylor method, meaning that it is derived from a
truncation of the stochastic Taylor expansion of the solution. This is in many
cases a disadvantage, since the partial derivative appears in the approximation
method, and must be provided explicitly by the user. This is analogous to Tay-
lor methods for solving ordinary differential equations, which are seldom used
in practice for that reason. To counter this problem, Runge-Kutta methods
were developed for ODEs, which trade these extra partial derivatives in the
Taylor expansion for extra function evaluations from the underlying equation.
Numerical Solution of Stochastic Differential Equations in Finance 9
Table 1. Average error at T = 8 of approximate solutions of (4). The error scales
as ∆t1/2
for Euler-Maruyama and ∆t for Milstein.
∆t Euler-Maruyama Milstein
2−1
0.169369 0.063864
2−2
0.136665 0.035890
2−3
0.086185 0.017960
2−4
0.060615 0.008360
2−5
0.048823 0.004158
2−6
0.035690 0.002058
2−7
0.024277 0.000981
2−8
0.016399 0.000471
2−9
0.011897 0.000242
2−10
0.007913 0.000122
10
−4
10
−2
10
0
10
−4
10
−3
10
−2
10
−1
10
0
stepsize Δ t
mean
error
Fig. 3. Error in the Euler-Maruyama and Milstein methods. Solution paths
are computed for the geometric Brownian motion equation (15) and are compared
to the correct X(T) given by (5). The absolute difference is plotted versus stepsize
h for the two different methods. The Euler-Maruyama errors are plotted as circles
and the Milstein error as squares. Note the slopes 1/2 and 1, respectively, on the
log-log plot.
In the stochastic differential equation context, the same trade can be made
with the Milstein method, resulting in a strong order 1 method that requires
evaluation of b(X) at two places on each step. A heuristic derivation can be
carried out by making the replacement
bx(wi) ≈
b(wi + b(wi)
√
∆ti) − b(wi)
b(wi)
√
∆ti
in the Milstein formula (14), which leads to the following method (Rumelin,
1982):
10 Timothy Sauer
Strong Order 1.0 Runge-Kutta Method
w0 = X0
wi+1 = wi + a(wi)∆ti + b(wi)∆Wi
+ 1
2 [b(wi + b(wi)
p
∆ti) − b(wi)](∆W2
i − ∆ti)/
p
∆ti
The orders of the methods introduced here for SDEs, 1/2 for Euler-
Maruyama and 1 for Milstein and the Runge-Kutta counterpart, would be
considered low by ODE standards. Higher-order methods can be developed
for SDEs, but become much more complicated as the order grows. As an ex-
ample, consider the strong order 1.5 scheme for the SDE (13) proposed in
Platen and Wagner (1982):
Strong Order 1.5 Taylor Method
w0 = X0
wi+1 = wi + a∆ti + b∆Wi + 1
2 bbx(∆W2
i − ∆ti)
+ ayσ∆Zi + 1
2 (aax + 1
2 b2
axx)∆t2
i
+ (abx + 1
2 b2
bxx)(∆Wi∆ti − ∆Zi)
+ 1
2 b(bbxx + b2
x)(1
3 ∆W2
i − ∆ti)∆Wi (17)
where partial derivatives are denoted by subscripts, and where the additional
random variable ∆Zi is normally distributed with mean 0, variance E(∆Z2
i ) =
1
3 ∆t3
i and correlated with ∆Wi with covariance E(∆Zi∆Wi) = 1
2 ∆t2
i . Note
that ∆Zi can be generated as
∆Zi = 1
2 ∆ti(∆Wi + ∆Vi/
√
3)
where ∆Vi is chosen independently from
√
∆tiN(0, 1).
Whether higher-order methods are needed in a given application depends
on how the resulting approximate solutions are to be used. In the ordinary
differential equation case, the usual assumption is that the initial condition
and the equation are known with accuracy. Then it makes sense to calculate
the solution as closely as possible to the same accuracy, and higher-order
methods are called for. In the context of stochastic differential equations, in
particular if the initial conditions are chosen from a probability distribution,
the advantages of higher-order solvers are often less compelling, and if they
come with added computational expense, may not be warranted.
4 Weak convergence of SDE solvers
Strong convergence allows accurate approximations to be computed on an
individual realization basis. For some applications, such detailed pathwise
Numerical Solution of Stochastic Differential Equations in Finance 11
information is required. In other cases, the goal is to ascertain the probability
distribution of the solution X(T), and single realizations are not of primary
interest.
Weak solvers seek to fill this need. They can be simpler than corresponding
strong methods, since their goal is to replicate the probability distribution
only. The following additional definition is useful.
A discrete-time approximation w∆t with step-size ∆t is said to converge
weakly to the solution X(T) if
lim
∆t→0
E{f(w∆t(T))} = E{f(X(T))}
for all polynomials f(x). According to this definition, all moments converge
as ∆t → 0. If the stochastic part of the equation is zero and the initial value
is deterministic, the definition agrees with the strong convergence definition,
and the usual ordinary differential equation definition.
Weakly convergent methods can also be assigned an order of convergence.
We say that a the solver converges weakly with order m if the error in the
moments is of mth order in the stepsize, or
|E{f(X(T))} − E{f(w∆t(T))}| = O((∆t)m
)
for sufficiently small stepsize ∆t.
In general, the rates of weak and strong convergence do not agree. Unlike
the case of ordinary differential equations, where the Euler method has order
1, the Euler-Maruyama method for SDEs has strong order m = 1/2. However,
Euler-Maruyama is guaranteed to converge weakly with order 1.
Higher order weak methods can be much simpler than corresponding
strong methods, and are available in several different forms. The most direct
approach is to exploit the Ito-Taylor expansion (Kloeden and Platen, 1992),
the Ito calculus analogue of the Taylor expansion of deterministic functions.
An example SDE solver that converges weakly with order 2 is the following:
Weak Order 2 Taylor Method
w0 = X0
wi+1 = wi + a∆ti + b∆Wi + 1
2 bbx(∆W2
i − ∆ti)
+ axb∆Zi + 1
2 (aax + 1
2 axxb2
)∆t2
+ (abx + 1
2 bxxb2
)(∆Wi∆ti − ∆Zi) (18)
where ∆Wi is chosen from
√
∆tiN(0, 1) and ∆Zi is distributed as in the above
Strong Order 1.5 Method.
A second approach is to mimic the idea of Runge-Kutta solvers for ordinary
differential equations. These solvers replace the explicit higher derivatives in
the Ito-Taylor solvers with extra function evaluations at interior points of the
current solution interval. Platen (1987) proposed the following weak order 2
solver of Runge-Kutta type:
12 Timothy Sauer
Weak Order 2 Runge-Kutta Method
w0 = X0
wi+1 = wi + 1
2 [a(u) + a(wi)]∆ti
+
1
4
[b(u+) + b(u−) + 2b(wi)]∆Wi
+
1
4
[b(u+) − b(u−)](∆W2
i − ∆t)/
p
∆ti (19)
where
u = wi + a∆ti + b∆Wi
u+ = wi + a∆ti + b
p
∆ti
u− = wi + a∆ti − b
p
∆ti.
10
−2
10
−1
10
0
10
−4
10
−3
10
−2
10
−1
10
0
time step Δ t
error
Fig. 4. The mean error of the estimation of E(X(T)) for SDE (15). The
plot compares the Euler-Maruyama method (circles) which has weak order 1, and
the weak order 2 Runge-Kutta type method (squares) given in (19). Parameter used
were X(0) = 10, T = 1, µ = −3, σ = 0.2.
Fig. 4 compares the Euler-Maruyama method, which converges with order
1 in the weak sense, to the Weak Order 2 Runge-Kutta-Type Method. Note
the difference between strong and weak convergence. In the previous Fig. 3,
which considers strong convergence, the mean error of the estimate of a point
X(T) on the solution curve was plotted. In Fig. 4, on the other hand, the
mean error of the estimate of the expected value E[X(T)] is plotted, since we
are comparing weak convergence of the methods. The weak orders are clearly
revealed by the log-log plot.
Numerical Solution of Stochastic Differential Equations in Finance 13
Several other higher-order weak solvers can be found in Kloeden and
Platen (1992). Weak Taylor methods of any order can be constructed, as
well as Runge-Kutta analogues that reduce or eliminate the derivative cal-
culations. In addition, standard Richardson extrapolation techniques (Sauer,
2006) can be used to bootstrap weak method approximations of a given order
to the next order. See Kloeden and Platen (1992) for full details.
Weak solvers are often an appropriate choice for financial models, when
the goal is to investigate the probability distribution of an asset price or
interest rate, or when Monte-Carlo sampling is used to price a complicated
derivative. In such cases it is typical to be primarily interested in one of the
statistical moments of a stochastically-defined quantity, and weak methods
may be simpler and still sufficient for the sampling purpose. In the next section
we explore some of the most common ways SDE solvers are used to carry out
Monte-Carlo simulations for derivative pricing.
5 Monte-Carlo sampling of SDE paths for option pricing
As an illustrative example of the use of SDE solvers for option pricing, consider
the European call, whose value at expiration time T is max{X(T) − K, 0},
where X(t) is the price of the underlying stock, K is the strike price. The no-
arbitrage assumptions of Black-Scholes theory imply that the present value of
such an option is
C(X0, T) = e−rT
E(max{X(T) − K, 0}) (20)
where r is the fixed prevailing interest rate during the time interval [0, T],
and where the underlying stock price X(t) satisfies the stochastic differential
equation
dX = rX dt + σX dWt.
The value of the call option can be determined by calculating the expected
value (20) explicitly. Using the Euler-Maruyama method for following solu-
tions to the Black-Scholes SDE, the value X(T) at the expiration time T can
be determined for each path, or realization of the stochastic process. For a
given n realizations, the average hmax{X(T) − K, 0}i can be used as an ap-
proximation to the expected value in (20). Carrying this out and comparing
with the exact solution from the Black-Scholes formula
C(X, T) = XN(d1) − Ke−rT
N(d2) (21)
where
d1 =
log(X/K) + (r + 1
2 σ2
)T
σ
√
T
, d2 =
log(X/K) + (r − 1
2 σ2
)T
σ
√
T
,
yields the errors plotted as circles in Fig. 5.
14 Timothy Sauer
10
2
10
3
10
−2
10
−1
10
0
number of realizations n
error
Fig. 5. Option pricing comparison between pseudo-random and quasi-
random numbers. Circles (squares) represent error in Monte-Carlo estimation of
European call by following SDE paths using pseudo-random (quasi-random) num-
bers to generate increments. Settings were X(0) = 10, K = 12, r = 0.05, σ = 0.5,
expiration time T = 0.5. The number of Wiener increments per trajectory was
m = 8.
The results above were attained using pseudo-random numbers to generate
the Wiener increments ∆W in the Euler-Maruyama method. An improvement
in accuracy can be achieved by using quasi-random numbers instead.
By definition, standard normal pseudo-random numbers are created to be
independent and identically-distributed, where the distribution is the stan-
dard normal distribution. For many Monte-Carlo sampling problems, the in-
dependence is not crucial to the computation. If that assumption can be dis-
carded, then there are more efficient ways to sample, using what are called low-
discrepancy sequences. Such quasi-random sequences are identically-distributed
but not independent. Their advantage is that they are better at self-avoidance
than pseudo-random numbers, and by essentially reducing redundancy they
can deliver Monte-Carlo approximations of significantly reduced variance with
the same number of realizations.
Consider the problem of estimating an expected value like (20) by calculat-
ing many realizations. By Property 2 of the Wiener process, the m increments
∆W1, . . . , ∆Wm of each realization must be independent. Therefore along the
trajectories, independence must be preserved. This is accomplished by using
m different low-discepancy sequences along the trajectory. For example, the
base-p low discrepancy sequences due to Halton (1960) for m different prime
numbers p can be used along the trajectory, while the sequences themselves
run across different realizations.
Numerical Solution of Stochastic Differential Equations in Finance 15
Fig. 5 shows a comparison of errors for the Monte-Carlo pricing of the
European call, using this approach to create quasi-random numbers. The
low-discrepancy sequences produce nonindependent uniform random numbers,
and must be run through the Box-Muller method (Box and Muller, 1958) to
produce normal quasi-random numbers. The pseudo-random sequences show
error proportional to n−0.5
, while the quasi-random appear to follow approx-
imately n−0.7
.
More sophisticated low-discrepancy sequences, due to Faure, Niederreiter,
Xing, and others, have been developed and can be shown to be more effi-
cient than the Halton sequences. The chapter in this volume by Niederreiter
(Niederreiter, 2010) describes the state of the art in generating such sequences.
10
2
10
3
10
4
10
−2
10
−1
10
0
number of realizations n
error
Fig. 6. Pricing error for barrier down-and-out call option. Error is propor-
tional to the square root of the number of Monte-Carlo realizations.
The quasi-random approach can become too cumbersome if the number of
steps m along each SDE trajectory becomes large. As an example, consider a
barrier option, whose value is a function of the entire trajectory. For a down-
and-out barrier call, the payout is canceled if the underlying stock drops belong
a certain level during the life of the option. Therefore, at time T the payoff
is max(X(T) − K, 0) if X(t)  L for 0  t  T, and 0 otherwise. For such
an option, accurate pricing is dependent on using a relatively large number of
steps m per trajectory. Results of a Monte-Carlo simulation of this modified
call option are shown in Fig. 6, where the error was computed by comparison
with the exact price
V (X, T) = C(X, T) −

X
L
1− 2r
σ2
C(L2
/X, T)
16 Timothy Sauer
where C(X, t) is the standard European call value with strike price K. The tra-
jectories were generated with Euler-Maruyama approximations with pseudo-
random number increments, where m = 1000 steps were used.
Other approaches to making Monte-Carlo sampling of trajectories more
efficient fall under the umbrella of variance reduction. The idea is to calculate
the expected value more accurately with fewer calls to the random number
generator. The concept of antithetic variates is to follow SDE solutions in
pairs, using the Wiener increment in one solutions and its negative in the
other solution at each step. Due to the symmetry of the Wiener process,
the solutions are equally likely. For the same number of random numbers
generated, the standard error is decreased by a factor of
√
2.
A stronger version of variance reduction in computing averages from SDE
trajectories can be achieved with control variates. We outline one such ap-
proach, known as variance reduction by delta-hedging. In this method the
quantity that is being estimated by Monte-Carlo is replaced with an equiva-
lent quantity of smaller variance. For example, instead of approximating the
expected value of (20), the cash portion of the replicating portfolio of the Eu-
ropean call can be targeted, since it must equal the option price at expiration.
10
1
10
2
10
3
10
−3
10
−2
10
−1
number of realizations n
error
Fig. 7. Estimation errors for European call using control variates. Error is
proportional to the square root of the number of Monte-Carlo realizations. Compare
absolute levels of error with Fig. 5.
Let C0 be the option value at time t = 0, which is the goal of the calcula-
tion. At the time t = 0, the seller of the option hedges by purchasing ∆ = ∂C
∂X
shares of the underlying asset. Thus the cash account, valued forward to time
T, holds
[C0 −
∂C
∂X
(t0)Xt0
]er(T −t0)
.
Numerical Solution of Stochastic Differential Equations in Finance 17
At time step t = t1, the seller needs to hold ∆ = ∂C
∂X (t1) shares, so after
purchasing ∂C
∂X (t1) − ∂C
∂X (t0) shares, the cash account (valued forward) drops
by 
∂C
∂X
(t1) −
∂C
∂X
(t0)]Xt1

er(T −t1)
.
Continuing in this way, the cash account of the replicating portfolio at time
T, which must be CT , equals
C0er(T −t0)
−
N
X
k=0

∂C
∂X
(tk) −
∂C
∂X
(tk−1)

Xtk
er(T −tk)
= C0er(T −t0)
+
N−1
X
k=0
∂C
∂X
(tk)(Xtk+1
− Xtk
er∆t
)er(T −tk+1)
and so
C0 = e−r(T −t0)

CT −
N−1
X
k=0
∂C
∂X
(tk)(Xtk+1
− Xtk
er∆t
)er(T −tk+1)
#
= e−r(T −t0)
[CT − cv]
where cv denotes the control variate. Estimating the expected value of this
expression yields fast convergence, as demonstrated in Fig. 7. Compared to
Fig. 5, the errors in pricing of the European call are lower by an order of
magnitude for a similar number of realizations. However, the calculation of the
control variate adds significantly to the computational load, and depending
on the form of the derivative, may add more overhead than is gained from the
reduced variance in some cases.
6 Multifactor models
Financial derivatives that depend on a variety of factors should be modeled
as a stochastic process that is driven by a multidimensional Wiener process.
The various random factors may be independent, but more realistically, there
is often correlation between the random inputs.
For multifactor Wiener processes (W1
t , . . . , Wk
t ), the generalization of Ito’s
Formula requires that (3) is replaced with
dt dt = 0
dt dWi
t = dWi
t dt = 0
dWi
t dWj
t = ρij dt (22)
where ρij represents the statistical correlation between Wi
t and Wj
t . As usual,
correlation ρ of two random variables X1 and X2 is defined as
18 Timothy Sauer
ρ(X1, X2) =
cov(X1, X2)
p
V (X1)
p
V (X2)
.
Note that ρ(X1, X1) = 1, and X1 and X2 are uncorrelated if ρ(X1, X2) = 0.
To construct discretized correlated Wiener processes for use in SDE
solvers, we begin with a desired correlation matrix
R =



ρ11 · · · ρ1k
.
.
.
.
.
.
ρk1 · · · ρkk



that we would like to specify for Wiener processes W1
, . . . , Wk
. The matrix
R is symmetric with units on the main diagonal. A straightforward way to
create noise processes with a specified correlation is through the singular value
decomposition (SVD) (see Sauer (2006) for a description). The SVD of R is
R = ΓΛΓ
where Γ is an orthogonal matrix (Γ−1
= Γ
), and Λ is a diagonal matrix
with nonzero entries on the main diagonal.
Begin with k independent, uncorrelated Wiener processes Z1, . . . , Zk, sat-
isfying dZidZi = dt, dZidZj = 0 for i 6= j. Define the column vector
dW = ΓΛ1/2
dZ, and check that the covariance matrix, and therefore the
correlation matrix, of dW is
dWdW
= ΓΛ1/2
dZ(ΓΛ1/2
dZ)
= ΓΛ1/2
dZdZ
Λ1/2
Γ
= ΓΛΓ
dt = R dt
For example, a two-asset market has correlation matrix
R =

1 ρ
ρ 1

=

corr(W1
, W1
) corr(W1
, W2
)
corr(W2
, W1
) corr(W2
, W2
)

.
Since the SVD of this 2 × 2 correlation matrix is

1 ρ
ρ 1

=

1
√
2
1
√
2
1
√
2
− 1
√
2
# 
1 + ρ 0
0 1 − ρ
 
1
√
2
1
√
2
1
√
2
− 1
√
2
#
,
we calculate
dW1
=
√
1 + ρ
√
2
dZ1
+
√
1 − ρ
√
2
dZ2
dW2
=
√
1 + ρ
√
2
dZ1
−
√
1 − ρ
√
2
dZ2
. (23)
Numerical Solution of Stochastic Differential Equations in Finance 19
−1 −0.5 0 0.5 1
0
0.5
1
1.5
2
2.5
correlation ρ
value
Fig. 8. European spread call value as a function of correlation. The Euler-
Maruyama solver was used with multifactor correlated Wiener processes. The initial
values of the underlying assets were X1(0) = 10, X2(0) = 8, the interest rate was
r = 0.05, strike price K = 2, and expiration time T = 0.5.
With a change of variables, the correlation ρ can be generated alternatively
as
dW1
= dZ1
dW2
= ρ dZ1
+
p
1 − ρ2 dZ2
. (24)
As a simple example, we calculate the value of a European spread call us-
ing Monte-Carlo estimation of noise-coupled stochastic differential equations
using a two-factor model. Assume there are two assets X1 and X2 satisfying
arbitrage-free SDE’s of form
dX1 = rX1 dt + σ1X1 dW1
dX1 = rX2 dt + σ2X3 dW2
(25)
where dW1
dW2
= ρ dt, and that the payout at expiration time T is
max{X1(T) − X2(T) − K, 0} for a strike price K. The Monte-Carlo approach
means estimating the expected value
E(e−rT
max{X1(T) − X2(T) − K, 0}).
Using either form (23) or (24) for the coupled Wiener increments in the Euler-
Maruyama paths, the correct price can be calculated. Fig. 8 shows the depen-
dence of the price on the two-market correlation ρ. As can be expected, the
more the assets move in an anticorrelated fashion, the more probable the
spread call will land in the money.
20 Timothy Sauer
7 Summary
Numerical methods for the solution of stochastic differential equations are
essential for the analysis of random phenomena. Strong solvers are neces-
sary when exploring characteristics of systems that depend on trajectory-level
properties. Several approaches exist for strong solvers, in particular Taylor and
Runge-Kutta type methods, although both increase greatly in complication
for orders greater than one.
In many financial applications, major emphasis is placed on the proba-
bility distribution of solutions, and in particular mean and variance of the
distribution. In such cases, weak solvers may suffice, and have the advantage
of comparatively less computational overhead, which may be crucial in the
context of Monte-Carlo simulation.
Independent of the choice of stochastic differential equation solver, meth-
ods of variance reduction exist that may increase computational efficiency.
The replacement of pseudorandom numbers with quasirandom analogues from
low-discrepancy sequences is applicable as long as statistical independence
along trajectories is maintained. In addition, control variates offer an alter-
nate means of variance reduction and increases in efficiency in Monte-Carlo
simulation of SDE trajectories.
References
Black F, Scholes M (1973) The pricing of options and corporate liabilities.
Journal of Political Economy 81:637–654
Box GEP, Muller M (1958) A note on the generation of random normal devi-
ates. Ann Math Stat 29:610–611
Burrage K, Burrage PM, Mitsui T (2000) Numerical solutions of stochastic
differential equations - implementation and stability issues. J Comp Appl
Math 125:171–182
Burrage K, Burrage PM, Tian T (2004) Numerical methods for strong solu-
tions of stochastic differential equations: an overview. Proc Roy Soc London
A 460:373-402
Fishman GS (1996) Monte Carlo: concepts, algorithms, and applications.
Springer, Berlin Heidelberg New York
Gentle JE (2003) Random number generation and Monte Carlo methods, 2nd
ed. Springer, Berlin Heidelberg New York
Gikhman I, Skorokhod A (1972) Stochastic differential equations. Springer,
Berlin.
Glasserman P (2004) Monte Carlo methods in financial engineering. Springer,
New York
Halton JH (1960) On the efficiency of certain quasi-random sequences of points
in evaluating multi-dimensional integrals. Numerische Mathematik 2:84–90
Numerical Solution of Stochastic Differential Equations in Finance 21
Hellekalek P (1998) Good random number generators are (not so) easy to
find. Math and Comp in Simulation 46:485-505
Higham DJ (2001) An algorithmic introduction to numerical simulation of
stochastic differential equations. SIAM Review 43:525–546
Higham DJ, Kloeden P (2005) Numerical methods for nonlinear stochastic
differential equations with jumps. Num Math 101:101-119
Higham DJ, Mao X, Stuart A (2002) Strong convergence of Euler-type meth-
ods for nonlinear stochastic differential equations. SIAM J Numer Anal
40:1041–1063
Hull JC (2002) Options, futures, and other derivatives, 5th ed. Prentice Hall,
Upper Saddle River, NJ
Jentzen A, Kloeden P,Neuenkirch A (2008) Pathwise approximation of
stochastic differential equations on domains: higher order convergence rates
without global Lipschitz coefficients. Num Math 112:41–64
Klebaner F (1998) Introduction to stochastic calculus with applications. Im-
perial College Press, London
Kloeden P, Platen E (1992) Numerical solution of stochastic differential equa-
tions. Springer, Berlin
Kloeden P, Platen E, Schurz H (1994) Numerical solution of SDE through
computer experiments. Springer, Berlin
Lamba H, Mattingly JC, Stuart A (2007) An adaptive Euler-Maruyama
scheme for SDEs: convergence and stability. IMA J Num Anal 27:479–506
Marsaglia G, Zaman A (1991) A new class of random number generators. Ann
Appl Prob 1:462–480
Marsaglia G, Tsang WW (2000) The ziggurat method for generating random
variables. J Stat Soft 5:1–7
Maruyama G (1955) Continuous Markov processes and stochastic equations.
Rend Circ Math Palermo 4:48–90
Milstein G (1988) A theorem on the order of convergence of mean-square ap-
proximations of solutions of stochastic differential equations. Theory Prob
Appl 32:738–741
Milstein G (1995) Numerical integration of stochastic differential equations.
Kluwer, Dordrecht
Milstein G, Tretyakov M (1997) Mean-square numerical methods for stochas-
tic differential equations with small noises. SIAM J Sci Comp 18:1067–1087
Milstein G, Tretyakov M (2004) Stochastic numerics for mathematical physics.
Springer, Berlin Heidelberg New York
Milstein G, Tretyakov M (2005) Numerical integration of stochastic differen-
tial equations with nonglobally Lipschitz coefficients. SIAM J Num Anal
43:1139–1154
Niederreiter H (1992) Random number generation and quasi-Monte Carlo
methods. SIAM Publications, Philadelphia
Niederreiter H (2010) Low-discrepancy simulation. This volume.
Oksendal B (1998) Stochastic differential equations: an introduction with ap-
plications, 5th ed. Springer, Berlin Heidelberg New York
22 Timothy Sauer
Park S, Miller K (1988) Random number generators: good ones are hard to
find. Comm ACM 31:1192–1201
Platen E (1987) Derivative-free numerical methods for stochastic differential
equations. Lec Notes Control Inform Sci 96:187–193
Platen E (1999) An introduction to numerical methods for stochastic differ-
ential equations. Acta Num 8:197-246
Platen E, Wagner W (1982) On a Taylor formula for a class of Ito processes.
Prob Math Stat 3:37–51
Romisch W, Winkler R (2006) Stepsize control for mean-square numerical
methods for stochastic differential equations with small noise. SIAM J Sci
Comp 28:604–625
Rubinstein RY (1981) Simulation and the Monte Carlo method. Wiley, New
York
Rumelin W (1982) Numerical treatment of stochastic differential equations.
SIAM J Num Anal 19:604–613
Saito Y, Mitsui T (1996) Stability analysis of numerical schemes for stochastic
differential equations. SIAM J Num Anal 33:2254-2267
Sauer T (2006) Numerical Analysis. Pearson, Boston
Steele JM (2001) Stochastic calculus and financial applications. Springer, New
York
Talay D, Tubaro L (1990) Expansion of the global error for numerical schemes
solving stochastic differential equations. Stoch Anal Appl 8:483–509
Tocino A, Ardanuy R (2002) Runge-Kutta methods for numerical solution of
stochastic differential equations. J Comp Appl Math 138:219-241

More Related Content

PDF
On estimating the integrated co volatility using
PDF
The_variational_iteration_method_for_solving_linea.pdf
PDF
A current perspectives of corrected operator splitting (os) for systems
PDF
Errors in the Discretized Solution of a Differential Equation
PDF
Computing f-Divergences and Distances of\\ High-Dimensional Probability Densi...
PDF
microproject@math (1).pdf
PDF
On the construction and comparison of an explicit iterative
PDF
PART I.4 - Physical Mathematics
On estimating the integrated co volatility using
The_variational_iteration_method_for_solving_linea.pdf
A current perspectives of corrected operator splitting (os) for systems
Errors in the Discretized Solution of a Differential Equation
Computing f-Divergences and Distances of\\ High-Dimensional Probability Densi...
microproject@math (1).pdf
On the construction and comparison of an explicit iterative
PART I.4 - Physical Mathematics

Similar to Numerical Solution of Stochastic Differential Equations in Finance (20)

PDF
Perdif Systems of Linear Differential.pdf
PDF
Numerical method for pricing american options under regime
PDF
Low rank tensor approximation of probability density and characteristic funct...
PDF
A Tau Approach for Solving Fractional Diffusion Equations using Legendre-Cheb...
PDF
Duke Mathematical Journal Volume 112 Jonathan Wahl Academic Editor
PDF
D021018022
PDF
International Journal of Mathematics and Statistics Invention (IJMSI)
PDF
Coueete project
PDF
Greens Function Estimates For Lattice Schrdinger Operators And Applications A...
PDF
Problem_Session_Notes
PDF
A Fast Numerical Method For Solving Calculus Of Variation Problems
PDF
Mathematical formulation of inverse scattering and korteweg de vries equation
PDF
02_AJMS_297_21.pdf
PDF
The Multivariate Gaussian Probability Distribution
PPT
Ch01 3
DOCX
Stochastic Calculus, Summer 2014, July 22,Lecture 7Con.docx
PPT
MATLAB ODE
PDF
Modeling an Asset Price
PDF
SUCCESSIVE LINEARIZATION SOLUTION OF A BOUNDARY LAYER CONVECTIVE HEAT TRANSFE...
PDF
Week 7
Perdif Systems of Linear Differential.pdf
Numerical method for pricing american options under regime
Low rank tensor approximation of probability density and characteristic funct...
A Tau Approach for Solving Fractional Diffusion Equations using Legendre-Cheb...
Duke Mathematical Journal Volume 112 Jonathan Wahl Academic Editor
D021018022
International Journal of Mathematics and Statistics Invention (IJMSI)
Coueete project
Greens Function Estimates For Lattice Schrdinger Operators And Applications A...
Problem_Session_Notes
A Fast Numerical Method For Solving Calculus Of Variation Problems
Mathematical formulation of inverse scattering and korteweg de vries equation
02_AJMS_297_21.pdf
The Multivariate Gaussian Probability Distribution
Ch01 3
Stochastic Calculus, Summer 2014, July 22,Lecture 7Con.docx
MATLAB ODE
Modeling an Asset Price
SUCCESSIVE LINEARIZATION SOLUTION OF A BOUNDARY LAYER CONVECTIVE HEAT TRANSFE...
Week 7
Ad

Recently uploaded (20)

PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPT
Project quality management in manufacturing
PPTX
Welding lecture in detail for understanding
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
Lecture Notes Electrical Wiring System Components
PDF
Digital Logic Computer Design lecture notes
PDF
composite construction of structures.pdf
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPTX
CH1 Production IntroductoryConcepts.pptx
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
Sustainable Sites - Green Building Construction
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
Foundation to blockchain - A guide to Blockchain Tech
Project quality management in manufacturing
Welding lecture in detail for understanding
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Lecture Notes Electrical Wiring System Components
Digital Logic Computer Design lecture notes
composite construction of structures.pdf
UNIT-1 - COAL BASED THERMAL POWER PLANTS
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
CH1 Production IntroductoryConcepts.pptx
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
CYBER-CRIMES AND SECURITY A guide to understanding
UNIT 4 Total Quality Management .pptx
Sustainable Sites - Green Building Construction
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
Ad

Numerical Solution of Stochastic Differential Equations in Finance

  • 1. Numerical Solution of Stochastic Differential Equations in Finance Timothy Sauer Department of Mathematics George Mason University Fairfax, VA 22030 tsauer@gmu.edu Abstract. This chapter is an introduction and survey of numerical solution methods for stochastic differential equations. The solutions will be continuous stochastic processes that represent diffusive dynamics, a common modeling assumption for financial systems. We include a review of fundamental con- cepts, a description of elementary numerical methods and the concepts of convergence and order for stochastic differential equation solvers. In the remainder of the chapter we describe applications of SDE solvers to Monte-Carlo sampling for financial pricing of derivatives. Monte-Carlo simu- lation can be computationally inefficient in its basic form, and so we explore some common methods for fostering efficiency by variance reduction and the use of quasi-random numbers. In addition, we briefly discuss the extension of SDE solvers to coupled systems driven by correlated noise, which is applicable to multiple asset markets. 1 Stochastic differential equations Stochastic differential equations (SDEs) have become standard models for fi- nancial quantities such as asset prices, interest rates, and their derivatives. Un- like deterministic models such as ordinary differential equations, which have a unique solution for each appropriate initial condition, SDEs have solutions that are continuous-time stochastic processes. Methods for the computational solution of stochastic differential equations are based on similar techniques for ordinary differential equations, but generalized to provide support for stochas- tic dynamics. We will begin with a quick survey of the most fundamental concepts from stochastic calculus that are needed to proceed with our description of nu- merical methods. For full details, the reader may consult Klebaner (1998); Oksendal (1998); Steele (2001).
  • 2. 2 Timothy Sauer A set of random variables Xt indexed by real numbers t ≥ 0 is called a continuous-time stochastic process. Each instance, or realization of the stochas- tic process is a choice from the random variable Xt for each t, and is therefore a function of t. Any (deterministic) function f(t) can be trivially considered as a stochastic process, with variance V (f(t)) = 0. An archetypal example that is ubiquitous in models from physics, chemistry, and finance is the Wiener process Wt, a continuous-time stochastic process with the following three properties: Property 1. For each t, the random variable Wt is normally distributed with mean 0 and variance t. Property 2. For each t1 < t2, the normal random variable Wt2 −Wt1 is indepen- dent of the random variable Wt1 , and in fact independent of all Wt, 0 ≤ t ≤ t1. Property 3. The Wiener process Wt can be represented by continuous paths. The Wiener process, named after Norbert Wiener, is a mathematical con- struct that formalizes random behavior characterized by the botanist Robert Brown in 1827, commonly called Brownian motion. It can be rigorously de- fined as the scaling limit of random walks as the step size and time interval between steps both go to zero. Brownian motion is crucial in the modeling of stochastic processes since it represents the integral of idealized noise that is in- dependent of frequency, called white noise. Often, the Wiener process is called upon to represent random, external influences on an otherwise deterministic system, or more generally, dynamics that for a variety of reasons cannot be deterministically modeled. A typical diffusion process in finance is modeled as a differential equation involving deterministic, or drift terms, and stochastic, or diffusion terms, the latter represented by a Wiener process, as in the equation dX = a(t, X) dt + b(t, X) dWt (1) Notice that the SDE (1) is given in differential form, unlike the derivative form of an ODE. That is because many interesting stochastic processes, like Brow- nian motion, are continuous but not differentiable. Therefore the meaning of the SDE (1) is, by definition, the integral equation X(t) = X(0) + Z t 0 a(s, y) ds + Z t 0 b(s, y) dWs, where the meaning of the last integral, called an Ito integral, will be defined next. Let c = t0 < t1 < . . . < tn−1 < tn = d be a grid of points on the interval [c, d]. The Riemann integral is defined as a limit Z d c f(x) dx = lim ∆t→0 n X i=1 f(t0 i)∆ti,
  • 3. Numerical Solution of Stochastic Differential Equations in Finance 3 where ∆ti = ti −ti−1 and ti−1 ≤ t0 i ≤ ti. Similarly, the Ito integral is the limit Z d c f(t) dWt = lim ∆t→0 n X i=1 f(ti−1)∆Wi where ∆Wi = Wti − Wti−1 , a step of Brownian motion across the interval. Note a major difference: while the t0 i in the Riemann integral may be chosen at any point in the interval (ti−1, ti), the corresponding point for the Ito integral is required to be the left endpoint of that interval. Because f and Wt are random variables, so is the Ito integral I = R d c f(t) dWt. The differential dI is a notational convenience; thus I = Z d c f dWt is expressed in differential form as dI = fdWt. The differential dWt of Brownian motion Wt is called white noise. A typical solution is a combination of drift and the diffusion of Brownian motion. To solve SDEs analytically, we need to introduce the chain rule for stochas- tic differentials, called the Ito formula: If Y = f(t, X), then dY = ∂f ∂t (t, X) dt + ∂f ∂x (t, X) dx + 1 2 ∂2 f ∂x2 (t, X) dx dx (2) where the dx dx term is interpreted by using the identities dt dt = 0 dt dWt = dWt dt = 0 dWt dWt = dt (3) The Ito formula is the stochastic analogue to the chain rule of conventional calculus. Although it is expressed in differential form for ease of understanding, its meaning is precisely the equality of the Ito integral of both sides of the equation. It is proved under rather weak hypotheses by referring the equation back to the definition of Ito integral (Oksendal, 1998). Some of the important features of typical stochastic differential equations can be illustrated using the following historically-pivotal example from fi- nance, often called the Black-Scholes diffusion equation: dX = µX dt + σX dWt X(0) = X0 (4)
  • 4. 4 Timothy Sauer with constants µ and σ. Although the equation is comparatively simple, the fact that it can be exactly solved led to its central importance, by making a closed-form formula available for the pricing of simple options (Black and Scholes, 1973). The solution of the Black-Scholes stochastic differential equation is geo- metric Brownian motion X(t) = X0e(µ− 1 2 σ2 )t+σWt . (5) To check this, write X = f(t, Y ) = X0eY , where Y = (µ − 1 2 σ2 )t + σWt. By the Ito formula, dX = X0eY dY + 1 2 eY dY dY where dY = (µ − 1 2 σ2 ) dt + σ dWt. Using the differential identities from the Ito formula, dY dY = σ2 dt, and therefore dX = X0eY (r − 1 2 σ2 ) dt + X0eY σ dWt + 1 2 σ2 eY dt = X0eY µ dt + X0eY σ dWt = µX dt + σX dWt as claimed. Fig. 1 shows a realization of geometric Brownian motion with constant drift coefficient µ and diffusion coefficient σ. Similar to the case of ordinary differen- tial equations, relatively few stochastic differential equations have closed-form solutions. It is often necessary to use numerical approximation techniques. 2 Numerical methods for SDEs. The simplest effective computational method for the approximation of or- dinary differential equations is Euler’s method (Sauer, 2006). The Euler- Maruyama method (Maruyama, 1955) is the analogue of the Euler method for ordinary differential equations. To develop an approximate solution on the interval [c, d], assign a grid of points c = t0 t1 t2 . . . tn = d. Approximate x values w0 w1 w2 . . . wn will be determined at the respective t points. Given the SDE initial value problem
  • 5. Numerical Solution of Stochastic Differential Equations in Finance 5 dX(t) = a(t, X)dt + b(t, X)dWt X(c) = Xc (6) we compute the approximate solution as follows: Euler-Maruyama Method w0 = X0 wi+1 = wi + a(ti, wi)∆ti+1 + b(ti, wi)∆Wi+1 (7) where ∆ti+1 = ti+1 − ti ∆Wi+1 = W(ti+1) − W(ti). (8) The crucial question is how to model the Brownian motion ∆Wi. Define N(0, 1) to be the standard random variable that is normally distributed with mean 0 and standard deviation 1. Each random number ∆Wi is computed as ∆Wi = zi p ∆ti (9) where zi is chosen from N(0, 1). Note the departure from the deterministic ordinary differential equation case. Each set of {w0, . . . , wn} produced by the Euler-Maruyama method is an approximate realization of the solution stochastic process X(t) which depends on the random numbers zi that were chosen. Since Wt is a stochastic process, each realization will be different and so will our approximations. As a first example, we show how to apply the Euler-Maruyama method to the Black Scholes SDE (4). The Euler-Maruyama equations (7) have form w0 = X0 (10) wi+1 = wi + µwi∆ti + σwi∆Wi. We will use the drift coefficient µ = 0.75 and diffusion coefficient σ = 0.30, which are values inferred from the series of market close share prices of Google, Inc. (NYSE ticker symbol GOOG) during the 250 trading days in 2009. To calculate the values µ and σ2 , the mean and variance, respectively, of the daily stock price returns were converted to an annual basis, assuming independence of the daily returns. An exact realization, generated from the solution (5), along with the cor- responding Euler-Maruyama approximation, are shown in Fig. 1. By corre- sponding, we mean that the approximation used the same Brownian motion realization as the true solution. Note the close agreement between the solution and the approximating points, plotted as small circles every 0.2 time units. In addition, the original time series of Google share prices is shown for com- parison. Both the original time series (grey curve) and the simulation from (5) (black curve) should be considered as realizations from the same diffusion process, with identical µ, σ and initial price X0 = 307.65.
  • 6. 6 Timothy Sauer 0 1 time (years) 300 600 price Fig. 1. Solution to the Black Scholes stochastic differential equation (4). The exact solution (5) is plotted as a black curve. The Euler-Maruyama approxima- tion with time step ∆t = 0.2 is plotted as circles. The drift and diffusion parameters are set to µ = 0.75 and σ = 0.30, respectively. Shown in grey is the actual stock price series, from which µ and σ were inferred. As another example, consider the Langevin equation dX(t) = −µX(t) dt + σ dWt (11) where µ and σ are positive constants. In this case, it is not possible to ana- lytically derive the solution to this equation in terms of simple processes. The solution of the Langevin equation is a stochastic process called the Ornstein- Uhlenbeck process. Fig. 2 shows one realization of the approximate solution. It was generated from an Euler-Maruyama approximation, using the steps w0 = X0 (12) wi+1 = wi − µwi∆ti + σ∆Wi for i = 1, . . . , n. This stochastic differential equation is used to model systems that tend to revert to a particular state, in this case the state X = 0, in the presence of a noisy background. Interest-rate models, in particular, often contain mean-reversion assumptions. 3 Strong convergence of SDE solvers. The definition of convergence is similar to the concept for ordinary differential equation solvers, aside from the differences caused by the fact that a solution
  • 7. Numerical Solution of Stochastic Differential Equations in Finance 7 0 1 2 3 4 −1 1 Fig. 2. Solution to Langevin equation (11). The upper path is the solution approximation for parameters µ = 10, σ = 1, computed by the Euler-Maruyama method. to an SDE is a stochastic process, and each computed trajectory is only one realization of that process. Each computed solution path w(t), using Euler- Maruyama for example, gives a random value at T, so that w(T) is a random variable as well. The difference between the values at time T, e(T) = X(T) − w(T), is therefore a random variable. A discrete-time approximation is said to converge strongly to the solution X(t) at time T if lim ∆t→0 E{|X(T) − w∆t(T)|} = 0 where w∆t is the approximate solution computed with constant stepsize ∆t, and E denotes expected value. For strongly convergent approximations, we further quantify the rate of convergence by the concept of order. An SDE solver converges strongly with order m if the expected value of the error is of mth order in the stepsize, i.e. if for any time T, E{|X(T) − w∆t(T)|} = O((∆t)m ) for sufficiently small stepsize ∆t. This definition generalizes the standard con- vergence criterion for ordinary differential equations, reducing to the usual definition when the stochastic part of the equation goes to zero. Although the Euler method for ordinary differential equations has order 1, the strong order for the Euler-Maruyama method for stochastic differential equations is 1/2. This fact was proved in Gikhman and Skorokhod (1972), under appropriate conditions on the functions a and b in (6). In order to build a strong order 1 method for SDEs, another term in the “stochastic Taylor series” must be added to the method. Consider the
  • 8. 8 Timothy Sauer stochastic differential equation dX(t) = a(X, t)dt + b(X, t)dWt X(0) = X0. (13) Milstein Method w0 = X0 wi+1 = wi + a(wi, ti)∆ti + b(wi, ti)∆Wi + 1 2 b(wi, ti) ∂b ∂x (wi, ti)(∆W2 i − ∆ti) (14) The Milstein Method has order one. Note that the Milstein Method is identical to the Euler-Maruyama Method if there is no X term in the diffusion part b(X, t) of the equation. In case there is, Milstein will in general converge to the correct stochastic solution process more quickly than Euler-Maruyama as the step size ∆ti goes to zero. For comparison of the Euler-Maruyama and Milstein methods, we apply them to the Black Scholes stochastic differential equation dX = µX dt + σX dWt. (15) We discussed the Euler-Maruyama approximation above. The Milstein Method becomes w0 = X0 (16) wi+1 = wi + µwi∆ti + σwi∆Wi + 1 2 σ(∆W2 i − ∆ti) Applying the Euler-Maruyama Method and the Milstein Method with de- creasing stepsizes ∆t results in successively improved approximations, as Table 1 shows: The two columns represent the average, over 100 realizations, of the error |w(T)−X(T)| at T = 8. The orders 1/2 for Euler-Maruyama and 1 for Milstein are clearly visible in the table. Cutting the stepsize by a factor of 4 is required to reduce the error by a factor of 2 with the Euler-Maruyama method. For the Milstein method, cutting the stepsize by a factor of 2 achieves the same result. The data in the table is plotted on a log-log scale in Fig. 3. The Milstein method is a Taylor method, meaning that it is derived from a truncation of the stochastic Taylor expansion of the solution. This is in many cases a disadvantage, since the partial derivative appears in the approximation method, and must be provided explicitly by the user. This is analogous to Tay- lor methods for solving ordinary differential equations, which are seldom used in practice for that reason. To counter this problem, Runge-Kutta methods were developed for ODEs, which trade these extra partial derivatives in the Taylor expansion for extra function evaluations from the underlying equation.
  • 9. Numerical Solution of Stochastic Differential Equations in Finance 9 Table 1. Average error at T = 8 of approximate solutions of (4). The error scales as ∆t1/2 for Euler-Maruyama and ∆t for Milstein. ∆t Euler-Maruyama Milstein 2−1 0.169369 0.063864 2−2 0.136665 0.035890 2−3 0.086185 0.017960 2−4 0.060615 0.008360 2−5 0.048823 0.004158 2−6 0.035690 0.002058 2−7 0.024277 0.000981 2−8 0.016399 0.000471 2−9 0.011897 0.000242 2−10 0.007913 0.000122 10 −4 10 −2 10 0 10 −4 10 −3 10 −2 10 −1 10 0 stepsize Δ t mean error Fig. 3. Error in the Euler-Maruyama and Milstein methods. Solution paths are computed for the geometric Brownian motion equation (15) and are compared to the correct X(T) given by (5). The absolute difference is plotted versus stepsize h for the two different methods. The Euler-Maruyama errors are plotted as circles and the Milstein error as squares. Note the slopes 1/2 and 1, respectively, on the log-log plot. In the stochastic differential equation context, the same trade can be made with the Milstein method, resulting in a strong order 1 method that requires evaluation of b(X) at two places on each step. A heuristic derivation can be carried out by making the replacement bx(wi) ≈ b(wi + b(wi) √ ∆ti) − b(wi) b(wi) √ ∆ti in the Milstein formula (14), which leads to the following method (Rumelin, 1982):
  • 10. 10 Timothy Sauer Strong Order 1.0 Runge-Kutta Method w0 = X0 wi+1 = wi + a(wi)∆ti + b(wi)∆Wi + 1 2 [b(wi + b(wi) p ∆ti) − b(wi)](∆W2 i − ∆ti)/ p ∆ti The orders of the methods introduced here for SDEs, 1/2 for Euler- Maruyama and 1 for Milstein and the Runge-Kutta counterpart, would be considered low by ODE standards. Higher-order methods can be developed for SDEs, but become much more complicated as the order grows. As an ex- ample, consider the strong order 1.5 scheme for the SDE (13) proposed in Platen and Wagner (1982): Strong Order 1.5 Taylor Method w0 = X0 wi+1 = wi + a∆ti + b∆Wi + 1 2 bbx(∆W2 i − ∆ti) + ayσ∆Zi + 1 2 (aax + 1 2 b2 axx)∆t2 i + (abx + 1 2 b2 bxx)(∆Wi∆ti − ∆Zi) + 1 2 b(bbxx + b2 x)(1 3 ∆W2 i − ∆ti)∆Wi (17) where partial derivatives are denoted by subscripts, and where the additional random variable ∆Zi is normally distributed with mean 0, variance E(∆Z2 i ) = 1 3 ∆t3 i and correlated with ∆Wi with covariance E(∆Zi∆Wi) = 1 2 ∆t2 i . Note that ∆Zi can be generated as ∆Zi = 1 2 ∆ti(∆Wi + ∆Vi/ √ 3) where ∆Vi is chosen independently from √ ∆tiN(0, 1). Whether higher-order methods are needed in a given application depends on how the resulting approximate solutions are to be used. In the ordinary differential equation case, the usual assumption is that the initial condition and the equation are known with accuracy. Then it makes sense to calculate the solution as closely as possible to the same accuracy, and higher-order methods are called for. In the context of stochastic differential equations, in particular if the initial conditions are chosen from a probability distribution, the advantages of higher-order solvers are often less compelling, and if they come with added computational expense, may not be warranted. 4 Weak convergence of SDE solvers Strong convergence allows accurate approximations to be computed on an individual realization basis. For some applications, such detailed pathwise
  • 11. Numerical Solution of Stochastic Differential Equations in Finance 11 information is required. In other cases, the goal is to ascertain the probability distribution of the solution X(T), and single realizations are not of primary interest. Weak solvers seek to fill this need. They can be simpler than corresponding strong methods, since their goal is to replicate the probability distribution only. The following additional definition is useful. A discrete-time approximation w∆t with step-size ∆t is said to converge weakly to the solution X(T) if lim ∆t→0 E{f(w∆t(T))} = E{f(X(T))} for all polynomials f(x). According to this definition, all moments converge as ∆t → 0. If the stochastic part of the equation is zero and the initial value is deterministic, the definition agrees with the strong convergence definition, and the usual ordinary differential equation definition. Weakly convergent methods can also be assigned an order of convergence. We say that a the solver converges weakly with order m if the error in the moments is of mth order in the stepsize, or |E{f(X(T))} − E{f(w∆t(T))}| = O((∆t)m ) for sufficiently small stepsize ∆t. In general, the rates of weak and strong convergence do not agree. Unlike the case of ordinary differential equations, where the Euler method has order 1, the Euler-Maruyama method for SDEs has strong order m = 1/2. However, Euler-Maruyama is guaranteed to converge weakly with order 1. Higher order weak methods can be much simpler than corresponding strong methods, and are available in several different forms. The most direct approach is to exploit the Ito-Taylor expansion (Kloeden and Platen, 1992), the Ito calculus analogue of the Taylor expansion of deterministic functions. An example SDE solver that converges weakly with order 2 is the following: Weak Order 2 Taylor Method w0 = X0 wi+1 = wi + a∆ti + b∆Wi + 1 2 bbx(∆W2 i − ∆ti) + axb∆Zi + 1 2 (aax + 1 2 axxb2 )∆t2 + (abx + 1 2 bxxb2 )(∆Wi∆ti − ∆Zi) (18) where ∆Wi is chosen from √ ∆tiN(0, 1) and ∆Zi is distributed as in the above Strong Order 1.5 Method. A second approach is to mimic the idea of Runge-Kutta solvers for ordinary differential equations. These solvers replace the explicit higher derivatives in the Ito-Taylor solvers with extra function evaluations at interior points of the current solution interval. Platen (1987) proposed the following weak order 2 solver of Runge-Kutta type:
  • 12. 12 Timothy Sauer Weak Order 2 Runge-Kutta Method w0 = X0 wi+1 = wi + 1 2 [a(u) + a(wi)]∆ti + 1 4 [b(u+) + b(u−) + 2b(wi)]∆Wi + 1 4 [b(u+) − b(u−)](∆W2 i − ∆t)/ p ∆ti (19) where u = wi + a∆ti + b∆Wi u+ = wi + a∆ti + b p ∆ti u− = wi + a∆ti − b p ∆ti. 10 −2 10 −1 10 0 10 −4 10 −3 10 −2 10 −1 10 0 time step Δ t error Fig. 4. The mean error of the estimation of E(X(T)) for SDE (15). The plot compares the Euler-Maruyama method (circles) which has weak order 1, and the weak order 2 Runge-Kutta type method (squares) given in (19). Parameter used were X(0) = 10, T = 1, µ = −3, σ = 0.2. Fig. 4 compares the Euler-Maruyama method, which converges with order 1 in the weak sense, to the Weak Order 2 Runge-Kutta-Type Method. Note the difference between strong and weak convergence. In the previous Fig. 3, which considers strong convergence, the mean error of the estimate of a point X(T) on the solution curve was plotted. In Fig. 4, on the other hand, the mean error of the estimate of the expected value E[X(T)] is plotted, since we are comparing weak convergence of the methods. The weak orders are clearly revealed by the log-log plot.
  • 13. Numerical Solution of Stochastic Differential Equations in Finance 13 Several other higher-order weak solvers can be found in Kloeden and Platen (1992). Weak Taylor methods of any order can be constructed, as well as Runge-Kutta analogues that reduce or eliminate the derivative cal- culations. In addition, standard Richardson extrapolation techniques (Sauer, 2006) can be used to bootstrap weak method approximations of a given order to the next order. See Kloeden and Platen (1992) for full details. Weak solvers are often an appropriate choice for financial models, when the goal is to investigate the probability distribution of an asset price or interest rate, or when Monte-Carlo sampling is used to price a complicated derivative. In such cases it is typical to be primarily interested in one of the statistical moments of a stochastically-defined quantity, and weak methods may be simpler and still sufficient for the sampling purpose. In the next section we explore some of the most common ways SDE solvers are used to carry out Monte-Carlo simulations for derivative pricing. 5 Monte-Carlo sampling of SDE paths for option pricing As an illustrative example of the use of SDE solvers for option pricing, consider the European call, whose value at expiration time T is max{X(T) − K, 0}, where X(t) is the price of the underlying stock, K is the strike price. The no- arbitrage assumptions of Black-Scholes theory imply that the present value of such an option is C(X0, T) = e−rT E(max{X(T) − K, 0}) (20) where r is the fixed prevailing interest rate during the time interval [0, T], and where the underlying stock price X(t) satisfies the stochastic differential equation dX = rX dt + σX dWt. The value of the call option can be determined by calculating the expected value (20) explicitly. Using the Euler-Maruyama method for following solu- tions to the Black-Scholes SDE, the value X(T) at the expiration time T can be determined for each path, or realization of the stochastic process. For a given n realizations, the average hmax{X(T) − K, 0}i can be used as an ap- proximation to the expected value in (20). Carrying this out and comparing with the exact solution from the Black-Scholes formula C(X, T) = XN(d1) − Ke−rT N(d2) (21) where d1 = log(X/K) + (r + 1 2 σ2 )T σ √ T , d2 = log(X/K) + (r − 1 2 σ2 )T σ √ T , yields the errors plotted as circles in Fig. 5.
  • 14. 14 Timothy Sauer 10 2 10 3 10 −2 10 −1 10 0 number of realizations n error Fig. 5. Option pricing comparison between pseudo-random and quasi- random numbers. Circles (squares) represent error in Monte-Carlo estimation of European call by following SDE paths using pseudo-random (quasi-random) num- bers to generate increments. Settings were X(0) = 10, K = 12, r = 0.05, σ = 0.5, expiration time T = 0.5. The number of Wiener increments per trajectory was m = 8. The results above were attained using pseudo-random numbers to generate the Wiener increments ∆W in the Euler-Maruyama method. An improvement in accuracy can be achieved by using quasi-random numbers instead. By definition, standard normal pseudo-random numbers are created to be independent and identically-distributed, where the distribution is the stan- dard normal distribution. For many Monte-Carlo sampling problems, the in- dependence is not crucial to the computation. If that assumption can be dis- carded, then there are more efficient ways to sample, using what are called low- discrepancy sequences. Such quasi-random sequences are identically-distributed but not independent. Their advantage is that they are better at self-avoidance than pseudo-random numbers, and by essentially reducing redundancy they can deliver Monte-Carlo approximations of significantly reduced variance with the same number of realizations. Consider the problem of estimating an expected value like (20) by calculat- ing many realizations. By Property 2 of the Wiener process, the m increments ∆W1, . . . , ∆Wm of each realization must be independent. Therefore along the trajectories, independence must be preserved. This is accomplished by using m different low-discepancy sequences along the trajectory. For example, the base-p low discrepancy sequences due to Halton (1960) for m different prime numbers p can be used along the trajectory, while the sequences themselves run across different realizations.
  • 15. Numerical Solution of Stochastic Differential Equations in Finance 15 Fig. 5 shows a comparison of errors for the Monte-Carlo pricing of the European call, using this approach to create quasi-random numbers. The low-discrepancy sequences produce nonindependent uniform random numbers, and must be run through the Box-Muller method (Box and Muller, 1958) to produce normal quasi-random numbers. The pseudo-random sequences show error proportional to n−0.5 , while the quasi-random appear to follow approx- imately n−0.7 . More sophisticated low-discrepancy sequences, due to Faure, Niederreiter, Xing, and others, have been developed and can be shown to be more effi- cient than the Halton sequences. The chapter in this volume by Niederreiter (Niederreiter, 2010) describes the state of the art in generating such sequences. 10 2 10 3 10 4 10 −2 10 −1 10 0 number of realizations n error Fig. 6. Pricing error for barrier down-and-out call option. Error is propor- tional to the square root of the number of Monte-Carlo realizations. The quasi-random approach can become too cumbersome if the number of steps m along each SDE trajectory becomes large. As an example, consider a barrier option, whose value is a function of the entire trajectory. For a down- and-out barrier call, the payout is canceled if the underlying stock drops belong a certain level during the life of the option. Therefore, at time T the payoff is max(X(T) − K, 0) if X(t) L for 0 t T, and 0 otherwise. For such an option, accurate pricing is dependent on using a relatively large number of steps m per trajectory. Results of a Monte-Carlo simulation of this modified call option are shown in Fig. 6, where the error was computed by comparison with the exact price V (X, T) = C(X, T) − X L 1− 2r σ2 C(L2 /X, T)
  • 16. 16 Timothy Sauer where C(X, t) is the standard European call value with strike price K. The tra- jectories were generated with Euler-Maruyama approximations with pseudo- random number increments, where m = 1000 steps were used. Other approaches to making Monte-Carlo sampling of trajectories more efficient fall under the umbrella of variance reduction. The idea is to calculate the expected value more accurately with fewer calls to the random number generator. The concept of antithetic variates is to follow SDE solutions in pairs, using the Wiener increment in one solutions and its negative in the other solution at each step. Due to the symmetry of the Wiener process, the solutions are equally likely. For the same number of random numbers generated, the standard error is decreased by a factor of √ 2. A stronger version of variance reduction in computing averages from SDE trajectories can be achieved with control variates. We outline one such ap- proach, known as variance reduction by delta-hedging. In this method the quantity that is being estimated by Monte-Carlo is replaced with an equiva- lent quantity of smaller variance. For example, instead of approximating the expected value of (20), the cash portion of the replicating portfolio of the Eu- ropean call can be targeted, since it must equal the option price at expiration. 10 1 10 2 10 3 10 −3 10 −2 10 −1 number of realizations n error Fig. 7. Estimation errors for European call using control variates. Error is proportional to the square root of the number of Monte-Carlo realizations. Compare absolute levels of error with Fig. 5. Let C0 be the option value at time t = 0, which is the goal of the calcula- tion. At the time t = 0, the seller of the option hedges by purchasing ∆ = ∂C ∂X shares of the underlying asset. Thus the cash account, valued forward to time T, holds [C0 − ∂C ∂X (t0)Xt0 ]er(T −t0) .
  • 17. Numerical Solution of Stochastic Differential Equations in Finance 17 At time step t = t1, the seller needs to hold ∆ = ∂C ∂X (t1) shares, so after purchasing ∂C ∂X (t1) − ∂C ∂X (t0) shares, the cash account (valued forward) drops by ∂C ∂X (t1) − ∂C ∂X (t0)]Xt1 er(T −t1) . Continuing in this way, the cash account of the replicating portfolio at time T, which must be CT , equals C0er(T −t0) − N X k=0 ∂C ∂X (tk) − ∂C ∂X (tk−1) Xtk er(T −tk) = C0er(T −t0) + N−1 X k=0 ∂C ∂X (tk)(Xtk+1 − Xtk er∆t )er(T −tk+1) and so C0 = e−r(T −t0) CT − N−1 X k=0 ∂C ∂X (tk)(Xtk+1 − Xtk er∆t )er(T −tk+1) # = e−r(T −t0) [CT − cv] where cv denotes the control variate. Estimating the expected value of this expression yields fast convergence, as demonstrated in Fig. 7. Compared to Fig. 5, the errors in pricing of the European call are lower by an order of magnitude for a similar number of realizations. However, the calculation of the control variate adds significantly to the computational load, and depending on the form of the derivative, may add more overhead than is gained from the reduced variance in some cases. 6 Multifactor models Financial derivatives that depend on a variety of factors should be modeled as a stochastic process that is driven by a multidimensional Wiener process. The various random factors may be independent, but more realistically, there is often correlation between the random inputs. For multifactor Wiener processes (W1 t , . . . , Wk t ), the generalization of Ito’s Formula requires that (3) is replaced with dt dt = 0 dt dWi t = dWi t dt = 0 dWi t dWj t = ρij dt (22) where ρij represents the statistical correlation between Wi t and Wj t . As usual, correlation ρ of two random variables X1 and X2 is defined as
  • 18. 18 Timothy Sauer ρ(X1, X2) = cov(X1, X2) p V (X1) p V (X2) . Note that ρ(X1, X1) = 1, and X1 and X2 are uncorrelated if ρ(X1, X2) = 0. To construct discretized correlated Wiener processes for use in SDE solvers, we begin with a desired correlation matrix R =    ρ11 · · · ρ1k . . . . . . ρk1 · · · ρkk    that we would like to specify for Wiener processes W1 , . . . , Wk . The matrix R is symmetric with units on the main diagonal. A straightforward way to create noise processes with a specified correlation is through the singular value decomposition (SVD) (see Sauer (2006) for a description). The SVD of R is R = ΓΛΓ where Γ is an orthogonal matrix (Γ−1 = Γ ), and Λ is a diagonal matrix with nonzero entries on the main diagonal. Begin with k independent, uncorrelated Wiener processes Z1, . . . , Zk, sat- isfying dZidZi = dt, dZidZj = 0 for i 6= j. Define the column vector dW = ΓΛ1/2 dZ, and check that the covariance matrix, and therefore the correlation matrix, of dW is dWdW = ΓΛ1/2 dZ(ΓΛ1/2 dZ) = ΓΛ1/2 dZdZ Λ1/2 Γ = ΓΛΓ dt = R dt For example, a two-asset market has correlation matrix R = 1 ρ ρ 1 = corr(W1 , W1 ) corr(W1 , W2 ) corr(W2 , W1 ) corr(W2 , W2 ) . Since the SVD of this 2 × 2 correlation matrix is 1 ρ ρ 1 = 1 √ 2 1 √ 2 1 √ 2 − 1 √ 2 # 1 + ρ 0 0 1 − ρ 1 √ 2 1 √ 2 1 √ 2 − 1 √ 2 # , we calculate dW1 = √ 1 + ρ √ 2 dZ1 + √ 1 − ρ √ 2 dZ2 dW2 = √ 1 + ρ √ 2 dZ1 − √ 1 − ρ √ 2 dZ2 . (23)
  • 19. Numerical Solution of Stochastic Differential Equations in Finance 19 −1 −0.5 0 0.5 1 0 0.5 1 1.5 2 2.5 correlation ρ value Fig. 8. European spread call value as a function of correlation. The Euler- Maruyama solver was used with multifactor correlated Wiener processes. The initial values of the underlying assets were X1(0) = 10, X2(0) = 8, the interest rate was r = 0.05, strike price K = 2, and expiration time T = 0.5. With a change of variables, the correlation ρ can be generated alternatively as dW1 = dZ1 dW2 = ρ dZ1 + p 1 − ρ2 dZ2 . (24) As a simple example, we calculate the value of a European spread call us- ing Monte-Carlo estimation of noise-coupled stochastic differential equations using a two-factor model. Assume there are two assets X1 and X2 satisfying arbitrage-free SDE’s of form dX1 = rX1 dt + σ1X1 dW1 dX1 = rX2 dt + σ2X3 dW2 (25) where dW1 dW2 = ρ dt, and that the payout at expiration time T is max{X1(T) − X2(T) − K, 0} for a strike price K. The Monte-Carlo approach means estimating the expected value E(e−rT max{X1(T) − X2(T) − K, 0}). Using either form (23) or (24) for the coupled Wiener increments in the Euler- Maruyama paths, the correct price can be calculated. Fig. 8 shows the depen- dence of the price on the two-market correlation ρ. As can be expected, the more the assets move in an anticorrelated fashion, the more probable the spread call will land in the money.
  • 20. 20 Timothy Sauer 7 Summary Numerical methods for the solution of stochastic differential equations are essential for the analysis of random phenomena. Strong solvers are neces- sary when exploring characteristics of systems that depend on trajectory-level properties. Several approaches exist for strong solvers, in particular Taylor and Runge-Kutta type methods, although both increase greatly in complication for orders greater than one. In many financial applications, major emphasis is placed on the proba- bility distribution of solutions, and in particular mean and variance of the distribution. In such cases, weak solvers may suffice, and have the advantage of comparatively less computational overhead, which may be crucial in the context of Monte-Carlo simulation. Independent of the choice of stochastic differential equation solver, meth- ods of variance reduction exist that may increase computational efficiency. The replacement of pseudorandom numbers with quasirandom analogues from low-discrepancy sequences is applicable as long as statistical independence along trajectories is maintained. In addition, control variates offer an alter- nate means of variance reduction and increases in efficiency in Monte-Carlo simulation of SDE trajectories. References Black F, Scholes M (1973) The pricing of options and corporate liabilities. Journal of Political Economy 81:637–654 Box GEP, Muller M (1958) A note on the generation of random normal devi- ates. Ann Math Stat 29:610–611 Burrage K, Burrage PM, Mitsui T (2000) Numerical solutions of stochastic differential equations - implementation and stability issues. J Comp Appl Math 125:171–182 Burrage K, Burrage PM, Tian T (2004) Numerical methods for strong solu- tions of stochastic differential equations: an overview. Proc Roy Soc London A 460:373-402 Fishman GS (1996) Monte Carlo: concepts, algorithms, and applications. Springer, Berlin Heidelberg New York Gentle JE (2003) Random number generation and Monte Carlo methods, 2nd ed. Springer, Berlin Heidelberg New York Gikhman I, Skorokhod A (1972) Stochastic differential equations. Springer, Berlin. Glasserman P (2004) Monte Carlo methods in financial engineering. Springer, New York Halton JH (1960) On the efficiency of certain quasi-random sequences of points in evaluating multi-dimensional integrals. Numerische Mathematik 2:84–90
  • 21. Numerical Solution of Stochastic Differential Equations in Finance 21 Hellekalek P (1998) Good random number generators are (not so) easy to find. Math and Comp in Simulation 46:485-505 Higham DJ (2001) An algorithmic introduction to numerical simulation of stochastic differential equations. SIAM Review 43:525–546 Higham DJ, Kloeden P (2005) Numerical methods for nonlinear stochastic differential equations with jumps. Num Math 101:101-119 Higham DJ, Mao X, Stuart A (2002) Strong convergence of Euler-type meth- ods for nonlinear stochastic differential equations. SIAM J Numer Anal 40:1041–1063 Hull JC (2002) Options, futures, and other derivatives, 5th ed. Prentice Hall, Upper Saddle River, NJ Jentzen A, Kloeden P,Neuenkirch A (2008) Pathwise approximation of stochastic differential equations on domains: higher order convergence rates without global Lipschitz coefficients. Num Math 112:41–64 Klebaner F (1998) Introduction to stochastic calculus with applications. Im- perial College Press, London Kloeden P, Platen E (1992) Numerical solution of stochastic differential equa- tions. Springer, Berlin Kloeden P, Platen E, Schurz H (1994) Numerical solution of SDE through computer experiments. Springer, Berlin Lamba H, Mattingly JC, Stuart A (2007) An adaptive Euler-Maruyama scheme for SDEs: convergence and stability. IMA J Num Anal 27:479–506 Marsaglia G, Zaman A (1991) A new class of random number generators. Ann Appl Prob 1:462–480 Marsaglia G, Tsang WW (2000) The ziggurat method for generating random variables. J Stat Soft 5:1–7 Maruyama G (1955) Continuous Markov processes and stochastic equations. Rend Circ Math Palermo 4:48–90 Milstein G (1988) A theorem on the order of convergence of mean-square ap- proximations of solutions of stochastic differential equations. Theory Prob Appl 32:738–741 Milstein G (1995) Numerical integration of stochastic differential equations. Kluwer, Dordrecht Milstein G, Tretyakov M (1997) Mean-square numerical methods for stochas- tic differential equations with small noises. SIAM J Sci Comp 18:1067–1087 Milstein G, Tretyakov M (2004) Stochastic numerics for mathematical physics. Springer, Berlin Heidelberg New York Milstein G, Tretyakov M (2005) Numerical integration of stochastic differen- tial equations with nonglobally Lipschitz coefficients. SIAM J Num Anal 43:1139–1154 Niederreiter H (1992) Random number generation and quasi-Monte Carlo methods. SIAM Publications, Philadelphia Niederreiter H (2010) Low-discrepancy simulation. This volume. Oksendal B (1998) Stochastic differential equations: an introduction with ap- plications, 5th ed. Springer, Berlin Heidelberg New York
  • 22. 22 Timothy Sauer Park S, Miller K (1988) Random number generators: good ones are hard to find. Comm ACM 31:1192–1201 Platen E (1987) Derivative-free numerical methods for stochastic differential equations. Lec Notes Control Inform Sci 96:187–193 Platen E (1999) An introduction to numerical methods for stochastic differ- ential equations. Acta Num 8:197-246 Platen E, Wagner W (1982) On a Taylor formula for a class of Ito processes. Prob Math Stat 3:37–51 Romisch W, Winkler R (2006) Stepsize control for mean-square numerical methods for stochastic differential equations with small noise. SIAM J Sci Comp 28:604–625 Rubinstein RY (1981) Simulation and the Monte Carlo method. Wiley, New York Rumelin W (1982) Numerical treatment of stochastic differential equations. SIAM J Num Anal 19:604–613 Saito Y, Mitsui T (1996) Stability analysis of numerical schemes for stochastic differential equations. SIAM J Num Anal 33:2254-2267 Sauer T (2006) Numerical Analysis. Pearson, Boston Steele JM (2001) Stochastic calculus and financial applications. Springer, New York Talay D, Tubaro L (1990) Expansion of the global error for numerical schemes solving stochastic differential equations. Stoch Anal Appl 8:483–509 Tocino A, Ardanuy R (2002) Runge-Kutta methods for numerical solution of stochastic differential equations. J Comp Appl Math 138:219-241