• Ei tuloksia

Numerical Simulation of Stochastic Di erential Equations

N/A
N/A
Info
Lataa
Protected

Academic year: 2022

Jaa "Numerical Simulation of Stochastic Di erential Equations"

Copied!
51
0
0

Kokoteksti

(1)

LAPPEENRANTA UNIVERSITY OF TECHNOLOGY Faculty of Technology

Department of Mathematics and Physics

Alain Christian Nsengiyumva

NUMERICAL SIMULATION OF STOCHASTIC DIFFERENTIAL EQUATIONS

Examiners: Professor Heikki Haario.

Professor Matti Heiliö.

(2)

Lappeenranta University of Technology Department of Mathematics and Physics Alain Christian Nsengiyumva

Numerical Simulation of Stochastic Dierential Equations Master's thesis

2013

51 pages, 8 gures, 6 tables

Examiners: Professor Heikki Haario.

Professor Matti Heiliö.

Key words: Stochastic dierential equations, Euler-Maruyama method, Milstein method, Runge-Kutta method, Shoji-Ozaki schemes, Kalman lter, Extended Kalman lter, Epidemic models.

Stochastic dierential equation (SDE) is a dierential equation in which some of the terms and its solution are stochastic processes. SDEs play a central role in modeling physical systems like nance, Biology, Engineering, to mention some. In modeling process, the computation of the trajectories (sample paths) of solutions to SDEs is very important. However, the exact solution to a SDE is generally dicult to obtain due to non-dierentiability character of realizations of the Brownian motion.

There exist approximation methods of solutions of SDE. The solutions will be con- tinuous stochastic processes that represent diusive dynamics, a common modeling assumption for nancial, Biology, physical, environmental systems. This Masters' thesis is an introduction and survey of numerical solution methods for stochastic dif- ferential equations. Standard numerical methods, local linearization methods and ltering methods are well described. We compute the root mean square errors for each method from which we propose a better numerical scheme.

Stochastic dierential equations can be formulated from a given ordinary dierential equations. In this thesis, we describe two kind of formulations: parametric and non- parametric techniques. The formulation is based on epidemiological SEIR model.

This methods have a tendency of increasing parameters in the constructed SDEs, hence, it requires more data. We compare the two techniques numerically.

(3)

Acknowledgements

I would like to express my deep appreciation to the Department of Mathematics, Lappeenranta University of Technology (LUT), for the scholarship granted during my studies.

My sincere gratitude to my guide Professor Heikki Haario for supervising this thesis.

I also thank Professor Matti Heiliö for being my second supervisor. Special thanks goes to Isambi Sailon Mbalawata for his assistance and support rendered to me during my studies.

Thanks to all my friends and classmates at LUT and National University of Rwanda who encouraged me a lot in this project.

I owe my gratitude to my late father Mr. Nsengiyumva Léopold, my mother Mrs. Mukanyarwaya Félicité, my sister Gloriose Nsengiyumva and to the Family Twahirwa Manassé; as well as my Wife and Son who supported me a lot; for their blessings and inspiration.

"Mwarakoze cyane"

Lappeenranta; November 18, 2013 Alain Christian Nsengiyumva

(4)

Contents

1 Introduction 1

2 Stochastic Calculus 3

2.1 Brownian Motion . . . 4

2.1.1 Brownian Motion as a Limit of Random Walks . . . 5

2.2 Itô integral . . . 6

2.3 Stratonovich integrals . . . 8

2.4 Itô Formula . . . 9

2.5 Stochastic Dierential Equations . . . 10

3 Standard Numerical Methods 12 3.1 EulerMaruyama Numerical Scheme . . . 12

3.2 Milstein Numerical Scheme . . . 15

3.3 RungeKutta Numerical Scheme . . . 18

4 Other Numerical Methods 20 4.1 Ozaki Scheme . . . 20

4.2 ShojiOzaki Scheme . . . 20

4.3 Kalman lter . . . 21

4.4 Extended Kalman Filter . . . 23

5 Formulation of Stochastic Epidemic Models 25 5.1 Parametric Perturbation Itô Stochastic Dierential Equations . . . . 26

(5)

CONTENTS iv 5.2 Non-Parametric Perturbation Itô Stochastic Dierential Equations . . 28

6 Numerical Simulations 31

6.1 Stochastic Biochemical Oxygen Demand Model . . . 31 6.2 Nonlinear SDE . . . 36

7 Conclusion and Discussion 43

(6)

1 Introduction

Stochastic dierential equations (SDEs) were rst initiated and developed by Ito (1942). The theory of (SDE's) provides a useful tool to introduce stochasticity into models and to characterize the evolution of many processes in nance, Mathematics, Physics, Chemistry, Biology, Medical science, and almost all sciences. In many cases, the solutions are not given explicitly due to non-dierentiability character of realizations of the Brownian motion; therefore numerical approximations are used to study the properties of these models.

The convergence of numerical schemes for SDEs needs conditions on the drift and diusion coecients. These conditions are namely linear growth and global Lipschitz conditions (Skorochod, 1965; Kloeden and Platen, 1999; Mao, 1997). We note that Yamada (1978) relaxed the global Lipschitz condition, whilst Kaneko and Nakao (1988) have shown that the Euler scheme converges in the strong sense, to the solution of the stochastic deferential equation whenever path-wise uniqueness of the solution holds. However, both results require the linear growth condition whilst the latter provides no information on the order of the approximation. Marion et al.

(2002) have shown the convergence in Probability, of the Euler scheme under specic conditions on the coecients.

The basic theoretical problems concerned with stochastic dierential equations are, generally speaking, the same as those in the case of deterministic dierential equa- tions, namely: existence and uniqueness of a solution, analytical properties of the solutions, dependence of the solutions on parameters and initial values etc. Yet, the introduction of random elements into appropriate dierential equations leads to new probabilistic problems and specic diculties. For instance, the sense itself of a stochastic dierential equation should be clearly dened since it can be dierent depending on the understanding of a stochastic process and its derivatives. For the analysis of stochastic dierential equations, however, a crucial point is regularity of random functions occurring in a given equation.

In this thesis the aim is to study how to simulate the linear and nonlinear SDE. We review standard numerical methods like Euler-Maruyama, Milstein, Runge-Kutta schemes. Similar we study the local linearization methods namely Ozaki and Shoji- Ozaki schemes. We introduce the ltering techniques, particularly Kalman lter for linear SDEs and extended Kalman lter for nonlinear SDEs. The aim is to see which numerical simulation method is better. The criterion of selecting the better numerical method is by computing the root mean square errors (RMSEs), that is,

(7)

1 INTRODUCTION 2 the lower the RMSE the better the method.

We Also study how to construct the SDE given a deterministic model, here we review two modeling procedures: parametric and non-parametric methods. The emphasize is on epidemiological SEIR models. Of course, it is possible to apply the same techniques to other models. when to use a deterministic model or stochastic model? This is a question that one asks before starting modeling. We give the dierence between deterministic and stochastic models in the context of epidemic models. However in general, one chooses a model that ts the problem. The problem will always determine whether stochastic or deterministic model is needed.

The structure of this thesis is as follows. In Section 2, the stochastic calculus is reviewed where Brownian motion, Stochastic Integrals, Itô formula and Stochas- tic dierential Equation are discussed. Section 3, deals with Standards numerical methods where Euler-Maruyama, Milstein and RungeKutta numerical schemes are reviewed. Section 4, contain local linearlization methods: Ozaki and ShojiOzaki schemes as well as Kalman lter and extended Kalman lter. Section 5 is devoted for construction of epidemiological SEID SDE from from a deterministic SEIR while Section 6 is about numerical simulations of Linear SDE and Nonlinear SDE. The conclusion of this work is found in in Section 7.

(8)

2 Stochastic Calculus

This section is devoted to introduce the stochastic processes and some general def- initions. We discuss stochastic calculus which provides a mathematical foundation for the treatment of stochastic dierential. If we allow some randomness in some of the parameters of a dierential equation, we obtain mathematical model that contain possible uncertainties of the situation.

Let N(t) be the size of the population at time t, and a(t) is the relative rate of growth at timet. Consider the following ordinary dierential equation (ODE) that describes a simple population growth model (Øksendal, 2003).

dN

dt =a(t)N(t), (1)

where the initial population is N(0) = N0. From the model (1) above, it might happen that the parametera(t)is not known, but subject to some random environ- mental eects. to include the randomness, we introduce the noise to the parameter, that is we dene

a(t) =r(t) +"noise",

where the behavior of the noise term is unknown but its probability distribution.

We can re-write (1) using new perturbed parameter. This result to.

dN

dt = (r(t) +"noise")N(t) or more generally in the form

dX

dt =b(t,xt) +σ(t,xt)"noise", (2) where b and σ are some given functions. We can present a noise term by Wt. Therefore, in this case for uni-variate model, we have

dX

dt =b(t,xt) +σ(t,xt)·Wt, (3) The noise term Wt has, at least approximately, these properties:

(i) Wt1 and Wt2 are independent fort1 6=t2. (ii) {Wt} is stationary.

(iii) The expectation of Wt is always zero for all t, that is E[Wt] = 0

The assumptions (i), (ii) and (iii) on Wt suggest that Vt should have stationary independent increments with mean 0. It turns out that the only such process with continuous paths is the Brownian motionBt. (Knight, 1981).

(9)

2 STOCHASTIC CALCULUS 4

2.1 Brownian Motion

Brownian motion, is a fundamental example of a stochastic process. Loosely speak- ing, Brownian motion can be dened as a continuous time random walk, with the following properties

(i) B0 = 0.

(ii) Btis almost surely continuous, that is the event happens with probability one.

The sample trajectoriest 7→Bt are continuous, with probability 1. (iii) For any nite sequence of times t0 < t1 < ... < tn, the increments

Bt1 −Bt0, Bt2 −Bt1, . . . , Btn−Btn−1 are independent.

(iv) For any times 0≤s ≤t, Bt−Bs is normally distributed with mean zero and variancet−s.

In particular, this implies that E[Bt− Bs] = 0 and var[Bt− Bs] = t− s, 0≤s≤t.

For convenience we informally regard Brownian motion as a random walk over in- nitesimal time intervals of length ∆t, with increments ∆Bt over the time interval [t, t+ ∆t] given by,

∆Bt =±√

∆t with equal probabilities (1 2,1

2). (4)

The choice of the square root in (4) is not fortuitous. Indeed, any choice of±(∆t)α with a power α > 12 would lead to explosion of the process as dt tends to zero, whereas a power α ∈(0,12) would lead to a vanishing process.

Note that we have E[∆Bt] = 1

2

∆t− 1 2

∆t = 0, and var[∆Bt] =E[(∆Bt)2] = 1

2∆t+1 2∆t.

According to this representation, the paths of Brownian motion are not dieren- tiable, although they are continuous Note that there is no point in computing the value ofBt as it is a random variable for allt >0, however we can generate samples of Bt, which are distributed according to the centered Gaussian distribution with variance t (Folland, 1999; Revuz and Yor, 1994). Figure 1 shows an example of one-dimensional Brownian motion paths generated from the same initial point. As seen from Figure, at each trajectory has its own path even if they are generated using the same parameter values.

(10)

Figure 1: Three trajectories of one-dimensional sample Brownian motion 2.1.1 Brownian Motion as a Limit of Random Walks

One of the many reasons that Brownian motion is important in probability theory is that it is, in a certain sense, a limit of rescaled simple random walks. Letξ1, ξ2, ...be a sequence of independent, identically distributed random variables with mean0and variance 1. For each n ≥ 1 dene a continuoustime stochastic process {Bn(t)}t≥0

by

Bn(t) = 1

√n X

1≤j≤bntc

ξj (5)

This is a random step function with jumps of size ±1n at times kn, where k ∈ Z+. Since the random variables ξj are independent, the increments of Bn(t) are independent. Moreover, for large n the distribution of Bn(t+s)−Bn(s) is close to normal distribution with mean 0 and variance t, by the Central Limit theorem.

Thus, it requires only a small leap of faith to believe that, asn→ ∞, the distribution of the random function Bn(t)approaches (in a sense made precise below) that of a standard Brownian motion.

Then, Why is this important? First, it explains, at least in part, why the Wiener process arises so commonly in nature. Many stochastic processes behave, at least for long stretches of time, like random walks with small but frequent jumps. The argument above suggests that such processes will look, at least approximately, and on the appropriate time scale, like Brownian motion. Second, it suggests that many important statistics of the random walk will have limiting distributions, and that the limiting distributions will be the distributions of the corresponding statistics of Brownian motion. The simplest instance of this principle is the central limit

(11)

2 STOCHASTIC CALCULUS 6 theorem: the distribution ofBn(1)is, for largen close to that ofB(1)(the Gaussian distribution with mean 0and variance 1). Other important instances do not follow so easily from the central limit theorem. For example, the distribution of

Mn(t) := max

0≤s≤tBn(t) = max

0≤k≤nt

√1 n

X

1≤j≤k

ξj (6)

converges, as n → ∞, to that of

M(t) := max

0≤s≤tB(t) (7)

The distribution of M(t) will be calculated explicitly as below, along with the dis- tributions of several related random variables connected with the Brownian path.

2.2 Itô integral

Now let's consider the Integral

I[f](ω) = Z b

a

f(t, ω)dBt(ω) (8)

whereBtBrownian motion. We dene R

f dBas the limit of R

φdB asφ→f (limit in L2(P)). We now give the details of this construction: A function φ ∈ V is called elementary if it has the form

φ(t, ω) =X

j

ej(ω)·X[tj,tj+1](t). (9) Note that since φ ∈ V each function ej must be Ftj-measurable. For elementary functions φ(t, ω)we dene the integral according to (8), this means

Z T S

φ(t, ω)dBt(ω) = X

j≥0

ej(ω)[Btj+1−Btj](ω) (10) From Equation (10), we can deduce a so called Itô isometry, that is, if φ(t, ω) is bounded and elementary then,

E

"

Z T S

φ(t, ω)dBt(ω) 2#

=E Z T

S

φ(t, ω)2dt

. (11)

The idea now is to use the isometry (11) to extend the denition from elementary functions to functions in V. This is done in several steps:

(12)

1. Let g ∈ V be bounded and g(·, ω) continuous for each ω. Then there exist elementary functionsφn ∈ V such that,

E Z T

S

(g−φn)2dt

→0 as n → ∞.

2. Let h ∈ V be bounded. Then there exist bounded functions gn ∈ V such that gn(·, ω)is continuous for all ω and n, and

E Z T

S

(h−gn)2dt

→0.

3. Let f ∈ V. Then there exists a sequence hn ⊂ V such that hn is bounded for eachn and

E Z T

S

(f −hn)2dt

→0 as n→ ∞.

Then the Itô integral of f (from S to T) is dened by, Z T

S

f(t, ω)dBt(ω) = lim

n→∞

Z T S

φn(t, ω)dBt(ω) (12) (limit in L2(P)), where φn is a sequence of elementary functions such that,

E Z T

S

(f(t, ω)−φn(t, ω))2dt

→0 as n → ∞. (13) Note that such a sequence φn satisfying (13) exists by Steps 1−3 above. The Itô integrals do not behave as Rieman integrals though they share some properties.

Some properties of the Itô integral are listed as follows Let f, g ∈ V(0, T) and let 0≤S < U < T. Then

1. RT

S f dBt =RU

S f dBt+RT U f dBt. 2. RT

S(cf +g)dBt =c·RT

S f dBt+RT S gdBt. 3. E[RT

S f dBt] = 0. 4. RT

S f dBt isFt-measurable.

The above description applies to one dimensional case. It is possible to generalize it to multidimensional case (Kloeden and Platen, 1999). In that case, one can use for instance a famous iterated Itô integrals dened as

n!

Z

0≤u1≤···≤un≤t

· · ·( Z

( Z

dBu1)dBu2)· · ·dBun =tn2~n(Bt

√t), for n= 0,1,2, . . . (14)

where~is the Hermite polynomial of degreen, dened by~n(x) = (−1n) expx22dxdnn(exp−x22).

(13)

2 STOCHASTIC CALCULUS 8

2.3 Stratonovich integrals

Besides the Itô stochastic integral, the most common stochastic integral is the Stratonovich stochastic integral dened as,

Z b a

f(t)◦dB(t) = limm→ ∞

m−1

X

i=0

1

2(f(t(m)i ) +f(t(m)i+1))(B(t(m)i+1)−B(t(m)i )). (15) The symbol "◦" is used to denote that the integral is the Stratonovich integral. In the summation, 12(f(t(m)i ) +f(t(m)i+1)) and (B(t(m)i+1)− B(t(m)i )) are not likely to be independent. Consequently, Itô and Stratonovich integrals generally have dierent values. Consider, for example, the integrals

Itô integral: Z t 0

B(s)dB(s) and Stratonovich integral:Z t 0

B(s)◦dB(s). (16) we know that the value of the Itô integral is,

Z t 0

B(s)dB(s) = 1

2(B2(t)−B2(0))− t 2. and of Stratonovich integral is

Z t 0

B(s)◦dB(s) = 1

2(B2(t)−B2(0)).

Hence, for this stochastic integral, the Itô and Stratonovich integrals are not the same as their dierence is

Z t 0

B(s)dB(s)− Z t

0

B(s)◦dB(s) = −t 2.

A Comparison of Itô and Stratonovich integrals

As we have argued that the mathematical interpretation of the white noise equation, dX

dt =b(t,Xt) +σ(t,Xt)·Wt, (17) is that Xt is a solution of the integral equation

Xt=X0+ Z t

0

b(s,Xs)ds+ Z t

0

σ(s,Xs)dBs (18) for some suitable interpretation of this above integral. However, as indicated earlier, the Itô interpretation of an integral of the form

Z t 0

f(s, ω)dBs(ω) (19)

(14)

is just one of several reasonable choices. For example, the Stratonovich integral is another possibility, leading (in general) to a dierent result.

So the question still remains, which interpretation of (19) makes (18) the "right"

mathematical model for the equation (17)? The most used integral is Itô. However, it does not mean that the Stratonovich integrals are not useful. There are few situations where Stratonovich integrals are needed that Itô integrals.

The Stratonovich integral of (18) is dened as X(t) =X0+

Z t 0

b(s,Xs)ds+ Z t

0

σ(s,Xs)◦dBs, (20) The solution of Equation (20) is the solution of the following modied Itô equation:

X(t) = X0+ Z t

0

b(s,Xs)ds+1 2

Z t 0

σ0(s,Xs)σ(s,Xs)ds+ Z t

0

σ(s,Xs)dBs (21) where σ0 denotes the derivative of σ(t, x) with respect to x. (Stratonovich, 1966).

Equations (20) and (21) shows how it is possible to switch from Stratonovich in- tegrals to Itô integrals. Therefore, give either of it, it is possible to convert to the other.

In general one can say that the Stratonovich integral has the advantage of leading to ordinary chain rule formulas under a transformation (change of variable), i.e. there are no second order terms in the Stratonovich analogue of the Itô transformation formula. This property makes the Stratonovich integral natural to use for example in connection with stochastic dierential equations on manifolds (Elworthy, 1998;

Ikeda and Watanabe, 1989). However, Stratonovich integrals are not martingales, where as Itô integrals are. This gives the Itô integral an important computational advantage. For our purposes the Itô integral will be most convenient, so we will base our work on that from now on.

2.4 Itô Formula

In evaluating the Itô integrals, the Itô formula plays a great rule. Equation (18) can be written in a dierential form as

dXt=u(t,Xt)dt+v(t,Xt)dBt (22)

(15)

2 STOCHASTIC CALCULUS 10 if we dene a twice continuous dierentiable function as Yt = g(t,X, then the following general Itô formula gives another Itô process.

dYk= ∂gk

∂t (t,X) +X

i

∂gk

∂xi

(t,X)dXi+1 2

X

i

2gk

∂xi∂xj

(t,X)dXidXj. (23) Here, k is a component. Note that dBidBj is dt is i = j and 0 otherwise. Also dBidt=dtdBi = 0.

Example 2.1 Suppose we want to compute the integral Z t

0

BsdBs. From this in- tegral we dene Y = g(t, Bt) = Bt2/2, where ∂g∂t = 0, ∂B∂gt = Bt and ∂B∂2g2

t = 1.

Substituting to Itô formula, we have dY =d(1

2Bt2) =BtdBt+1

2(dBt)2 =BtdBt+ 1

2dt. (24)

Taking integrals in both side of (24), we have 12Bt2 =Rt

0 BsdBs+12t, which means Z t

0

BsdBs = 1 2t− 1

2Bt2

2.5 Stochastic Dierential Equations

The dierential equation (22) can be written in a general form, that involves pa- rameters θ, continuous time t and variable Xt,as follows

dx(t) = f(x(t), t,θ) dt+L(x(t), t,θ) dB(t), (25) or in integral form as

x(t) = c+ Z t

t0

f(s,Xs)ds+ Z t

t0

L(s,Xs)dBs (26) The above dierential equation is called Itô stochastic dierential equation where f(x(t), t,θ) and L(x(t), t,θ) are drift and diusion coecients respectively. The random variablecis called the initial value at the instantt0. A solutionXtof equa- tion (25) or (26) is called stochastic process The history of stochastic dierential equations (SDEs) starts from the paper of Einstein (1905) who gave a mathematical connection between microscopic random motion of particles (microscopic motion of Brownian particles) and themacroscopic diusion equation. Currently, the SDEs are attracting a lot of attention due to physical processes in real life systems which experience random forcing and stochastic inputs that cannot be captured by or- dinary dierential equations. The SDEs are commonly used to model the diverse

(16)

phenomena in neural networks, ecosystem dynamics, population genetics, macroeco- nomic and physical systems. The understanding of SDE theory requires familiarity with advanced probability and stochastic processes (see Chung, 2001), which are not covered in this thesis.

(17)

3 STANDARD NUMERICAL METHODS 12

3 Standard Numerical Methods

In this chapter we study the numerical schemes for stochastic dierential equations which are derived from stochastic Taylor expansions. Here we are going to study Euler-Maruyama scheme, Milstein scheme and Runge-Kutta scheme. For simplicity, we consider a univariate Itô stochastic dierential Equation (25). whose stochastic integral, when the parameter dependence is dropped, is

X(t) = X(t0) + Z t

t0

f(s, X(s))ds+ Z t

t0

L(s, X(s))dB(s). (27) Here, the rst integral is pathwise a deterministic Riemann integral and the second is an Itô stochastic integral, which looks as if it could be dened pathwise as a deterministic Riemann-Stieltjes integral, but this is not possible because the sample paths of the Brownian motion, though continuous, are not dierentiable or even of bounded variation on any nite subinterval. The idea here is to numerically approximate the SDE using the aforementioned schemes.

3.1 EulerMaruyama Numerical Scheme

Numerical schemes can be constructed in several ways. The most common schemes that are often implemented in the approximation of SDEs are based on the stochastic Taylor expansion. The concept is quite similar to that of the deterministic dieren- tial equation. The more terms of Taylor series expansion you include in the series, the higher the order of convergence you attain and thus more accurate scheme.

Both the Stratonovich and the Ito sense can be derived but let us consider only the expansion of the following Ito SDE:

dX(t) =f(X(t), t)dt+g(X(t), t)dB(t), (28) with the solution such as

X(t) =X(t0) + Z t

t0

f(X(s), s)ds+ Z t

t0

g(X(s), s)dB(s). (29) where X(t0) is the initial value. Let us assume that v is suciently smooth func- tion and by the help of 1-dimensional Ito SDE (28), the dierential of v(X(t), t) is

(18)

evaluated and leads to the following Itô formula:

d[v(X(t), t)] = δv

δt|X(t),tdt+f(X(t), t)δv

δx|X(t),tdt +1

2g2(X(t), t)δ2v

δx2|X(t),tdt+g(X(t), t)δv

δxdB(t) +odt. (30) Consequently;

d[v(X(t), t)] = [δv

δt] +f(X(t), t)δv δx

1

2g2(X(t), t)δ2v

δx2dt+g(X(t), t)δv

δxdB(t) (31) dv=L0vdt+L1vdW(t), with the following partial operators;

L0 = δ

δt +f(X(t), t) δ δx +1

2g2(X(t), t) δ2

δx2 (32)

L1 =g(X(t), t) δ

δx (33)

By applying the dierentiation rule to the function f(X(s), s) in equation (29), it yields

d[f(X(s), s)] =L0f dt+L1f dB(t), (34) whose solution

f(X(s), s) =f(X(t0), t0) + Z s

t0

L0f dz+ Z s

t0

L1f dB(z). (35) Similarly for g(X(s),s)we get

d[g(X(s), s)] =L0gdt+L1gdB(t), (36) whose solution is given by

g(X(s), s) = g(X(t0), t0) + Z s

t0

L0gdz+ Z s

t0

L1gdB(z). (37) By substituting equations (35) and (37) into (29) we get

X(t) = X(t0) + Z t

t0

{f(X(t0), t0) + Z s

t0

L0f(X(z), z)dz+ Z s

t0

L1f(X(z), z)dB(z)}ds +

Z t t0

{g(X(t0), t0) + Z s

t0

L1g(X(z), z)dB(z)}dB(s). (38)

X(t) =X(t0) +f(X(t0), t0) Z t

t0

ds+g(X(t0), t0) + Z t

t0

dB(s) + Z t

t0

Z s t0

L0f dzds +

Z t t0

Z s t0

L1f dB(z)ds+ Z s

t0

Z s t0

L0gdsdB(s) + Z t

t0

Z s t0

L1gdB(z)dB(s). (39)

(19)

3 STANDARD NUMERICAL METHODS 14 This leads to a rst approximation of the form;

X(t) = X(t0) +f(X(t0), t0)[t−t0] +g(X(t0), t0)[B(t)−B(t0)] + Z t

t0

Z s t0

L0f(X(z), z)dzds +

Z t t0

Z s t0

L1f(X(z), z)dB(z)ds+ Z s

t0

Z s t0

L0g(X(z), z)dsdB(s) +

Z t t0

Z s t0

L1g(X(z), z)dB(z)dB(s). (40)

X(t) = X(t0) +f(X(t0), t0)[t−t0] +g(X(t0), t0)[B(t)−B(t0)] +Errt1, (41)

X(t+ ∆t) =X(t) +f(X(t), t)∆tn+g(X(t), t)[B(t+ ∆t)−B(t)], or with t=n∆t

Xn+1 =Xn+f(Xn, tn)∆tn+g(Xn, tn)∆Btn. (42) This is the simplest non-trivial stochastic Taylor expansion called Euler-Maruyama scheme. In this derivation we have assumed that the coecient functions f and g are suciently smooth. The noise increments ∆Bn here are Gaussian random variables with mean 0 and variance ∆n. They can be generated from uniformly distributed random (or pseudo random) numbers through the Box-Muller method, although more ecient methods are available for very long simulations. In practice one needs to simulate a large number of realizations, which can be done eciently in parallel on a distributed network of computers or processes with a master com- puter coordinating the calculations of the individual realizations on the individual processes (in particular, ensuring the independence of the random variables used) and collecting the results P.E. (2002).

The stochastic Euler scheme was rst investigated by Maruyama in the early 1950s and is often called the Euler-Maruyama scheme. It seems to be consistent with the Itô stochastic calculus because the noise term approximates the Ito stochastic inte- gral over a discretization subinterval[tn, tn+1]by evaluating its integrand at the left- hand end point of this interval: Rtn+1

tn L(s, X(s))dB(s)≈Rtn+1

tn L(tn, X(tn))dB(s) = L(tn, X(tn))Rtn+1

tn dB(s)Convergence for numerical schemes can be dened in a num- ber of useful dierent ways. It is usual to distinguish between strong and weak convergence, depending on whether the realizations or only their probability distri- butions are required to be close, respectively. Consider a xed interval[t0, T]and let

∆be the maximum step size of any partition of[t0, T]. Then a numerical scheme is

(20)

said to converge with strong orderγ if, for suciently small∆,E(|X(T)−XNT|)≤ KTγ and with weak order β if |E(g(X(T)))−E(g(XNT))| ≤Kg,Tβ. These are global discretization errors and the largest possible values of γ and β give the cor- responding strong and weak orders, respectively, of the scheme.

The stochastic Euler scheme has strong order γ = 12 and weak order β = 1 . These orders of convergence are with respect to classes of SDEs, e.g., with continuously dierentiable coecients for which the derivatives are uniformly bounded. For re- stricted classes a higher order is sometimes possible, such as SDE with additive noise, i.e., the diusion coecient b is independent of the state variable x , which attain a strong orderγ = 1. The strong order and weak order of the stochastic Euler scheme are quite low, particularly given the fact that a large number of realizations need to be generated for most practical applications. Thus there is a need for higher order numerical schemes.(P.E., 2002)

3.2 Milstein Numerical Scheme

The Milstein scheme is the simplest nontrivial numerical scheme for stochastic def- erential equations with a strong order of convergence one (higher than that of the Euler-Maruyama scheme). The scheme has been extended to the stochastic delay deferential equations but the analysis of the convergence is technically complicated due to anticipative integrals in the remainder terms.

It was rst derived by Milstein, who used the Itô formula to expand an integrand involving the solution in one of the error terms of the Euler-Maruyama scheme.

The iterative repetition of this idea underlies the systematic derivation of stochas- tic Taylor expansions and numerical schemes of arbitrarily high strong and weak orders, as expounded in Kloeden and Platen (1999); Milstein (1995). Consider the homogeneous scalar stochastic dierential equation

dYt =a(Yt)dt+b(Yt)dBt, (43) and letti,ti+1 be two consecutive points in our time discretization. The Ito formula says, that for a given function f which is two times continuously dierentiable, we can write,

f(Ys) =f(Yti) + Z s

ti

(f0(Yu)a(Yu) + 1

2f00(Yu)b(Yu)2)du+ Z s

ti

f0(Yu)b(Yu)dB (44) We can apply the Ito formula on the expressions a(Ys) and b(Ys), which are the

(21)

3 STANDARD NUMERICAL METHODS 16 coecients in our SDE. We then obtain

Yti+1 =Yti+ Z ti+1

ti

(a(Yti) + Z s

ti

(a0(Yu)a(Yu) + 1

2a00(Yu)b2(Yu))du +

Z s ti

a0(Yu)b(Yu)dBu)ds+ Z ti+1

ti

(b(Yti) + Z s

ti

(b0(Yu)a(Yu) + 1

2b00(Yu)b2(Yu))du +

Z s ti

b0(Yu)b(Yu)dBu)dBs (45)

We want to achieve a method which converges strongly of order 1. By using a time discretization, the dierentialsdB anddt are replaced by the corresponding discrete versions ∆B and δt. If we are up for a method which converges strongly of order 1, we can neglect the double integrals above, which are of type dBs·ds and ds·ds. We then obtain,

Yti+1 ≈Yti+ Z ti+1

ti

a(Yti)ds+ Z ti+1

ti

(b(Yti) + Z s

ti

b0(Yu)b(Yu)dBu)dBs

≈Yti+a(Yti)δt+b(Yti)∆Bi+ Z ti+1

ti

Z s ti

b0(Yu)b(Yu)dBudBs (46) The rst two summands in the equation above are well known from the Euler- Maruyama scheme. The third one is new. We approximate the third term above by;

Z ti+1

ti

Z s ti

b0(Yu)b(Yu)dBudBs ≈b0(Yti)b(Yti) Z ti+1

ti

Z s ti

dBudBs. (47) The integral on the right hand side of the last equality is well known from Continuous Time Finance. We obtain

b0(Yti)b(Yti) Z ti+1

ti

Z s ti

dBudBs= 1

2b0(Yti)b(Yti)((∆Bi)2−δt) (48) Substituting this in our previous approximation we nally obtain the Milstein scheme

Yi+1 =Yi+a(Yi)δt+b(Yi)∆Bi+ 1

2b0(Yi)b(Yi)((∆Bi)2−δt) (49) The Milstein scheme makes use of Itô's lemma to increase the accuracy of the ap- proximation by adding the second-order term. Denoting byσx the partial derivative of σ(t, x)with respect to x, the Milstein approximation looks like

Yi+1 =Yi+b(ti, Yi)(ti+1−ti) +σ(ti, Yi)(Bi+1−Bi)+

1

2σ(ti, Yix(ti, Yi){(Bi+1−Bi)2−(ti+1−ti)}

(50)

or, in symbolic form,

Yi+1 =Yi+L∆t+σ∆Bt+1

2σσx{(∆Bt)2−∆t} (51)

(22)

This scheme has strong and weak orders of convergence equal to one. For this process let's consider L(t, x) = θ1−θ2×x and σ(t, x) =θ3, and thus σx(t, x) = 0 and the Euler and Milstein schemes coincide. This is one case in which the Euler scheme is of strong order of convergence γ = 1.

Example 3.1 (The geometric Brownian motion) A more interesting case is that of geometric Brownian motion of the stochastic dierential equation

dXt1Xtdt+θ2XtdB (52) For this process, L(t, x) = θ1 ·x, σ(t, x) = θ2 ·x and σx(t, x) = θ2. The Euler- Maruyama discretization for this process IS

Yi+1E =YiE(1 +θ1·∆t) +θ2YiE∆Bt (53) and the Milstein scheme reads

Yi+1M =YiMθ1·YiM∆t+θ2YiM∆Bt+ 1

22YiM{(∆Bt)2∆t}

=YiM(1 + (θ1− 1

22)∆t) +θ2YiM∆Bt+1

22YiM(∆Bt)2 Recall that ∆Bt ∼√

∆tZ with Z ∼N(0,1). Thus Yi+1E =YiE(1 +θ1·∆t+θ2

∆tZ) and

Yi+1M =YiM(1 + (θ1− 1

22)∆t) +θ2YiM

∆tZ+ 1

22YiM∆tZ2

=YiM(1 + (θ1− 1

22(Z2−1))∆t+θ2

∆tZ)

The Milstein scheme makes the expansion exact up to order O(∆t). Indeed, formal Taylor expansion leads to

Xt+∆t=Xtexp{(θ1−θ22

2)∆t+θ2

∆tZ}

=Xt{1 + (θ1− θ22

2)∆t+θ2

∆tZ+ 1

22∆tZ2 +O(∆t)}

=Yi+1M

(23)

3 STANDARD NUMERICAL METHODS 18

3.3 RungeKutta Numerical Scheme

The Milstein scheme involves the derivatives. If it happens that the derivatives do not exist, then it leads to diculties in implementing. For that case we need another derivative free method. In this section we shall consider implicit schemes which avoid the use of derivatives. They are obtained from the corresponding im- plicit strong Taylor schemes by replacing the derivatives there by nite dierences expressed in terms of appropriate supporting values. for this reason we shall call them implicit strong Runge-Kutta schemes, but it must be emphasized that they are not simply heuristic stochastic adaptations of the deterministic Runge-Kutta schemes. (Kloeden and Platen, 1992).

For 1−dimensional case an implicit order-1 strong Runge-Kutta scheme is, Yn+1 =Yn+f(Yn+1)∆ +L∆Bn+ 1

2√

∆[L( ¯Yn−L)][(∆Bn)2−∆] (54) with supporting value, Y¯n+1 =Yn+f∆ +L√

By interpolating between this scheme and the corresponding explicit scheme we can form a family of implicit order −1.0 strong Runge-Kutta schemes. In the d−

dimensional case these have the form

Yn+1 =Yn+ [αf(Yn+1) + (1−α)f]∆ +L∆Bn+ 1 2√

∆[L( ¯Yn−L)][(∆Bn)2−∆] (55) With the vector supporting value,Y¯n+1 =Yn+f∆ +L√

∆ and the parameter α ∈ [0,1]There is also a Stratonovich version

Yn+1 =Yn+ [αf(Yn+1) + (1−α)f]∆ + 1

2[L( ¯Ψn) +L]∆Bn (56) With vector supporting value Ψ¯n =Yn+f∆ +L∆Bn

and the parameter α∈[0,1]. We remark that we still obtain convergence with the strong order γ = 1 if we omit the ¯a∆ term in the supporting valueΨ¯n .

In the d-dimensional case an implicit order- 1.5 strong Runge-Kutta scheme is given by

Yn+1 =Yn+ 1

2[f(Yn+1) +f]∆ +L∆Bn+ 1 2√

∆[f( ¯Y+)−f( ¯Y)](∆Zn− 1

2∆Bn∆)+

1 4√

∆[L( ¯Y+)−L( ¯Y)][(∆Bn)2−∆] + 1

2∆[L( ¯Y+)−2L+L( ¯Y)](∆Bn∆−∆Zn)+

1

4∆{L( ¯Φ+)−L( ¯Φ)−[L( ¯Y+)−L( ¯Y)]} ×[1

3(∆Bn)2−∆]∆Bn (57)

(24)

With supporting values Y¯± =Yn+f∆±L√

∆And Φ¯± =Y+±L( ¯Y+)√

Here we have chosen the degree of implicitness α = 12 which simplies the scheme.

We note that for additive noise only the rst four terms remain in this scheme. We shall only consider the additive noise case here for the strong orderγ = 2.0 scheme.

Then in d−dimensional case we have the implicit order 2.0 Strong Runge-Kutta scheme for additive noise

Yn+1 =Yn+L∆Bn+{f( ¯Y+) +f( ¯Y)− 1

2[f(Yn+1) +f]}∆ (58) withY¯±=Yn+12f∆ +1L(¯η±ξ), whereη¯= 12∆Zn+14∆Bn∆andξ={J(1,1,0),n∆−

1

2(∆Zn)2+18[(∆Bn)2+12(2∆Zn−∆Bn)2]∆2}12. This scheme has a surprisingly simple structure in spite of its strong order γ = 2.0.

(25)

4 OTHER NUMERICAL METHODS 20

4 Other Numerical Methods

We have seen that the Euler based approximation scheme is a constant approx- imation of the solution of the SDE. In this Section, we discuss other numerical methods that can be used to simulate the SDE. These are local linearization meth- ods which includes Ozaki and Shoji-Ozaki schemes. The ltering based methods are also discussed. The local linearization methods approximate locally the drift of the stochastic dierential equation with a given function. The linearization to the drift part can be done either deterministically which lead to Ozaki scheme (Ozaki, 1993) or stochastically which lead to ShojiOzaki scheme (Shoji and Ozaki, 1997, 1998).

The ltering methods involves the recursive estimation of the SDE realizations by assuming Gaussian approximations of the distributions of the realizations.

4.1 Ozaki Scheme

The Ozaki-scheme is in the form of a linear multivariate autoregressive time series with state-dependent coecients and it does not involve a stochastic Taylor expan- sions of the solution. The discretized process follows the Gaussian distribution with mean E(tk)and covariance V(tk) given as follows:

E(tk) =x(tk) + f(x(tk),θ)

∂x

f(x(tk),θ) ∂

∂x

f(x(tk),θ)

4t)−1

V(tk) =L(θ)LT(θ)

exp(2K(tk)4t)−1 2K(tk)

, where

K(tk) = 1 4tlog

1 + f(x(tk),θ) x(tk)∂x

f(x(tk),θ)

exp( ∂

∂x

f(x(tk),θ)

4t)−1

One disadvantage of Ozaki scheme is that it assumes that the diusion coecient is constant and the drift function depends only on the state variable.

4.2 ShojiOzaki Scheme

The ShojiOzaki scheme is an extension of Ozaki scheme where the drift can depend on time variable and the diusion coecient can vary The discretized process follows

(26)

the Gaussian distribution with mean E(tk) and covariance V(tk)given as follows:

E(tk) = x(tk) + f(x(tk), tk,θ) L(tk)

exp(L(tk)4t)−1 + M(tk)

L2(tk)

exp(L(tk)4t)−1−L(tk)4t V(tk) = L(x(tk), tk,θ)LT(x(tk), tk,θ)

exp(2L(tk)4t)−1 2L(tk)

, where

L(tk) = ∂

∂x

f(x(tk), tk,θ)

M(tk) = 1

2L(x(tk), tk,θ)LT(x(tk), tk,θ) ∂2

∂x2

f(x(tk), tk,θ) + ∂

∂t

f(x(tk), tk,θ) ShojiOzaki scheme is stable even if the time step4t is large. Note that the Ozaki, Shoji-Ozaki and Euler-Maruyama schemes draw the increments from a Gaussian distribution. However, the variance in Euler-Maruyama scheme is independent from the previous process while the Ozaki and Shoji-Ozaki schemes depend. In most cases, the Shoji-Ozaki scheme performs dierently from the Euler and Ozaki meth- ods because it takes into account the stochastic behavior of the discretization. In the linear homogeneous SDEs the Euler, Shoji-Ozaki, and Ozaki methods coincide.

4.3 Kalman lter

For linear SDE, one can use Kalman lter R (1960) to compute the posterior distri- bution of states, where the predictive dierential equations are analytically solved by any numerical scheme for ordinary dierential equations such as Euler Maruyama scheme or matrix fraction decomposition. The idea behind is that, given an SDE (which is called dynamical process) we dene another process called measurement process. Hence, forming a state space model dened as follows:

dx(t) = F(t,θ)x(t)dt+L(t,θ) dB(t) yk =Hkx(tk) +rk.

(59)

wherex(tk)is the state at time tk,θ∈Φ⊆Rdis the vector of parameters to be es- timated, F: [0,∞)×Φ7→Rn is a linear dynamic model function,L: [0,∞)×Φ7→

Rn×s is a linear matrix valued function, t 7→ B(t) is s-dimension Brownian mo- tion with diusion matrix Qc ∈ Rs×s, yk ∈ Rm is the measurement at time tk, h : Rn 7→ Rm is the measurement model function, rk ∼ N(0,Rk) is the Gaussian

(27)

4 OTHER NUMERICAL METHODS 22 measurement noise with Rk ∈ Rm×m being the covariance matrix of the measure- ment error at tk. At time t0 the state is assumed to have the prior distribution p(x(t0)) = N(x(t0)|m0,P0), where m0 is the predictive initial mean and P0 is the predictive initial covariance.

Algorithm below is the KF algorithm which provides an recursive ecient computa- tions of dynamic states x(t1),x(t2), . . . ,x(tM) from which the mean of the squared error is minimized. For the derivation of the ltering steps for KF algorithm see, for instance, Särkkä (2013).

1. Initialize the mean m0 and covariance P0 2. Fork = 1,2, . . . perform the following

• Prediction step:

dmk(t)

dt =F(t,θ)mk(t) (60)

dPk(t)

dt =F(t,θ)Pk(t) +Pk(t)FT(t,θ) +Σ(t,θ), (61) whereΣ(t,θ) =L(t,θ)QcLT(t,θ)and the initial conditions aremk(tk−1) = mk−1, Pk(tk−1) = Pk−1, and the prediction result is given as mk = mk(tk),Pk =Pk(tk).

• Update step:

Sk =HkPkHTk +Rk (62) Kk =PkHTkS−1k (63) mk =mk +Kk yk−Hkmk

(64) Pk =Pk −KkSkKTk. (65) where mk is a priori state estimate, mk is a posteriori state estimate, Pk is a priori estimate error covariance, Pk is a posteriori estimate error covariance and Σ(t) =L(t,θ)QcLT(t,θ). Note that, sometimes,mk andPk are written asm(tk) and P(tk) respectively. For continuous dynamic model, the predictive dierential Equations (60) and (61) can be solved by any numerical scheme like RungeKutta scheme (Butcher, 2003) or matrix fraction decomposition (Grewal and Andrews, 2001; Mbalawata et al., 2013). The integrations start from the initial valuesm(tk−1) and P(tk−1).

(28)

4.4 Extended Kalman Filter

This idea of computing sucient statistics using Kalman lter can not be used in simulating the nonlinear SDE because Kalman lter is only for linear dynamic model.

There are various lters that deal with nonlinear SDEs. Examples of such lters are extended Kalman lters, Unscended Kalman lter, Gaussina lters, particle lters (Jazwinski, 1970; Särkkä, 2013). In this section, only extended Kalman lter is discussed.

For non-linear SDEs we consider the following state space model.

dx(t) =f(x(t), t,θ) dt+L(x(t), t,θ) dB(t) (66) yk=h(x(tk)) +rk, (67) wheref :Rn×[0,∞)×Φ→Rnis the dynamic model function,L:Rn×[0,∞)×Φ→ Rn×s is a matrix valued function, and h : Rn → Rm is the measurement model function.

The extended Kalman lter forms a Gaussian approximation to distribution of states and measurements using a Taylor series expansion (Jazwinski, 1970; Grewal and Andrews, 2001). The idea is that the nonlinear SDE is linearized with the Taylor series expansion and then the Kalman lter is applied. The estimation of states is thus done recursively as in the following algorithm.

1. Initialize the mean m0 and covariance P0 2. Fork = 1,2, . . . perform the following

• Prediction step:

dmk(t)

dt =f(mk(t), t,θ) (68)

dPk(t)

dt =Fx(mk(t), t,θ)Pk(t) +Pk(t)FTx(mk(t), t,θ) +Σ(mk(t), t,θ), (69)

(29)

4 OTHER NUMERICAL METHODS 24

• Update step:

µk=h(mk, t) (70)

Sk=Hx(mk, t)PkHTx(mk, t) +Rk (71) Kk=PkHTx(mk, t)S−1k (72) mk=mk +Kk(yk−µk) (73) Pk=Pk −KkSkKTk, (74)

where Σ(m, t,θ) = L(m, t,θ)QcLT(m, t,θ), Fx(x,θ, t) is the Jacobian matrix of f(x,θ, t) with respect to x and Hx(x, t) is the Jacobian matrix of h(x, t). The initial conditions are mk(tk−1) = mk−1, Pk(tk−1) = Pk−1, and the prediction result is given as mk =mk(tk), Pk =Pk(tk).

(30)

5 Formulation of Stochastic Epidemic Models

Epidemics are often modelled by nonlinear systems observed through partial noisy data. The modeling can be broadly classied into two main categories: determinis- tic models and stochastic models. It is interesting to note that after a deterministic system of ordinary dierential equations has been formulated for the population dynamics, one can derive several dierent kinds of stochastic models that take into account the random nature of the population processes in a consistent manner. The idea here is to capture unknown inuences such as changing behaviors, public inter- ventions, seasonal eects, social cycles. Note that, the deterministic and stochastic models have complementary strengths. There are many kind of epidemic models, depending to the type of disease. Example SIS, SIR, SEIR models. The SIR model is able to capture most of the features of epidemic processes, its validity is in doubt when applied to diseases where the incubation period is relatively long. The SIR model can be extended to include an exposed state leading to SEIR model. In this extended model, an initially susceptible individual is considered as being exposed to the disease. In this chapter we discuss the SEIR model in deterministic and its corresponding SDEs.

The basic SEIR model represents infection dynamics in total eective population size Ne which is divided into four compartments: Susceptible S, Exposed E, Infec- tious I and Recovered R. Transmission of infection from infectious to susceptible individuals is controlled by a bilinear contact term βSI/Ne. In particular, the scal- ing byNe makes the reproduction ratio proportional to the local density of contacts and independent of population size. The infected individuals move into the exposed (not infectious) class after an average incubation period 1/k and subsequently (if they escape natural mortality) through the infectious class after an average time 1/γ. This deterministic approximation assumes an exponential distribution of incu- bation and infectious periods; though a tractable approximation for exploring overall dynamics, the observed duration of infection periods are of then much more nearly constant. The model assumes that recovered individuals are immune from infection (strictly to the ability to retransmit) for life. The transition process is modeled by

Viittaukset

LIITTYVÄT TIEDOSTOT

The second objective is to dene ordinary stochastic dierential equations and give known existence and uniqueness results for them, so we can later generalize these results to a

A Stochastic Differential Equation (shortened SDE and sometimes called a forward stochastic differential equation to be separated from a backward sto- chastic differential

Finally we show the existence of weak solutions to mean-field stochastic differential equa- tions under bounded, measurable and continuous coefficients by show- ing that there exists

15 July 2011 The MLMC-FEM for a stochastic Brinkman Problem/ Juho Könnö 9..

Fluids equations at the macroscopic level coupled with kinetic or stochastic equations ruling the evolution of the fluid microstruc- ture at the meso- or micro- scale, e.g..

Keywords: stochastic integral equations, stochastic fractional differential equa- tion, regularity, nonnegative operator, Volterra equation, singular kernel.. Correspondence

Jean Jacod, Philip Protter , Asymptotic Error Distributions for the Euler Method for Stochastic Differential Equations. Kloeden, Eckhard Platen , Numerical Solutions of

Using the method, which is based on the solutions of the fourth order differential equations, the restraint effect of sandwich panels can be approximated in