Universitat Aut`onoma de Barcelona
Brownian Motion and Introduction to
Stochastic Calculus
Author:
David Nebra Colmenares
Supervisors:
Maria Jolis Gim´enez
Daniel Campos Moreno
July 7, 2016
Contents
1 Introduction 1
2 Random Walk 5
2.1 One-dimensional random walk . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.1.1 Back to original position . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.1.2 Get to a specific position . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.1.3 Expected time to get back to origin . . . . . . . . . . . . . . . . . . . . . 8
2.2 Two-dimensional random walk . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.3 Back to the original position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.4 Get to a specific position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.5 Three-dimensional random walk . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.6 Back to the origin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.7 Get to a specific position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3 Simulations: Random walks 16
3.1 One-dimensional random walk . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.1.1 Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.2 Two-dimensional random walk . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.2.1 Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.2.2 Path samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.2.3 Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.3 Three-dimensional random walk . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.3.1 Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4 Brownian motion 29
4.1 History of Brownian motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.2 The Difussion Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.2.1 Einstein’s derivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.2.2 Langevin’s approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.2.3 Macroscopic Derivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
4.2.4 Solution of the diffusion equation . . . . . . . . . . . . . . . . . . . . . . 34
4.3 Recurrence of Brownian motion . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
4.4 Expected time to reach a specific position . . . . . . . . . . . . . . . . . . . . . 40
4.5 Other properties of Brownian motion . . . . . . . . . . . . . . . . . . . . . . . . 42
4.5.1 Quadratic variation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
4.5.2 Unbounded variation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
5 Simulations: Brownian Motion 45
5.1 Numerical integration of stochastic differential equations with Gaussian white
noise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.1.1 Runge-Kutta-Type methods . . . . . . . . . . . . . . . . . . . . . . . . . 47
2
CONTENTS 3
5.1.2 Simulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
5.1.3 Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
5.1.4 Path samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.2 Dirichlet problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.2.1 Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
6 Stochastic integrals 53
6.1 Riemann-Stieltjes integral . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
6.2 The Itˆo integral for simple processes . . . . . . . . . . . . . . . . . . . . . . . . 54
6.3 The general Itˆo integral . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
6.4 A simple version of the Itˆo formula . . . . . . . . . . . . . . . . . . . . . . . . . 56
6.5 Extension I of the Itˆo formula . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
6.6 Extension II of the Itˆo formula . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
6.7 Stratonovich integral . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
6.8 Stratonovich or Itˆo? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
7 Stochastic calculus in Finance 62
7.1 Black-Scholes simple model for option pricing . . . . . . . . . . . . . . . . . . . 65
7.1.1 A mathematical formulation for the option pricing problem . . . . . . . . 67
7.1.2 Graphical representations of the Black-Scholes formula . . . . . . . . . . 69
Appendices 72
A Fokker-Planck equation 73
B Results and definitions in Probability 74
B.1 Conditional expectation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Abstract
This bachelor thesis aims to introduce the concepts of random walks, Wiener process and
Stochastic Calculus and to illustrate some of its applications. Before going into details, we will
explain the random walk and the Wiener process, and see how the latter can be understood
as a limit of the former. In Chapter 2 we will deal with 1, 2 and 3-dimensional random walks
and we will focus on the probability that the random walker will get back to its departing
point (recurrence problem). We will then simulate some cases to see that experimental results
match theoretical ones, and simulate some cases for the 2 and 3-dimensional case for which we
don’t have theoretical results. The next part will be an introduction to Brownian motion, its
importance in Physics and how it can be modelled via a Wiener process. As we did with the
random walk we will see that, among other properties, the 1-dimensional Brownian motion is
recurrent and, finally, we will run several simulations. Chapter 6 is an introduction to Stochastic
Calculus that will provide us with useful results which will be used later in Chapter 7. This
last chapter will introduce us some financial concepts and one of the most important formulas
in modern Quantitative Finance: Black-Scholes formula for option pricing.
Chapter 1
Introduction
In this chapter we want to explain the similarities between the Brownian motion and the random
walk, and see that the former can be undersood as a limit of the latter. The next chapters will
focus more in detail on the properties of each one, here we just want to see the link existing
between them.
Definition 1.0.1. Given a probability space (Ω, F, P) and a measurable space (S, Σ) a stochas-
tic process X is a collection of random variables on Ω, indexed by a totally ordered set T, i.e,
X = {Xt : t ∈ T} (1.1)
where each Xt is a random variable on Ω with values in S, that is
X−1
t (E) ∈ F ∀E ∈ Σ ∀t ∈ R (1.2)
Definition 1.0.2. A 1-dimensional Wiener process or Browian motion B = (Bt, t ∈ [0, ∞)) is
a stochastic process characterized by the following properties
1. B0 = 0 a.s.
2. B has independent increments.
3. B has Gaussian increments: Bt+u − Bt ∼ N(0, u).
4. B has continuous paths: Bt(ω) is a.s. continuous in t.
Definition 1.0.3. A n-dimensional Wiener process or Browian motion is a vector-valued
stochastic process
Bt = (B
(1)
t , B
(2)
t , . . . , B
(n)
t ) (1.3)
whose components B
(i)
t are independent, one dimensional Wiener-processes.
Remark 1.0.1. Throughout most of this thesis we will use the terms Wiener process and
Brownian indistinctly. In Physics literature Brownian motion is often understood as the ran-
dom movement that a particle does, and the Wiener process is one of the many possible inter-
pretations of this movement. In this way, many physicists understand Brownian motion as a
physical concept that has to do with the movement itself, while here we will understand it as a
mathematical object. In some chapters however when we talk about Brownian motion we will
refer to the physical concept. In any case, it should be clear to what we refer depending on the
context.
Definition 1.0.4. Let Xn be independent random variables that can only take values 1 or −1
with equal probability, i.e., P(Xn = 1) = 1/2 and P(Xn = −1) = 1/2. A one-dimensional
random walk with n steps is the sum of n of such variables Sn = X1 + X2 + . . . + Xn
1
CHAPTER 1. INTRODUCTION 2
There are many properties in common between the random walk and the Brownian motion. In
fact, the Brownian motion can be understood as a limit of a random walk, and that’s what we
will show here. First we need to make some definitions. There are many types of convergence
for random variables, we will need now the convergence in distribution.
Definition 1.0.5. Let X, X1, X2, . . . be random variables (which don’t need to be defined on
the same probability space). Let Fn, F be the distribution functions of Xn and X respectively.
We say Xn converges in distribution to X if for every t where F is continuous we have:
lim
n
Fn(t) = F(t) (1.4)
and we write Xn
d
→ X
This is the weakest type of convergence for random variables. Indeed it can be shown that
Xn
a.s
−→ X =⇒ Xn
P
−→ X =⇒ Xn
d
−→ X (1.5)
Convergence in distribution does not have good properties, for example it is not true that the
limit of the sum is the sum of the limits. However, when one of the sequences converges to a
constant, then we have the results we would expect.
Theorem 1.0.1 (Slutsky’s theorem). Assume that Xn
d
→ X and Yn
d
→ c, where c is a constant.
Assume also that every n, Xn and Yn are defined on the same probability space. Then
1. Xn + Yn
d
→ X + c
2. Xn · Yn
d
→ cX
3.
Xn
Yn
d
→
X
c
, if c = 0
Finally we will need the Central Limit Theorem, which is the most important Theorem in
Probability Theory. It basically states that we can approximate the sum of a large number of
random variables to the normal distribution. This has a huge number of applications in many
fields.
Theorem 1.0.2 (Central Limit Theorem, L´evy-Lindeberg version). Let X1, X2, . . . be iden-
pendent and identically distributed (i.i.d) random variables with finite second order moment.
Write E(Xn) = µ and Var(Xn) = σ2
, and let
¯Xn =
1
n
n
i=1
Xi (1.6)
and Z ∼ N(0, 1). Then
¯Xn − µ
σ√
n
d
−→ Z (1.7)
Now that we have these tools, we will proceed to show the relationship between random walk
and Brownian motion. Let ξ1, ξ2, . . . be a sequence of random variables with ξi = ±1 with
probability 1/2. Let Sn = ξ1 + . . . + ξn (S0 = 0), and let Xn
t (ω) be
Xn
t (ω) =
1
√
n
S nt (ω) + (nt − nt )
1
√
n
ξ nt +1(ω)
ψn,t
(1.8)
CHAPTER 1. INTRODUCTION 3
where x is the floor function, that is, it takes the largest integer that is smaller or equal than
x. Notice that a random walk is defined for discrete values. The previous definition admits any
value t ≥ 0. Because we have S nt instead of S t for big enough n the term
1
√
n
S nt will
change quickly as t grows. In a way we have made a ‘continuous’ random walk.
Theorem 1.0.3. With {Xn
} defined by (1.8), we have that for any t > 0
Xn
t
d
−→ Bt as n → ∞ (1.9)
where {Bt, t ≥ 0} is a Brownian motion.
Proof. First we see that ψn,t
P
−→ 0 as n → ∞. We have that
|ψn,t| = Xn
t −
1
√
n
S nt ≤
1
√
n
|ξ nt +1| (1.10)
and by Chebyshev inequality
P (|ψn,t| > ε) ≤ P
1
√
n
|ξ nt +1| > ε ≤
E 1√
n
ξ nt +1
2
ε2
=
1
ε2n
→ 0 (1.11)
Because ψn,t
P
−→ 0 this also means that ψn,t
d
−→ 0 se we can use Slutsky’s theorem (1.0.1) and
we obtain Xn
t has the same limit as
1
√
n
S nt .
By the Central Limit Theorem and because nt /n → t
1
nt
S nt
d
−→ N, N ∼ N(0, 1) (1.12)
If we consider Yn =
nt
√
n
, then Y
d
−→
√
t = c and we can use Slutzky’s theorem to
1
nt
S nt · Yn:
1
√
n
S nt =
1
√
n
nt
nt
S nt =
1
nt
S nt · Yn
d
−→
√
tN (1.13)
and because Xn
t has the same limit as
1
√
n
S nt we have that
Xn
t
d
−→
√
tN
d
= Bt (1.14)
This result gives us a feeling on the concept of Brownian motion, as we can understand it as a
limit of a random walk.
We have assumed that the random variables ξi can only take discrete values 1 and −1. There
is a stronger result, in which we don’t need to assume that the random variables take only
these two discrete values. It is called Donsker’s invariance Theorem and it is a generalization
of what we have just seen. If we take i.i.d random variables ξi Theorem (1.0.3) still holds true.
We won’t show this result here, but more details can be found in the book of Billinsgley [2].
The following Proposition can translate some properties we see in random walks to properties
in Brownian motion.
CHAPTER 1. INTRODUCTION 4
Proposition 1.0.1. Let C([0, ∞)) be the space of continuous functions with the topology of
uniform convergence on compacts. Then for every continuous Ψ : C([0, ∞]) → R we have that
Ψ(Xn
)
d
−→ Ψ(B) (1.15)
where Xn is defined by (1.8) and B = (Bt, t ≥ 0) is the Brownian motion.
Example 1.0.1. Let’s consider Y n
= max
0≤t≤T
Xn
t . The functional Ψ(f) = max
0≤t≤T
f(t) is continu-
ous, so we can apply Proposition (1.0.1). It tells us that
Y n d
−→ max
0≤t≤T
Bt (1.16)
This tool sometimes can be of great help, because if one has proved some property for the
random walk this Proposition can help with the proof for the Brownian motion taking limits.
However, we will encounter non-continuous functionals such as the stopping time:
τ = inf{n > 0, Sn = a} (1.17)
Because this functional is not continuous we cannot apply theorem (1.0.1). A consequence
of this is for example that to show the recurrence of the random walk and the recurrence
of Brownian motion we will need to prove these results separately. Although it seems quite
intuitive that properties in the random walk must keep true in the Brownian motion (and as a
matter of fact it almost always happens), we cannot deduce these results just taking limits.
Chapter 2
Random Walk
2.1 One-dimensional random walk
Definition 2.1.1. Let Xn independent be random variables that can only take values 1 or −1
with equal probability, i.e., P(Xn = 1) = 1/2 and P(Xn = −1) = 1/2. A one-dimensional
random walk with n steps is the sum of n of such variables Sn = X1 + X2 + . . . + Xn
In the following we will consider a particle that can move with equal probability to the left
(Xn = −1) and to the right (Xn = 1). The position it will be after n steps will be Sn. We
consider it always starts at the origin, that is, S0 = 0.
2.1.1 Back to original position
We are now interested in knowing whether the particle will ever return to the original position,
that is
P(∃n ≥ 1 : Sn = 0) (2.1)
For this computation we consider two different events. An will be the event that the particle
comes back to its original position for the first time at time n. We have then that A0 = ∅
because the particle could not come back as it didn’t even leave the origin yet, and A1 = ∅
because it is impossible to come back after 1 step. Then for n > 1 we define
An := {Sn = 0, Sn−1 = 0, . . . S1 = 0} (2.2)
Bn will be the event that the particle is in the original position, no matter if it’s not the first
time. That is
Bn := {Sn = 0} (2.3)
and we define the probabilities
an := P(An), bn := P(Bn) (2.4)
For n = 0 we have a0 = 0 and b0 = 1. Notice that for n ≥ 1
Bn =
n
k=0
(Bn ∩ Ak) (2.5)
because these events are disjoint we have
bn =
n
k=0
P(Bn ∩ Ak) (2.6)
5
CHAPTER 2. RANDOM WALK 6
and because of the independence of Ak and {Xk+1 + . . . + Xn = 0}:
P(Bn ∩ Ak) = P(Sn = 0, Sk = 0, Sk−1 = 0, . . . S1 = 0) (2.7)
= P(Ak, Xk+1 + . . . + Xn = 0) (2.8)
= P(Ak)P(Xk+1 + . . . + Xn = 0) (2.9)
Notice that
P(Xk+1 + . . . + Xn = 0) = P(X1 + . . . + Xn−k) (2.10)
hence we have just shown that
bn =
n
k=0
akbn−k (2.11)
Lemma 2.1.1. With the previous definitions the following equation holds
∞
n=0
an = 1 −
1
∞
n=0
bn
(2.12)
Proof. For values s ∈ (−1, 1) the series
∞
n=0
ansn
and
∞
n=0
bnsn
converge. Indeed, because an and
bn are bounded by 1, then
∞
n=0
an|s|n
≤
∞
n=0
|s|n
<
1
1 − |s|
< ∞ (2.13)
and absolute convergence implies convergence. If we multiply these series
∞
n=0
ansn
·
∞
n=0
bnsn
=
∞
n=0
cnsn
(2.14)
and if we compare the coefficients of sn
on the LHS and RHS we get cn =
∞
k=0
akbn−k. We
showed that a0 = 0, hence c0 = 0 and therefore
∞
n=0
ansn
·
∞
n=0
bnsn
=
∞
n=1
bnsn
=
∞
n=0
bnsn
− 1 (2.15)
thus we obtain ∞
n=0
ansn
= 1 −
1
∞
n=0
bnsn
(2.16)
but an and bn are always positive. If we do the limit s → 1−
we obtain a monotone increasing
sequence. Then by the Monotone Convergence Theorem the limit gives
∞
n=0
an = 1 −
1
∞
n=0
bn
(2.17)
CHAPTER 2. RANDOM WALK 7
Coming back to our previous problem, we want to see the probability that the particle will
come back to its original position:
P(∃n ≥ 1 : Sn = 0) = P(
∞
n=0
An) =
∞
n=0
an = 1 −
1
∞
n=0
bn
(2.18)
We will show that
∞
n=0
bn = ∞ and, therefore, the particle will come back to its original position
with probability 1. Let’s think what are the possible values of bn. To come back, the particle
will need to go left as many times as it goes right. If it does n steps, it will have to go n/2
times right and n/2 times left. If n is odd it’s clear that bn = 0. If n = 2k then there are 2k
k
different paths it can follow, k to the left and k to the right, each with probability 1/2. Thus
for n ≥ 1
bn =



0 , if n odd
2k
k
1
2
k
1
2
k
, if n = 2k
(2.19)
Recall that the Stirling’s approximation is
k! ∼
k
e
k √
2πk (2.20)
when k → ∞. Then we have for big enough k
b2k =
(2k)!
(k!)2
1
2
2k
∼
(2k)2k
√
4πk
k2k2kπ
1
22k
=
1
√
π
1
√
k
(2.21)
so we conclude ∞
n=0
bn =
∞
k=0
b2k = ∞ (2.22)
that means, the particle will come back to its original position with probability 1.
2.1.2 Get to a specific position
After showing that the particle will come back with probability 1 to its original position, we
could further analyse whether the particle will ever visit a specific position. Let’s define
f(x) := P(∃n ≥ 1 : Sn = x) (2.23)
Lemma 2.1.2. With the previous definition,
f(x) =
1
2
f(x − 1) +
1
2
f(x + 1) (2.24)
CHAPTER 2. RANDOM WALK 8
Proof. Suppose x = 1, −1, then
f(x) = P(∃n ≥ 1 : Sn = x)
= P(∃n ≥ 1 : X1 + . . . + Xn = x)
= P(∃n ≥ 1 : X1 + . . . + Xn = x, X1 = 1) + P(∃n ≥ 1 : X1 + . . . + Xn = x, X1 = −1)
= P(∃n ≥ 1 : X1 + . . . + Xn = x|X1 = 1)P(X1 = 1)+
+ P(∃n ≥ 1 : X1 + . . . + Xn = x|X1 = −1)P(X1 = −1)
=
1
2
P(∃n ≥ 2 : X2 + . . . + Xn = x − 1) +
1
2
P(∃n ≥ 2 : X2 + . . . + Xn = x + 1)
=
1
2
P(∃n − 1 ≥ 1 : X1 + . . . + Xn−1 = x − 1) +
1
2
P(∃n − 1 ≥ 1 : X1 + . . . + Xn−1 = x + 1)
=
1
2
P(∃m ≥ 1 : X1 + . . . + Xm = x − 1) +
1
2
P(∃m ≥ 1 : X1 + . . . + Xm = x + 1)
=
1
2
f(x − 1) +
1
2
f(x + 1)
For x = 1, −1 because f(0) = 1 if S0 = 0 then f(1) =
1
2
+
1
2
f(2) and f(−1) =
1
2
f(−2)+
1
2
.
Suppose f(x) = 1 for some x, then
1 = f(x) =
1
2
f(x − 1) +
1
2
f(x + 1) (2.25)
but f(x − 1) ≤ 1 and f(x + 1) ≤ 1 because they are probability measures. Thus to obtain
the previous equality follows that f(x − 1) = 1 and f(x + 1) = 1. By induction using that we
have already seen that f(0) = 1 we can cover the whole line, so we proved that f(x) = 1 for
all x ∈ Z.
2.1.3 Expected time to get back to origin
The aim of this section will be to compute the “average” time the particle will need to get back
to the original position. One could at first think that this time will not be very large. After
all, the probability that it will go back to the origin after the first step, whichever this is, is
1/2. We will however show that the average time is infinite.
Lemma 2.1.3.
1
√
1 − 4x
=
∞
m=0
2m
m
xm
(2.26)
Proof. We will use the generalized binomial theorem, which states that
(x + y)r
=
∞
r=0
r
k
xr−k
yk
(2.27)
where
r
k
=
r(r − 1) . . . (r − k + 1)
k!
(2.28)
Let’s apply this formula to our problem:
(1 − 4x)−1/2
=
∞
m=0
m
k=1(2k − 1)
2mm!
(4x)m
=
∞
m=0
m
k=1(2k − 1)
m!
2m
xm
(2.29)
CHAPTER 2. RANDOM WALK 9
so we need to see that the coefficients coincide, that is
m
k=1(2k − 1)
m!
2m
=
2m
m
(2.30)
the last equation can be rewritten in a simpler way
m
k=1
(2k − 1)2m
=
(2m)!
m!
=
2m
k=m+1
k (2.31)
Let’s show it by induction. For m = 1 the equation holds. Suppose it true for m. For m + 1
we have
m+1
k=1
(2k − 1)2m+1
= 2(2m + 1)2m
m
k=1
(2k − 1) (2.32)
and
2m+2
k=m+2
k =
1
m + 1
(2m + 2)(2m + 1)
2m
k=m+1
k (2.33)
using the induction hypothesis
2(2m + 1) =
1
m + 1
(2m + 2)(2m + 1) (2.34)
which is true.
Theorem 2.1.1. For m ≥ 1, the probability of a first return to the origin at a time 2m is
given by
a2m =
b2m
2m − 1
=
2m
m
(2m − 1)22m
(2.35)
Proof. Let’s begin defining the functions
U(x) =
∞
m=0
b2mxm
(2.36)
and
F(x) =
∞
m=0
a2mxm
(2.37)
Since we know that for m ≥ 1
b2m =
2m
m=0
a2kb2m−2k (2.38)
then
U(x) = 1 + U(x)F(x) (2.39)
where the 1 in the RHS from the last equation comes from the fact that b0 = 1. We note that
both functions converge on the interval (−1, 1), since both an and bn are less than 1 in absolute
value. Thus solving for F(x)
F(x) =
U(x) − 1
U(x)
(2.40)
From (2.19) we have that
U(x) =
∞
m=0
2m
m
2−2m
xm
(2.41)
CHAPTER 2. RANDOM WALK 10
and from (2.26)
1
√
1 − 4x
=
∞
m=0
2m
m
xm
(2.42)
so that
U(x) =
1
√
1 − x
(2.43)
and therefore
F(x) =
U(x) − 1
U(x)
(2.44)
=
(1 − x)−1/2
− 1
(1 − x)−1/2
(2.45)
= 1 − (1 − x)1/2
(2.46)
and we note that F (x) = U(x)/2. So if we integrate the series U(x)/2 and equate the coeffi-
cients of these series to those of F(x), we can obtain an expression for a2m:
a2m =
b2m−2
2m
=
2m−2
m−1
m22m−1
=
2m
m
(2m − 1)22m
=
b2m
2m − 1
where we have used in the third step that
2m − 2
m − 1
=
m
2(2m − 1)
2m
m
Corollary 2.1.1. The expected time to get back to the origin is infinite
Proof. From (2.35) we know the expression of a2m
a2m =
b2m
2m − 1
and from (2.21) we know that
b2m ∼
1
√
m
so we conclude that
a2m ∼
1
m
√
m
(2.47)
hence the expected time to get back to the origin diverges
E(T) =
∞
m=1
a2m · 2m ∼
∞
m=1
2m
m
√
m
=
∞
m=1
2
√
m
= ∞ (2.48)
CHAPTER 2. RANDOM WALK 11
2.2 Two-dimensional random walk
Definition 2.2.1. Let Xn be independent random vectors that can take values (1, 0), (0, 1),
(0, −1) or (−1, 0) with equal probability of 1/4. A two-dimensional random walk with n steps
is the sum of such random vectors Sn = X1 + X2 + . . . + Xn
In this case the particle will be able to move up, down, left and right.
2.3 Back to the original position
We are interested in knowing if it will come back to the origin, as it happened for 1 dimension.
That is, we want to compute
P(∃n ≥ 1 : Sn = 0) (2.49)
Using the same definitions as before,
an := P(Sn = 0, Sn−1 = 0, . . . , S1 = 0)
bn := P(Sn = 0)
and
P(∃n ≥ 1 : Sn = 0) =
∞
n=0
an = 1 −
1
∞
n=0
bn
(2.50)
Hence if
∞
n=0
bn = ∞, the probability that it will come back to the origin will be 1.
Note that in order to come back to the origin we need the same amount of up and down steps,
and the same amount of left and right steps. That makes bn = 0 for n odd.
If n = 2k then each path that finishes in the origin has equal probability
1
42k
. Now let’s count
how many possible paths there are. The particle may go j steps up and j steps down, and k −j
left and k − j right (note that the number total of steps is 2k), where j can be any number for
0 to k. If every step were different, there would be (2k)! choices, but given any path we can
reorder the j down steps in j! different ways without changing the path. The same holds for
up, left and right steps. Thus the number of possible combinations is
(2k)!
j!j!(k − j)!(k − j)!
(2.51)
and the probability
bn =
1
42k
k
j=0
(2k)!
j!j!(k − j)!(k − j)!
(2.52)
CHAPTER 2. RANDOM WALK 12
We can rewrite bn as follows
b2k =
1
42k
k
j=0
(2k)!
j!j!(k − j)!(k − j)!
(2.53)
=
1
42k
k
j=0
2k
k!k!
k!k!
j!j!(k − j)!(k − j)!
(2.54)
=
1
42k
2k
k
k
j=0
k
j
2
(2.55)
=
1
42k
2k
k
2
(2.56)
where we have use the equation
k
j=0
k
j
2
=
2k
k
(2.57)
Let’s explain from where this formula comes. We know by Newton Binomial that
(x + 1)2k
=
2k
i=0
2k
i
xi
(2.58)
but this can also be writen as
(x + 1)k
(x + 1)k
=
k
j=0
k
j
xj
k
i=0
k
i
xi
(2.59)
the coefficient of xk
in both expressions have to be the same, that is
2k
k
=
k
j=0
k
j
k
k − j
=
k
j=0
k
j
k
j
=
k
j=0
k
j
2
(2.60)
then
b2k =
1
22k
2k
k
2
(2.61)
If we look closely we will see that this is the same expression as in one dimension to the square.
Using Stirling’s formula,
b2k =
1
22k
2k
k
2
∼
1
πk
(2.62)
And finally we see that the following series is divergent
∞
n
bn ≥
∞
k=0
b2k = ∞ (2.63)
and hence
P(∃n ≥ 1 : Sn = 0) = 1 (2.64)
CHAPTER 2. RANDOM WALK 13
2.4 Get to a specific position
As for the one-dimensional case, it can be seen that the particle will reach any position with
probability 1 in the plane. Let x = x1e1 + x2e2, with x1, x2 ∈ Z, e1 = (1, 0), e2 = (0, 1) and
g(x) be the probability that there exists n ≥ 1 such that Sn = x, i.e.
g(x) = P(∃n ≥ 1 : Sn = x) (2.65)
The same reasoning as in the one-dimensional case shows that
g(x) =
1
4
(g(x − e1) + g(x + e1) + g(x − e2) + g(x + e2)) (2.66)
and because g(x) are probabilities, 0 ≤ g(x) ≤ 1. So if g(x) = 1 it must follow that g(x − e1) =
g(x + e1) = g(x − e2) = g(x + e2) = 1. But we showed in the previous section that g(0) = 1,
so inductively follows that g(x) = 1 for every x.
2.5 Three-dimensional random walk
Definition 2.5.1. Let Xn be independent random vectors that can take values (1, 0, 0), (0, 1, 0),
(0, 0, 1), (−1, 0, 0), (0, −1, 0) or (0, 0, −1) with equal probability of 1/6. A three-dimensional
random walk with n steps is the sum of such random vectors Sn = X1 + X2 + . . . + Xn
Now the particle has freedom to move along up, down, left, right, backward and forward.
2.6 Back to the origin
Adapting the same definitions as in previous sections we have
P(∃n ≥ 1 : Sn = 0) =
∞
n=0
an = 1 −
1
∞
n=0
bn
(2.67)
so the particle will go back to the origin if
∞
n=0
bn = ∞.
As before for n ≥ 1 odd
bn = P(Sn = 0) = 0 (2.68)
If n = 2k then the same reasing as in the two-dimensional case applies. The particle can go j
steps up and down, i backward and forward and k − j − i left and right. If every path were
differenth there would be (2k)! possibilites, but because we can reorder all the j up and down
steps in j!j! ways, all the i!i! backward and forward steps in i! ways and all the k − j − i left
and right steps in (k − j − i)!(k − j − i)! ways without changing the path, the probability is
b2k =
1
62k
k
j=0
k−j
i=0
(2k)!
j!j!i!i!(k − j − i)!(k − j − i)!
(2.69)
CHAPTER 2. RANDOM WALK 14
where we are summing over all the possible values of j and i. If we rewrite b2k we obtain
b2k =
1
62k
k
j=0
k−j
i=0
(2k)!
j!j!i!i!(k − j − i)!(k − j − i)!
(2.70)
=
1
22k
1
32k
k
j=0
k−j
i=0
2k
k!k!
k!k!
j!j!i!i!(k − j − i)!(k − j − i)!
(2.71)
=
1
22k
2k
k
k
j=0
k−j
i=0
1
32k
k!k!
j!j!i!i!(k − j − i)!(k − j − i)!
(2.72)
=
1
22k
2k
k
k
j=0
k−j
i=0
1
3k
k!
j!i!(k − j − i)!
2
(2.73)
The terms in the last summation are the terms of a trinomial distribution. This can be thought
as the urn problem given k draws with replacement where we have white, black and red balls.
If X, Y and Z are random variables that take values on the number of white, black and red
balls drawn respectively then for j + i ≤ k
P(X = j, Y = i, Z = k − j − i) =
1
3k
k!
j!i!(k − j − i)!
(2.74)
Hence the sum of the probability of all possible outcomes has to be 1, that is
k
j=0
k−j
i=0
1
3k
k!
j!i!(k − j − i)!
= 1 (2.75)
but in the expression above we have the summation of the square terms.
If a random variable can only take n values with probabilities p1, . . . , pn then
n
j=1
p2
j ≤
n
j=1
pj( max
1≤i≤n
pi) ≤ ( max
1≤i≤n
pi)
n
j=1
pj = ( max
1≤i≤n
pi) (2.76)
therefore
b2k ≤
1
22k
2k
k
max
1≤i,j≤k
1
3k
k!
j!i!(k − j − i)!
(2.77)
Let’s think where this term achieves its maximum. It will be when the denominator is minimum.
If k = 3m from the definition of factorial itself it can be easily checked that the denominator
takes its minimum when j = m, i = m and k − j − i = m. If k = 3m + 1 then it will be when
two of them are m and one m + 1 and if k = 3m − 1 when two of them are m and one m − 1.
For k = 3m
b2k ≤
1
22k
2k
k
1
3k
k!
m!m!m!
(2.78)
and using Stirling’s approximation
1
22k
2k
k
1
3k
k!
m!m!m!
∼
1
√
πk
(3m
e
)3m
√
6mπ
(m
e
)m
√
2mπ
=
C1
k
√
k
(2.79)
where C1 is a constant.
For k = 3m + 1 and k = 3m − 1 the behaviour for big enough values will be the same as in the
case k = 3m, so
∞
k=0
b2k ≤ C
∞
k=0
1
k
√
k
< ∞ (2.80)
CHAPTER 2. RANDOM WALK 15
This shows that the probability to come back to the origin is strictly less than 1. But the
probability is also strictly positive. For example, we know that a2 =
1
6
. That is, after the
first step the probability that it will come back is the probability that it will take a step in the
opposite way to the first step.
We see that as we are including more dimensions, the power of k in the denominator of b2k
increases. In dimensions higher than 3 we would expect that the power of k is even higher,
making the probability to return to origin even smaller than for d = 3. The idea widely speaking
is that as we grow in dimensions there are more ‘choices’ for the movement of the particle and
that makes it more ‘difficult’ for the particle to come back. We will however not show that for
d > 3 the probability of coming back to the origin of the random walk is less than 1.
2.7 Get to a specific position
Adapting the same definitions as in the previous sections for the three-dimensional case,
g(d) =
1
6
(g(d + e1) + g(d + e2) + g(d + e3)+
+ g(d − e1) + g(d − e2) + g(d − e3))
if d were a point such that g(d) = 1 then
g(d + e1) + g(d + e2) + g(d + e3) + g(d − e1) + g(d − e2) + g(d − e3) = 1 (2.81)
but by induction we would arrive to g(0) = 1, which contradicts what we have just shown.
Therefore it must be g(d) < 1 for all d ∈ Z3
.
Chapter 3
Simulations: Random walks
In this chapter we will run different simulations to compare experimental results to theoretical
results explained in the previous chapters. For most simulations we will use Python, and in
some cases Java. All scripts have been made by David Nebra unless otherwise stated.
3.1 One-dimensional random walk
We will run several simulations of random walks starting at the origin and count the number of
steps it takes for the particle to get back to the origin for the first time for every simulation. We
will gather this information in two histograms. In the same plots we will draw the curve that
represents the theoretical probabilites, computed in Theorem (2.35). For the first histogram
we run 50000 simulations and every simulation will be cut off if after 60 steps the particle has
not returned to the origin.
For the second histogram we run 10000 simulations and every simulation will be cut off if after
3000 steps the particle has not returned to the origin. In order to represent the information
in the second histogram, the x-axis and y-axis will be in log scale so we can see a better
representation of the data.
Figure 3.1
For a closer look at the results depicted in 3.1 we show the following table, which compares the
16
CHAPTER 3. SIMULATIONS: RANDOM WALKS 17
values obtained by both the simulation and the theory.
N Theory Simulations Desviation (%)
2 25000 25030 0.1
4 6250 6196 -0.8
6 3125 3139 0.4
8 1953 1956 0.14
10 1367 1389 1.5
12 1025 1016 -0.9
14 806 780 -3.2
16 655 683 4.3
18 545 590 8.2
20 463 469 1.1
22 400 396 -1.1
24 350 359 2.5
26 310 293 -5.4
28 277 301 8.7
30 249 237 -4.8
N Theory Simulations Desviation (%)
32 226 240 6.3
34 206 235 14.1
36 189 176 -6.7
38 174 181 4.2
40 161 154 -4.2
42 149 149 0
44 139 128 -7.9
46 130 120 -7.6
48 122 96 -21.2
50 115 104 -9.2
52 108 115 6.5
54 102 104 2.0
56 96 91 -5.6
58 92 91 -0.5
Table 3.1: This table gather both the theoretical and experimental frequencies, and also the
desviation with respect to the theoretical values.
The desviation has been calculated as
Desviation =
Experimental frequencies − Theoretical frequencies
Theoretical frequencies
· 100 (3.1)
Looking into the data in the table we observe a trend that we could not see in the plotted
graph. We observe that the desviation (i.e the error) grows as the number of steps grows. This
is something we should expect, because the number of particles that go back to origin after
N steps decreases as N grows. That means that we have less data available for N big and
therefore the simulations are less accurate. This is a direct implication of the Law of Large
Numbers (see page 8 of the reference [5]).
For the theoretical counts, we have used the formula 2.35. The expected count Y2m of the
number of particles that reach back the origin after 2m steps will be given by
E(Y2m) = N · a2m (3.2)
where N is the total number of simulations.
For example, the expected count of particles that come back to origin after 2 steps for 50000
simulations is
E(Y2m) = 50000 ·
1
2
= 25000 (3.3)
Now we will see another simulation in log-log scale.
CHAPTER 3. SIMULATIONS: RANDOM WALKS 18
Figure 3.2: Particles to reach back origin in log-log scale
It is important to remark that even though the bins in the figure (3.2) are the same width,
the more to the right they are the more number of steps they represent. To make it easier to
understand let’s take an example, the bin 0 to 1 is the sum of all the simulations in which the
particle returned back to the origin and took between e0
= 1 and e1
= 2.71 . . . steps. So we
now that the bin 0 to 1 only represent the case when the particle returned back to the origin
after 2 steps. If we take the bin 7 to 8 it represents all the simulations in which the particle
returned back to the origin and took between e7
= 1096.63 . . . and e8
= 2980.95 . . . steps. So
this bin counts for every simulation in which it took the particle 1098 steps, or 1100 steps,...,
or 2980 steps to go back to the origin.
We can collect this data in a table:
log(N) Theory Simulations Desviation
[0 − 1) 5000 4921 -1.5
[1 − 2) 1875 1906 1.6
[2 − 3) 1363 1356 -0.5
[3 − 4) 681 680 -0.1
[4 − 5) 426 445 4.4
[5 − 6) 257 285 10.8
[6 − 7) 156 146 -6.8
[7 − 8) 94 90 -5.1
3.1.1 Code
The following script runs M different simulations of random walks of length at most N. For
every simulation when the random walk reaches 0 for the first time it stops the simulation and
keeps the number of steps in a vector v.
def SimRandomWalk(N=100, M=1000):
v=[]
for l in range (1 ,M) :
CHAPTER 3. SIMULATIONS: RANDOM WALKS 19
x=numpy . random . uniform ( −0.5 ,0.5 ,(N, 1 ) )
x[0]=0
i=1
k=0
suma=1
while suma!=0 and i<N or k==0:
i f k==0:
k=1
suma=0
i f x [ i ] >0:
x [ i ]=1
else :
x [ i ]=−1
suma=suma+x [ i ]
i=i+1
i f suma==0:
v . append ( i −1)
return v
The next script on the one hand computes the theoretical probabilities a2m (yam in the script)
and then it plots these probabilites together with an histogram of the simulations. This is the
code used for plotting figure (3.1).
def freqHistogram1D (N=30,M=50000):
f=math . f a c t o r i a l
yam=[]
xam=[]
for m in range (1 ,N) :
yam. append (M* f (2*m)/( f (m)* f (m)*(2*m−1)*2**(2*m) ) )
xam. append(1+2*m)
X=SimRandomWalk(2*N,M)
(n , bins , patches ) = plt . h i s t (X, bins=N−1)
#p l t . s c a t t e r (xam,yam, c=’r ’)
plt . plot (xam,yam, c=’ r ’ )
red patch = mp. Patch ( color=’ red ’ , l a b e l=’ Theoretical frequencies ’ )
blue patch = mp. Patch ( color=’ blue ’ , l a b e l=’ Experimental frequencies ’ )
plt . legend ( handles =[ red patch , blue patch ] )
plt . xlabel ( ’N’ )
plt . ylabel ( ’ Frequency ’ )
plt . show ()
xam [ : ] = [ x−1 for x in xam]
yam=numpy . array (yam)
X=numpy . array (X)
for i in range (0 ,N−1):
print (( n [ i ]−yam[ i ] ) /yam[ i ] )
print (xam,yam, n)
Lastly, to make the plot in figure (3.2) we used the following code.
def freqHistogram1DLogLog (N=3000,M=10000):
f=math . f a c t o r i a l
yam=[]
CHAPTER 3. SIMULATIONS: RANDOM WALKS 20
xam=[]
bins=9
suma1 , suma2 , suma3 , suma4 , suma5 , suma6 , suma7 , suma8 , suma9 = [ 0 ] * 9
for m in range (1 ,N) :
mm=2*m
yam. append (M* f (mm)/( f (m)* f (m)*(mm−1)*2**(mm) ) )
i f 0<=math . log (mm)<1:
suma1=suma1+yam[m−1]
e l i f 1<math . log (mm)<2:
suma2=suma2+yam[m−1]
e l i f 2<math . log (mm)<3:
suma3=suma3+yam[m−1]
e l i f 3<math . log (mm)<4:
suma4=suma4+yam[m−1]
e l i f 4<math . log (mm)<5:
suma5=suma5+yam[m−1]
e l i f 5<math . log (mm)<6:
suma6=suma6+yam[m−1]
e l i f 6<math . log (mm)<7:
suma7=suma7+yam[m−1]
e l i f 7<math . log (mm)<8:
suma8=suma8+yam[m−1]
e l i f 8<math . log (mm)<9:
suma9=suma9+yam[m−1]
yam=[suma1 , suma2 , suma3 , suma4 , suma5 , suma6 , suma7 , suma8 , suma9 ]
for m in range (0 , bins ) :
xam. append (0.5+m)
X=l i s t (map(math . log , SimRandomWalk(2*N,M) ) )
(n , bins , patches ) = plt . h i s t (X, bins=numpy . arange ( bins ) , log=True )
plt . plot (xam,yam, c=’ r ’ )
plt . xlabel ( ’ log (N) ’ )
plt . ylabel ( ’ Frequency ’ )
red patch = mp. Patch ( color=’ red ’ , l a b e l=’ Theoretical frequencies ’ )
blue patch = mp. Patch ( color=’ blue ’ , l a b e l=’ Experimental frequencies ’ )
plt . legend ( handles =[ red patch , blue patch ] )
for i in range ( 0 , 8 ) :
print (( n [ i ]−yam[ i ] ) /yam[ i ] )
print (xam,yam, n)
plt . show ()
3.2 Two-dimensional random walk
The simulations here are identical as in the previous section, but for two-dimensional random
walks. The first histogram shows the count of all the particles that come back to origin after
60 steps. The values we selected for making the second plot are N = 60 and M = 50000, being
M the number of simulations. In the second histogram, we took N = 1000 and M = 10000.
CHAPTER 3. SIMULATIONS: RANDOM WALKS 21
Figure 3.3
From this chart we could try to compute the probabilites an. We just need to read from the
plot the number of particles that returned after n steps, and then divide by the total number
of simulations, that is M = 50000. For example,
a2 ≈
12500
50000
= 1/4 = 0.25
a4 ≈
4000
50000
= 2/25 = 0.08
a6 ≈
2000
50000
= 1/25 = 0.04
. . .
If we take into account again the Law of Large Numbers, this method would allow us to re-
construct the theoretical probabilites an. Of course, it would only be an approximation, but
it can be as good as we want, we just need big values of M. For an with n big there will be
trouble because we will need much computation power, but for small values of n one can find
the probability with great accuracy.
The next plot is again in log-log scale for better visualization. Because we have no theoretical
data to compare it with, we have computed the regression line y = mx + b. For its calculation,
we have taken the middle point of every bin and its corresponding log frequency. Because the
y-axis of the plot are in logarithmic scale, we actually draw 10y
instead of y, so we would see
a line in the plot. Exact details of its calculation can be found in the code.
CHAPTER 3. SIMULATIONS: RANDOM WALKS 22
Figure 3.4: Plot and regression line y = mx + b with m = −0.14 and b = 3.38
This regression line can help us make some rough predictions. For example, if we take the value
x = 12.5 with the information of the regression line we know that a total of 10y
= 10−0.14·12.5+3.38
simulations reached back the origin between e12
and e13
steps. That is, only 43 simulations
from a total of 10000 reached back the origin for the first time after doing between 162754
and 442414 steps. In the next section we will compare this regression line to that of the three
dimensional case.
3.2.1 Code
The following script runs M different simulations of random walks of length at most N. For
every simulation when the random walk reaches 0 for the first time it stops the simulation and
keeps the number of steps in a vector v.
def SimRandomWalk2D(N=100,M=1000):
v=[]
for l in range (1 ,M) :
x=numpy . random . uniform ( −0.5 ,0.5 ,(N, 1 ) )
x[0]=0
i=1
k=0
sumax=1
sumay=1
while (sumax!=0 or sumay!=0) and i<N or k==0:
i f k==0:
k=1
sumax=0
sumay=0
i f x [ i ] >0.25:
sumax=sumax+1
CHAPTER 3. SIMULATIONS: RANDOM WALKS 23
i f x [ i ]>0 and x [ i ] <0.25:
sumax=sumax−1
i f x [ i ] < −0.25:
sumay=sumay+1
i f x [ i ]<0 and x [ i ] > −0.25:
sumay=sumay−1
i=i+1
i f sumax==0 and sumay==0:
v . append ( i −1)
return v
for plotting figure (3.3):
def freqHistogram2D (N=30,M=50000):
plt . h i s t (SimRandomWalk2D(2*N,M) , bins=N−1)
blue patch = mp. Patch ( color=’ blue ’ , l a b e l=’ Experimental frequencies ’ )
plt . legend ( handles =[ blue patch ] )
plt . xlabel ( ’N’ )
plt . ylabel ( ’ Frequency ’ )
and for plotting figure (3.4):
def freqHistogram2DLogLogLine (N=1000,M=10000):
bins=9
xam=[]
logn =[]
x = numpy . linspace (0 ,8 ,100)
X=l i s t (map(math . log , SimRandomWalk2D(2*N,M) ) )
(n , bins , patches ) = plt . h i s t (X, bins=numpy . arange ( bins ) , log=True )
blue patch = mp. Patch ( color=’ blue ’ , l a b e l=’ Experimental frequencies ’ )
plt . legend ( handles =[ blue patch ] )
plt . xlabel ( ’ log (N) ’ )
plt . ylabel ( ’ Frequency ’ )
for m in range ( 0 , 8 ) :
xam. append (0.5+m)
i f n [m]!=0:
logn . append (math . log10 (n [m] ) )
else :
logn . append (0)
print ( logn ,xam)
m, b = numpy . p o l y f i t (xam, logn , 1)
plt . plot (x , 10**(m*x+b ) , ’−’ )
print (m, b)
3.2.2 Path samples
CHAPTER 3. SIMULATIONS: RANDOM WALKS 24
Figure 3.5: Two different simulations for a 2D random walk. The particle (blue) will go up,
down, left or right with equal probability.
3.2.3 Code
We used a code in Java provided by Princeton:
public class randomWalk2 {
public static void main( String [ ] args ) {
int N = 60;
StdDraw . setXscale(−N, +N) ;
StdDraw . setYscale(−N, +N) ;
StdDraw . c l e a r (StdDraw .GRAY) ;
int x = 0 , y = 0;
int steps = 0;
while (Math . abs (x) < N && Math . abs (y) < N) {
StdDraw . setPenColor (StdDraw .WHITE) ;
StdDraw . f i l l e d S q u a r e (x , y , 0 . 4 5 ) ;
double r = Math . random ( ) ;
i f ( r < 0.25) x−−;
else i f ( r < 0.50) x++;
else i f ( r < 0.75) y−−;
else i f ( r < 1.00) y++;
steps++;
StdDraw . setPenColor (StdDraw .BLUE) ;
StdDraw . f i l l e d S q u a r e (x , y , . 4 5 ) ;
StdDraw . show ( 4 0 ) ;
}
StdOut . println ( ”Total steps = ” + steps ) ;
}
}
The functions StdDraw and StdOut are just for drawing and printing the results. They are
CHAPTER 3. SIMULATIONS: RANDOM WALKS 25
defined in other documents but they are not interesting for our purposes. The algorithm creates
a loop, for which in each step a random number r in the interval (0, 1] is created. The interval
is divided into four equal parts. Depending on the value of r the particle will go down, up, left
or right.
3.3 Three-dimensional random walk
The first two simulations in the section are identical as in the previous section, but for three-
dimensional random walks. The values for the first histogram are N = 60 and M = 50000 and
for the second histogram N = 1000 and M = 10000. The histograms are the following
Figure 3.6
As before, we could compute the probabilites an with the information in the plot
a2 ≈
8500
50000
= 0.17 (3.4)
a4 ≈
2000
50000
= 0.04 (3.5)
a6 ≈
1000
50000
= 0.02 (3.6)
. . . (3.7)
Next histogram is in log-log scale for better visualization, and the regression line has been
calculated
CHAPTER 3. SIMULATIONS: RANDOM WALKS 26
Figure 3.7: Plot and regression line y = mx + b with m = −0.24 and b = 3.24
Before we move on, let’s have a look at the regression lines for the 2D and 3D random walks.
For the 2D random walk we obtained y = −0.14x + 3.38 while for the 3D random walk y =
−0.24x + 3.24.
First we start with the similarities. They both have a negative slope and a positive intercept.
This all makes sense, a negative slope means that the number of particles that come back to
the origin after N steps is smaller than the number that come back after n steps, where N > n.
Alternatively, the more steps that a particle has been away from the origin, the less ‘probable’
it is to come back in the next step. For this reason, the intercept must be positive. Otherwise
it would lack of any physical sense as the number of steps would take negative values.
The big difference between them is the slope of the regression lines. For the 2D case we have
m = −0.14 and for the 3D m = −0.24 which is a difference close to 50%. This means that
the increment ∆N = N2 − N1, where N2 > N1, is smaller for 2D than for 3D. That is, the
histogram for 3D is more ‘heavy’ for small values of N and it decreases faster to 0 as N grows
than for the 2D case.
3.3.1 Code
The following script runs M different simulations of random walks of length at most N. For
every simulation when the random walk reaches 0 for the first time it stops the simulation and
keeps the number of steps in a vector v.
def SimRandomWalk3D(N=100,M=1000):
v=[]
for l in range (1 ,M) :
x=numpy . random . uniform (0 ,6 ,(N, 1 ) )
x[0]=0
i=1
k=0
sumax=1
CHAPTER 3. SIMULATIONS: RANDOM WALKS 27
sumay=1
sumaz=1
while (sumax!=0 or sumay!=0 or sumaz!=0) and i<N or k==0:
i f k==0:
k=1
sumax=0
sumay=0
i f x [ i ]>0 and x [ i ] <1:
sumax=sumax+1
i f x [ i ]>1 and x [ i ] <2:
sumax=sumax−1
i f x [ i ]>2 and x [ i ] <3:
sumay=sumay+1
i f x [ i ]>3 and x [ i ] <4:
sumay=sumay−1
i f x [ i ]>4 and x [ i ] <5:
sumaz=sumaz+1
i f x [ i ]>5 and x [ i ] <6:
sumaz=sumaz−1
i=i+1
i f sumax==0 and sumay==0 and sumaz==0:
v . append ( i −1)
return v
for plotting figure (3.6):
def freqHistogram3D (N=30,M=50000):
plt . h i s t (SimRandomWalk3D(2*N,M) , bins=N−1)
blue patch = mp. Patch ( color=’ blue ’ , l a b e l=’ Experimental frequencies ’ )
plt . legend ( handles =[ blue patch ] )
plt . xlabel ( ’N’ )
plt . ylabel ( ’ Frequency ’ )
and for plotting figure (3.7):
def freqHistogram3DLogLogLine (N=1000,M=10000):
bins=9
xam=[]
logn =[]
x = numpy . linspace (0 ,8 ,100)
X=l i s t (map(math . log , SimRandomWalk3D(2*N,M) ) )
(n , bins , patches ) = plt . h i s t (X, bins=numpy . arange ( bins ) , log=True )
blue patch = mp. Patch ( color=’ blue ’ , l a b e l=’ Experimental frequencies ’ )
plt . legend ( handles =[ blue patch ] )
plt . xlabel ( ’ log (N) ’ )
plt . ylabel ( ’ Frequency ’ )
for m in range ( 0 , 8 ) :
xam. append (0.5+m)
i f n [m]!=0:
logn . append (math . log10 (n [m] ) )
else :
logn . append (0)
CHAPTER 3. SIMULATIONS: RANDOM WALKS 28
print ( logn ,xam)
m, b = numpy . p o l y f i t (xam, logn , 1)
plt . plot (x , 10**(m*x+b ) , ’−’ )
print (m, b)
Chapter 4
Brownian motion
4.1 History of Brownian motion
Brownian motion takes its name after a Scottish botanist, Robert Brown. Brown was a famous
man in his time, but not for the discovery that has his name, but for the classification of the
plants of the New World. When looking through a microscope in 1827 at grains of pollens
suspended in water, Brown noticed that a group of grains always disperses and that individual
grains move around continuously, irregularly and very quickly. Such phenomena were observed
already prior to Brown, but only in organic particles. It was believed back then that it was a
property from organic molecules, having some kind of mysterious ‘vital force’. Brown was not
very excited about this idea that could fit the living pollen, so he decided to check if the same
motion was observed with non-organic particles. Both organic and non-organic particles dis-
played the same kind of motion, which showed that the motion had a physical origin. Brown’s
limited equipment could only show that this motion was not caused by currents in the liquid,
nor by convection, nor by evaporation of the solvent.
The mystery was left unsolved for many years. It was not considered as an important problem
in Physics but nevertheless many people attempted to solve it. Appart from the causes that
Brown himself showed that were not responsible for Brownian motion, chemical composition,
shape of container, and several of external influence were eliminated as possible causes. After
Maxwell and Boltzmann formulated the so-called kinetic theory, many physicists tried to ex-
plain Brownian motion in those terms, in particular by determining the velocity of the particles.
All those attempts failed.
Now all these failures are of historical interest, but back to the beginning of the 20th
they
were of great importance for two men: Albert Einstein and Marian Smoluchowski. That many
scientists had failed to explained the Brownian motion in terms of conventional Physics pre-
pared the ground for a new revolutionary explanations proposed by them. The year 1905 is
considered to be a miracle year for theoretical physics. In this year not only Einstein did pub-
lish a famous paper where he explained the mechanism of the Brownian motion, but he also
published two papers lying foundations for the Special Theory of Relativity and one explaining
the photoelectric effect, that would win him the Nobel prize in 1921. An independent paper
explaining also the Brownian motion was published in 1905 by Smoluchowski. This new and
revolutionary concepts were for many years heavily opposed by leading scientists.
Einstein’s and Smoluchowski’s idea was that the movement of Brownian particles was caused
by collisions with molecules of the solvent. This molecules move in display of their thermal
energy, of which the temperature is a measure. When a particle is suspended in any fluid,
like air or water, the atoms or molecules composing the fluid hit the particle from different
directions. While the human eye cannot see the effect of individual impacts, it can observe the
net motion caused by many impacts over a period of time. While this explanation may seem
29
CHAPTER 4. BROWNIAN MOTION 30
today trivial, it was far from trivial over 100 years ago. In fact, the atomistic hypothesis, that
is, the hypothesis that matter is grainy and cannot be continuously divided infinitely, was not
commonly accepted. Some scientists treated it as an unsupported working hypothesis and oth-
ers, including eminent figures as Wilhelm Ostwald, the 1909 Nobel Prize in chemistry, opposed
it vigorously.
Einstein and Smoluchowski claimed that this motion provided a proof of the existence of
molecules in the solvent and, what is more, that by observing the Brownian particles one
could get much insight into the properties of the molecules of the solvent. They observed that
the mean displacement of a particle (squared) was proportional to the duration of the obser-
vation, and that the proportionality constant was related to the so-called diffusion coefficient
D:
E[(Bt − B0)2
] = 2Dt, D =
KBT
γ
(4.1)
where KB is the Boltzmann constant, T the temperature and γ = 6πνR is the Stokes friction
coefficient for a spehere with radius R. These results rendered feasible many specific measures,
for example it was possible to experimentally determine the Avogadro constant.
It is interesting to know that explaining Brownian motion was not Einstein’s goal. He was
aiming to establish a relationship between the diffusion coefficient and the themperature, in
which he succeeded, but he also guessed what the thermal motion should look like. On the
contrary, Smoluchowski knew the experimental data on the Brownian motion very well and in-
tended to explain them. It is now clear that Smoluchowski obtained the results before Einsten,
but decided to publish them after he was impressed by Einstein work.
These papers have also answered several other questions. First, they provided a microscopical
explanation of diffusion (molecules of the substance that diffuses are ‘pulled through’ by the
collisions with the molecules in the solvent), second, they derived an equation known today
as the diffusion equation, and third they explained why all other attemps in describing the
Brownian motion in terms of velocities had failed. Smoluchowski noticed that displacements
of Brownian particles seen in a microscope resulted from a huge number of collisions with the
molecules of the solvent: the displacements were averaged over many such collisions. The time
between two consecutive collisions is much shorter that we can now, in the 21t
h century, ob-
serve. At any two observed zigzags there are many other zigzags that have happened and we
have failed to observe.
There is an important remark to do here. The Newtonian dynamics, commonly used in Smolu-
chowski times and today for explaining a large array of phenomena, says that the trajectory
of any particle can be described by means of a certain differential equation. To write down
this equation, you need to know all the forces acting on this particle. The forces may be
changing but as long as these changes are smooth, the trajectory of the particle will also be
smooth. Smoluchowski revolutionary point of view was that Brownian motion was not smooth,
therefore challenging a ‘sacred’ canon of Physics back then. This was truly a deviation of a
well-established paradigm, but it was succesful in explaning an experiment that other theories
could not explain. The diffusion equation mentioned above does not aim to explain perfectly
the behaviour of a single particle, but rather the behaviour a large enough amount of particles,
for example a drop of ink in a water tank. While the motion of a single particle may be erratic
and awkward, the collective behaviour can be quite decent and predictible.
This is a totally new approach in Physics, that changes from deterministic to probabilistic.
The works of Einstein and Smoluchowski have become one of the cornerstones of Probability
Calculus and the theory of Stochastic Processes
CHAPTER 4. BROWNIAN MOTION 31
4.2 The Difussion Equation
The diffusion equation is an equation that describes the behaviour of a collective motion of
particles in a material, resulting from the random movement of each particle. There are many
approaches to derive this equation, we will use two of them: the Einstein’s derivation and the
Macroscopic Derivation. First we will explain Einstein’s derivation. Then we will see Langevin’s
approach and how the diffusion equation is related to the Wiener process. After this we will
go through the Macroscopic derivation, which will give us insight on the importance of the
diffusion equation in ecology and biology. Lastly, we will see that the solution of the diffusion
equation follows the density of a Wiener process.
4.2.1 Einstein’s derivation
This derivation is very interesting from a historical point of view because it is the one that
appeared for the first time in 1905 in Albert Einstein’s papers. For mathematical simplicity we
consider the one dimensional case. We assume that that the motion is a composition of jumps
that can take arbitrary lengths z. Each possible jump is assigned a probability according to
a PDF φ(z). If we assume i.i.d jumps, the density of individuals located at x at time t + τ is
equal to the density of individuals that were located at a point at distance z at time τ before
and jumped to point x after waiting a time τ. Because the jump can be from any point, we
must consider all possible distances. Mathematically this means
ρ(x, t + τ) =
∞
−∞
ρ(x − z, t)φ(z)dz (4.2)
Notice that this equation is discrete in time and continuous in space. The function φ(z) is
known in ecology as the dispersal kernel. Equation (4.2) holds only when the population is
large enough, otherwise we should take care of possible fluctuations.
If we consider τ and z small enough, we can do a Taylor expansion. First for τ
ρ(x, t + τ) =
∞
n=0
τn
n!
∂n
ρ(x, t)
∂tn
(4.3)
and for z
ρ(x − z, t) =
∞
n=0
(−z)n
n!
∂n
ρ(x, t)
∂xn
(4.4)
and now we can insert these expressions into equation (4.2):
ρ(x, t) + τ
∂ρ(x, t)
∂t
+ ◦(τ2
) =ρ(x, t)
∞
−∞
φ(z)dz −
∂ρ(x, t)
∂x
∞
−∞
zφ(z)dz+
+
∂2
ρ(x, t)
∂x2
∞
−∞
z2
2!
φ(z)dz + ◦(z3
)
because φ(z) is a density function, it must be normalised which means
∞
−∞
φ(z)dz = 1. Besides,
we can assume isotropic movements, which means that φ(z) = φ(−z). Hence, when n is odd
we have
∞
−∞
zn
φ(z)dz = 0. With this things in mind we can rewrite the previous equation
ρ(x, t) + τ
∂ρ(x, t)
∂t
+ ◦(τ2
) = ρ(x, t) +
∂2
ρ(x, t)
∂x2
∞
−∞
z2
2!
φ(z)dz + ◦(z4
) (4.5)
CHAPTER 4. BROWNIAN MOTION 32
and now simplyfing and dividing by τ
∂ρ
∂t
=
∂ρ
∂t
∞
−∞
z2
2τ
φ(z)dz + ◦(z4
/τ) (4.6)
Finally we take the limit z → 0 and τ → 0, but in such way that z2
/τ is finite. Thus,
∂ρ
∂t
= D
∂2
ρ
∂x2
(4.7)
where
D ≡
1
2τ
∞
−∞
z2
φ(z)dz =
E(z2
)
2τ
(4.8)
Equation (4.7) is the well-known the diffusion equation. We will see later that the solution is
closely related to the Wiener process.
4.2.2 Langevin’s approach
As we mentioned earlier, explaining the Brownian motion by probabilistic means and as a
consequence of atomic collisions was revolutionary back in the time of Einstein. One of the
earliest models to describe Brownian motion was to suppose that the movement followed a pure
Wiener process. That description is quite accurate, however the Wiener process is known for
having some mathematical properties that cannot find an easy translation into the fields of
Physics. For example, we will see that if the particle starts at x = 0, then the point 0 is an
accumulation point, meaning that for every ε there exists infinitely many t ∈ (0, ε) such that
x = 0. It is difficult to imagine a real particle moving in this way.
One of the big problems about modelling Brownian motion via the Wiener process is that it
does not have a well-defined velocity, since the Wiener process is nowhere differentiable and
hence v =
dW
dt
is not defined in the ordinary sense. However, in Physics we usually assign the
velocity
v =
dW
dt
= σξ(t) (4.9)
to a particle with a random motion, where σ is a constant and ξ(t) represents white noise.
From this we see that the velocity is totally random.
Just some months after Einstein’s work, Paul Langevin presented an alternative description
to Brownian motion that is still very referenced in the literature. He also considered that the
fluctuating velocities observed in the Brownian particles should be due to noisy effects coming
from the surrounding particles in the solvent, but he also considered the friction effects on the
motion of the particles. So Langevin’s description of Brownian motion reads
dv
dt
= −γv + σξ(t) (4.10)
where the term −γv represents a friction force proportional to the particle velocity. Equation
(4.15) is usually named Ornstein-Uhlenbeck process since these two researchers provided in
1930 a detailed analysis of its statistical properties. The constant σ measures how large noise
fluctuations are. The velocity now is not simply a fluctuating variable but it changes smoothly
as a result of the joint effect of fluctuations and the friction force −γv. We can apply now
the limit of strong friction m|dv/dt| |γv|. As this suggests, the corresponding persistance
introduced in the particle motion is mainly governed by the friction term. In consequence, γ is
usually known as the persistence parameter. Under this limit equation (4.10) reads
γv = γ
dx
dt
= σξ(t) (4.11)
CHAPTER 4. BROWNIAN MOTION 33
and it can be shown that an equation of the form
dx
dt
=
√
2Dξ(t) (4.12)
leads in the macroscopic limit to a Fokker-Planck equation (see Appendix A) identical to the
diffusion equation:
∂P
∂t
= D
∂2
P
∂x2
(4.13)
For both equations to be equal it must happen that
D =
σ2
2γ2
(4.14)
From here it should already be clear the close relationship between diffusion equation and par-
ticle moving according to a Wiener process.
Now, if we don’t take the assumption that m|dv/dt| |γv| equation (4.10) can be integrated
to obtain
v(t) = v(0)e−γt
+
√
2DW(t) (4.15)
So we see that if the particle had an initial velocity, it will decrease until becoming purely
random. In the limit t → ∞ we recover the velocity of a particle moving according to the
Wiener process. The average position will be given again by integration:
E(x(t)) = E(x0) +
t
0
E(v)dt = E(x0) + E(v0)
1 − e−γt
γ
(4.16)
and we see that for the limit t → ∞ we have E(x) = E(x0) +
E(v0)
γ
, in comparison with
E(x) = E(x0) for the pure Wiener process.
4.2.3 Macroscopic Derivation
We consider a population with density ρ(x, t) located at some point x at time t (for example
a group of insects, or a drop of ink in water). To describe the movement it is necessary to
introduce another dependent quantity, the population flux J(x, t). This quantity is a vector
pointing in the direction of movement and indicates the net quantity of particles flowing in
that direction per unit time and per unit length (or area or volume). We will assume that the
density and flux are smooth functions of space and time. The balance equation states that the
rate of change of ρ(x, t) in a volume V closed by a surface Ω is due to the fluxes inward or
outward on V through Ω. Writing this in mathematical language we have
∂
∂t V
ρ(x, t)dV = −
Ω
J(x, t) · ndS (4.17)
where n is a unit vector normal to Ω and · is the scalar product.
Applying the divergence theorem
Ω
J(x, t) · ndS =
V
· J(x, t)dV (4.18)
into (4.17) yields
V
∂ρ(x, t)
∂t
+ · J(x, t) dV = 0 (4.19)
CHAPTER 4. BROWNIAN MOTION 34
where is the vector
∂
∂x
,
∂
∂y
,
∂
∂z
.
Since the volume of integration V can be arbitrarily small we obtain the continuity equation
∂ρ(x, t)
∂t
+ · J(x, t) = 0 (4.20)
In order to get an equation for the evolution of the population density we need to know how
J(x, t) depends on ρ(x, t). We will assume here that the flux J(x, t) is proportional to the
spatial population gradient ρ(x, t). This assumption is known as the Fick’s law, which can
be written as
J(x, t) = −D ρ(x, t) (4.21)
The minus sign takes into account that the flux is a vector pointing in the direction where
the population density decreases. Writing this last expression in (4.20) we get the diffusion
equation
∂ρ
∂t
= · (D ρ) (4.22)
which in the one-dimensional case it can be written simply as
∂ρ
∂t
= D
∂2
ρ
∂x2
(4.23)
and is also known as the heat equation.
4.2.4 Solution of the diffusion equation
The solution of such equation can be easily given using Fourier transforms. Tranforming (4.23)
by Fourier we obtain
∂ˆρ(k, t)
∂t
= −Dk2
ˆρ(k, t) (4.24)
where we have used the property of the transform of a derivative:
dnf(x)
dxn
= (−ik)n ˆf(k) (4.25)
Integrating (4.24) we obtain
ˆρ(k, t) = ρ(k, 0)e−Dk2t
(4.26)
In the simple case we consider that the population density is concentrated in x = x0, then we
have the initial condition ρ(x, 0) = δ(x − x0), which implies ˆρ(k, 0) = e−ikx0
. To obtain back
the original density function we apply the inverse Fourier transform
ρ(x, t) =
∞
−∞
eikx
ˆρ(k, t)dk =
∞
−∞
eik(x−x0)−Dk2t
dk =
1
√
4πDt
e−
(x−x0)2
4Dt (4.27)
which is the density function of a Wiener process (Wt, t ≥ 0).
From this result we conclude that systems governed by the diffusion equation will behave
following a Wiener process.
From result (4.27) we can calculate
E(x(t)) =
∞
−∞
xρ(x, t)dx = x0 (4.28)
CHAPTER 4. BROWNIAN MOTION 35
and
E(x2
(t)) =
∞
−∞
xρ(x, t)dx = x2
0 + 2Dt (4.29)
This result indicates that the scaling
E(x2
(t)) ∼ t (4.30)
holds in the large time limit. This is a fundamental sign of any diffusive transport. We will see
this result in more mathematical detail in a following section ‘Quadratic variation’.
4.3 Recurrence of Brownian motion
Now we will try to establish a comparison between the Brownian motion properties and those
of the random-walk reported in the previous Chapter.
Definition 4.3.1. A filtration on a probability space (Ω, F, P) is a family (F(t) : t ≥ 0} for
σ-algebras such that F(s) ⊂ F(t) ⊂ F for all s ≤ t.
If (Xt : t ≥ 0) is a stochastic process, then {F(t) : t ≥ 0} is the natural filtration for X if
F(t) = σ{Xs, s ≤ t}, where σ{X} denotes the smallest σ-algebra under which the random
variables Xs, s ≤ t are measurable.
Definition 4.3.2. Let X = (Xt, t ≥ 0) be a stochastic process and {F(t) : t ≥ 0} a filtration.
We say X is adapted to {F(t) : t ≥ 0} if
σ(Xt) ⊂ Ft, ∀t ≥ 0 (4.31)
that means that Xt is measurable with respect to Ft.
Definition 4.3.3. Let B = (Bt, t ≥ 0) be the Brownian motion and F(t) = σ{Bs, s ≤ t} its
corresponding natural filtration. A stochastic process X = (Xt, t ≥ 0) is adapted to Brownian
motion if X is adapted to {F(t) : t ≥ 0}.
Definition 4.3.4. Let (S, S) be a measure space and X = (Xt, t ≥ 0) a S-valued stochastic
process adapted to a filtration {F(t) : t ≥ 0}. We say the process X possesses the Markov
property with respect to F(t) if for each A ∈ S and each s, t ∈ T with s ≤ t:
P(Xt ∈ A|Fs) = P(Xt ∈ A|Xs) (4.32)
A Markov process is a stochastic process that satisfies the Markov property with respect its
natural filtration.
Remark 4.3.1. Said in simple terms, a Markov process is a process in which a future outcome
is only affected by the last outcome, and it doesn’t matter what happened before. For example,
we can imagine a fair coin tossing game in which every toss you win or lose 1e and you start
with 10e. If I know I have now 15e and want to guess the money I will have after the next
toss, only the information that I have 15e can help me predict the future outcome. It does not
matter how I came to have those 15e. This example is for the discrete case, but the continuous
works the same going to the limit.
Definition 4.3.5. We call a Markov process {X(t) > 0 : t ≥ 0} with values in Rd
ˆ Point recurrent, if, almost surely, for every x ∈ Rd
there is a (random) sequence tn → ∞
such that X(tn) = x for all n ∈ N.
CHAPTER 4. BROWNIAN MOTION 36
ˆ Neighbourhood recurrent, if, almost surely, for every x ∈ Rd
and ε > 0, there exists
a (random) sequence tn → ∞ such that X(tn) ∈ B(x, ε) for all n ∈ N.
ˆ Transient, if it converges to infinity almost surely
Before we can prove the Brownian motion recurrence, we will need some understanding on
harmonic functions. Especifically, we will have a look at the Dirichlet Problem. This problem
raises the following question: given a continuous function ϕ on the boundary of a domain, is
there a function u such that u(x) = ϕ(x) in the boundary of the domain and such that u(x)
is harmonic inside the domain? That is, we are trying to extend the definition of ϕ in the
boundary to a ’nice’ function in the whole domain. Gauss posed this problem in 1840, and
he thought he proved there was always a solution, but his reasoning was wrong and Zaremba
in 1911 gave counterexamples. However, if the domain is ’nice enough’ (see Poincar´e cone
condition below) there is always a solution.
The Dirichlet Problem can be solved purely by analytical tools. We will however solve it by
probabilistic means.
Definition 4.3.6. Let U be a domain, i.e., a connected open set U ⊂ Rd
. A function ϕ : U → R
is harmonic (on U) if it is twice continuously differentiable and, for any x ∈ U,
∆u(x) :=
d
j=1
∂2
u
∂x2
j
(x) = 0 (4.33)
Definition 4.3.7. Let U ⊂ Rd
be a domain. We say that U satisfies the Poincar´e cone
condition at x ∈ ∂U if there exists a cone V based at x with opening angle α > 0, and h > 0
such that V ∩ B(x, h) ⊂ Uc
.
Definition 4.3.8. A random variable T with values in [0, ∞], defined on a probability space
with filtration (F(t) : t ≥ 0) is called a stopping time with respect to (F(t) : t ≥ 0) if
{ω : T(ω) ≤ t} ∈ F(t) for every t ≥ 0.
Remark 4.3.2. Speaking intuitively, for T to be a stopping time, it should be possible to
decide whether or not {T ≤ t} has occurred on the basis of the knowledge of F(t).
Definition 4.3.9. Suppose that X = (Xt : t ≥ 0) is a stochastic process on a probability space
(Ω, F, P) with natural filtration {F(t) : t ≥ 0)}. For any t ≥ 0 we can define the sigma algebra
F(t+
) to be the intersection of all Fs for s ≥ t. Then for any stopping time τ on Ω we can
define
F(τ) = {A ∈ F : {τ = t} ∩ A ∈ F(t+
), ∀t ≥ 0} (4.34)
Then X is said to have the strong Markov property if, for each stopping time τ, conditioned on
the event {τ < ∞}, we have that for each t ≥ 0, Xτ+t is independent of F(τ) given Xτ .
Theorem 4.3.1 (Dirichlet Problem). Suppose U ∈ Rd
is a bounded domain such that every
boundary point satisfies the Poincar´e cone condition, and suppose ϕ is a continuous function
on ∂U. Let τ(∂U) = inf{t > 0 : B(t) ∈ ∂U}, which is an almost surely finite stopping time.
Then the function u : ¯U → R given by
u(x) = E(ϕ(B(τ(∂U)))|B(0) = x), for x ∈ U (4.35)
is the unique continuous function harmonic on U with u(x) = ϕ(x) for all x ∈ ∂U.
Remark 4.3.3. If the Poincar´e cone condition holds at every boundary point, one can simulate
the solution of the Dirichlet problem by running many independent Brownian motions, starting
in x ∈ U until they hit the boundary of U and letting u(x) be the average of the values of ϕ
on the hitting points.
CHAPTER 4. BROWNIAN MOTION 37
With this result in mind, let’s find explicit solutions u : cl A → R of the Dirichlet problem on
an annulus A = {x ∈ Rd
: r < |x| < R}. The reason to study this case is that the recurrence
problem will be a particular case of this solution. It is first reasonable to assume that u is
spherically symmetric, i.e. there is a function ψ : [r, R] → R such that u(x) = ψ(|x|2
). We can
express derivatives of u in terms of ψ as
∂iψ(|x|2
) = ψ (|x|2
)2xi (4.36)
∂iiψ(|x|2
) = ψ (|x|2
)4x2
i + 2ψ (|x|2
) (4.37)
Therefore, ∆u = 0 means
0 =
d
i=1
ψ (|x|2
)4x2
i + 2ψ (|x|2
) = 4|x|2
ψ (|x|2
) + 2dψ (|x|2
)
Letting y = |x|2
> 0 we can write this as
ψ (y) = −
d
2y
ψ (y)
This is solved by every ψ satisfying ψ (y) = Cy−d/2
and thus ∆u = 0 holds on {|x| = 0} for
u(x) =



|x| if d = 1
2 log |x| if d = 2
|x|2−d
if d = 3
(4.38)
We write u(r) for the value of u(x) for all x ∈ ∂B(0, r). Now define stopping times
Tr = τ(∂B(0, r)) = inf{t > 0 : |B(t)| = r} for r > 0 (4.39)
and denote by T = Tr ∧ TR the first exit time from A. By the Dirichlet Problem Theorem
(4.3.1) we have
u(x) = E(u(B(T))|B(0) = x) = u(r)P(Tr < TR|B(0) = x) + u(R)(1 − P(Tr < TR))
which can be solved
P(Tr < TR|B(0) = x) =
u(R) − u(x)
u(R) − u(r)
(4.40)
This formula gives an explicit computation of the probability that the Brownian motion hits
∂B(0, r) before ∂B(0, R). We have just proved the following theorem
Theorem 4.3.2. Suppose {B(t) : t ≥ 0} is a Brownian motion in dimension d ≥ 1 started in
x ∈ A, which is an open annulus A with radii 0 < r < R < ∞. Then,
P(Tr < TR|B(0) = x) =



R − |x|
R − r
if d = 1
log R − log |x|
log R − log r
if d = 2
R2−d
− |x|2−d
R2−d − r2−d
if d ≥ 3
(4.41)
if we take the limit R → ∞ we get the following corollary
CHAPTER 4. BROWNIAN MOTION 38
Corollary 4.3.1. For any x /∈ B(0, r), we have
P(Tr < ∞|B(0) = x) =



1 if d ≤ 2
rd−2
|x|d−2
if d ≥ 3
(4.42)
finally, we have enough tools to prove the following theorem
Theorem 4.3.3. Brownian motion is
ˆ point recurrent in dimension d = 1,
ˆ neighbourhood recurrent, but not point recurrent, in d = 2,
ˆ transient in dimension d ≥ 3.
Proof. ˆ For d = 1 fix x ∈ R. Let’s take B(x + 2, 1) and B(x − 2, 1). Notice that x
lies in between these two balls. We know by Corollary (4.3.1) that the stopping time
t1 = inf{t > 0 : B(t) ∈ B(x + 2, 1)} is almost surely finite. Also, by the same corollary,
the stopping time t2 = inf{t > 0 : B(t) ∈ B(x − 2, 1)} is almost surely finite. Because
of the continuity of the Brownian motion there exists a time t such that t1 < t < t2
and B(t) = x. Using the strong Markov property at time t2 + 1 we can repeat the
previous argument. In fact, we can repeat this argument as many times as we want, so
the Brownian motion in one dimension is recurrent.
ˆ For d = 2 fix ε > 0 and x ∈ Rd
. By Corollary (4.3.1)the stopping time t1 = inf{t > 0 :
B(t) ∈ B(x, ε)} is almost surely finite. Using the Markov property at time t1 + 1 we see
that this applies to t2 = {t > t1 + 1 : B(t) ∈ B(x, ε)}, and continuing like this, we obtain
a sequence of times tn → ∞ such that, almost surely, B(tn) ∈ B(x, ε) for all n ∈ N and
hence is neighbourhood recurrent.
ˆ For d = 3 to make notation less cumbersome we use the notation Px(A) := P(A|B(0) =
x). We first see that that the probability that the Brownian motion does not go out from
a ball is 0, that is
Px(|Bt| < R, ∀t ≥ 0) = 0 (4.43)
Indeed, if we take the first coordinate, B1
t , of Bt we have
Px(|Bt| < R, ∀t ≥ 0) ≤ Px(|B1
t | < R, ∀t ≥ 0) = 0 (4.44)
where we have used property 4.3.2.
Let x ∈ R3
and n ∈ N such that n3
> |x|. From the previous argument we have that the
exit time
Tn3 = inf{t > 0 : |Bt| = n3
} < ∞ (4.45)
almost surely. That means that if the Brownian motion starts at x then it will get out of
the ball of radius n3
with probability one. What we will see next is that for every ω ∈ Ω
CHAPTER 4. BROWNIAN MOTION 39
there exists n(ω) ∈ N such that ∀n ≥ n(ω) we have that Bt(ω) ≥ n for every t ≥ Tn3 (ω).
Px(|Bt| < n for some t > Tn3 ) = Ex(1{|Bt|<n for some t>Tn3 })
= Ex(E(1{|Bt|<n for some t>Tn3 }|BTn3 ))
= Ex(P(|Bt+Tn3 | < n for some t > 0|BTn3 ))
= Ex(PBT
n3
(|Bt| < n for some t > 0))
= Ex(PBT
n3
(Tn ≤ ∞))
= Ex
n
|BTn3 |
d−2
= Ex
n
n3
d−2
=
1
n2
d−2
where we have used the strong Markov property in the fourth equality and corollary 4.3.1
in the sixth equality. If we write An = {|Bt| < n for some t > Tn3 } then we have for
d ≥ 3
∞
n=1
P(An) < ∞ (4.46)
and thus using Borel Cantelli lemma the events An can happen with probability 1 only a
finite number of times.
Alternative proof for recurrence in 1D
For a one dimensional Brownian motion, there is a faster way to show that it is point recurrent.
We think it is interesting to add this section because appart from showing an alternative proof,
we see two important properties of the Brownian motion that help us understand it better.
Property 4.3.1 (Reflection principle). Let B = (Bt, t ∈ [0, ∞)) be one dimensional Brownian
motion and a > 0, then
P(max
0≤s≤t
Bs > a) = 2P(Bt > a) (4.47)
Proof. We will prove this property using heuristic arguments, for a formal proof requires ad-
vanced tools not covered in this thesis. We have the following equation
P(max
0≤s≤t
Bs > a, Bt > a) = P(max
0≤s≤t
Bs > a, Bt < a) (4.48)
The idea behind it is that if the Brownian motion has reached value a at some time τ < t,
then since Bτ ∼ N(0, τ) there is a bijective correspondence between paths with Bt > a and
Bt < a. In other words, for every path from τ to t there exists a reflective path with respect
the horizontal line y = a that has the same “probability” as such path. Of course the actual
probability of any path is 0, hence this argument is only heuristic. See figure ??.
Since P(Bs = a) = 0 if we add P(max
0≤s≤t
Bs > a, Bt > a) to both sides of equation (4.48) we
obtain
2P(max
0≤s≤t
Bs > a, Bt > a) = P(max
0≤s≤t
Bs > a) (4.49)
and noting that {max
0≤s≤t
Bs > a, Bt > a} = {Bt > a} we are done.
CHAPTER 4. BROWNIAN MOTION 40
Property 4.3.2. Let B = (Bt, t ∈ [0, ∞)) one dimensional Brownian motion, then
P(lim sup
t→∞
Bt = +∞) = P(lim inf
t→∞
Bt = −∞) = 1 (4.50)
Proof. Let a > 0, then using property 4.3.1
P(sup
t≥0
Bt > a) ≥ P( sup
0≤s≤t
Bs > a)
= 2P(Bt > a)
= 2P
Bt
√
t
>
a
√
t
= 2 1 − Φ
a
√
t
where Φ is the distribution function of a N(0, 1).
2 1 − Φ
a
√
t
−→ 2(1 − Φ(0)) = 1, as t −→ ∞ (4.51)
and
P(lim sup
t→∞
Bt = ∞) = P(
∞
a=1
{sup
t≥0
Bm > a}) = 1 (4.52)
And we also obtain
P(lim inf
t→∞
Bt = −∞) = P(lim sup
t→∞
(−Bt) = ∞) = 1 (4.53)
because (−Bt, t ∈ [0, ∞)) is a Brownian motion.
Corollary 4.3.2. Brownian motion is point recurrent for d = 1.
Proof. Let A = {ω : B(ω) does not have infinite zeros}. Suppose P(A) > 0. Then for ω ∈ A
there is no sequence tn → ∞ such that Btn (ω) = 0 for all n ∈ N. That means there exists
T > 0 such that Bt(ω) = 0 for all t > T. Without loss of generality suppose Bt(ω) > 0 for
all t > T, but this implies that lim inf
t→∞
Bt(ω) = −∞ since the Brownian motion cannot cross
the x-axis, because Brownian motion has continuous paths. Hence P(lim inf
t→∞
Bt(ω) = −∞) > 0
which means that P(lim inf
t→∞
Bt(ω) = −∞) < 1 in contradiction with property 4.3.2.
4.4 Expected time to reach a specific position
We showed in 2.1.1 that the expected time for a random walk to get back to the origin for
dimension 1 was infinite. We will now show a similar result for Brownian motion, but in this
case we will see that the expected time for the Brownian motion to reach any point is infinite.
Theorem 4.4.1. Let a = 0. If inf{t > 0 : Bt = a} exists we define Ta = inf{t > 0 : Bt = a}; if
inf{t > 0 : Bt = a} does not exist we define Ta = ∞. Then E(Ta) = ∞, that is, the expected
time to reach any point different than 0 for the brownian motion is infinite.
CHAPTER 4. BROWNIAN MOTION 41
Proof. We will show a relation between the density of Ta and Bt and from here deduce that
E(Ta) = ∞.
Let’s first assume that a > 0, then
P(Ta > t) = P(max
0≤s≤t
Bt < a}
= 1 − P(max
0≤s≤t
Bt > a)
= 1 − 2P(Bt > a)
where in the last step we used property 4.3.1. This implies that
P(Ta ≤ t) = 2P(Bt > a) = 2P(Bt ≤ −a) =
2
√
2π
−a/
√
t
−∞
e−x2/2
dx (4.54)
and Ta < ∞ almost surely, so the density function of Ta is
fa(t) =
d
dt
P(Ta ≤ t)
=
d
dt
2P(Bt ≤ −a)
=
d
dt
2P
Bt
√
t
≤ −
a
√
t
= 2
1
√
2π
d
dt
− a√
t
−∞
e−x2/2
dx
= 2
1
√
2π
e−a2
2t
a
2
√
t3
=
a
√
2πt3
e−a2
2t
where we have used that Bt/
√
t ∼ N(0, 1) and the fundamental theorem of calculus. Hence
E(Ta) =
∞
0
tfa(t)dt ∼
∞
0
1
√
t
e
−a
2t dt = ∞ (4.55)
The argument applies mutatis mutandi for a < 0.
We notice that for a = 0 something does not work, since if we use the density function from
theorem 4.4.1 we get fa(t) ≡ 0, which obviously is not a density function. The problem lies
that for a Brownian motion that starts at 0, the point 0 is an accumulation point for the zeroes
of the Brownian motion, i.e., for every ε > 0 there exists infinitely many t ∈ (0, ε) such that
Bt = 0. The following property will support this claim:
Property 4.4.1. Let h > 0, then
P( max
0≤s≤h
Bs > 0) = P( min
0≤s≤h
Bs < 0) = 1 (4.56)
Proof. Take a > 0, then
P( max
0≤s≤h
Bs > 0) ≥ P( max
0≤s≤h
Bs > a)
= 2 1 − Φ
a
σ
√
h
→ 1 as a → 0
CHAPTER 4. BROWNIAN MOTION 42
where we have used in the second step property 4.3.1. Hence we obtain
P( max
0≤s≤h
Bs > 0) = 1 (4.57)
Finally, if we notice that
P( min
0≤s≤h
Bs < 0) = P( max
0≤s≤h
−Bs > 0) (4.58)
we can use the same arguments and get
P( min
0≤s≤h
Bs < 0) = 1 (4.59)
4.5 Other properties of Brownian motion
In this section we will show some interesting properties of the Brownian motion that we will
use in the next sections.
4.5.1 Quadratic variation
Let πn : 0 = t0 < t1 < · · · < tn = T be a partition on [0, T]. For a smooth function we have the
following proposition.
Proposition 4.5.1. Let (πn) a sequence of refining partitions with mesh(πn) → 0 on [0, T] and
f ∈ C1
. Then
n
i=1
(f(ti) − f(ti−1))2
→ 0, as n → ∞ (4.60)
Proof. We can use the mean value theorem, since f ∈ C1
.
n
i=1
(f(ti) − f(ti−1))2
=
n
i=1
f(ξi)2
(ti − ti−1)2
≤ max
0≤i≤n
(f(ξi)2
)
n
i=1
(ti − ti−1)2
≤ max
0≤i≤n
(f(ξi)2
)mesh(πn)
n
i=1
(ti − ti−1)
= Cmesh(πn)T → 0
where ξi ∈ (ti, ti+1).
However, for the Brownian motion we have a different result.
Proposition 4.5.2. Let (πn) be a sequence of refining partitions with mesh(πn) → 0 on [0, T]
and B = (Bt, t ≥ 0) a Brownian motion. Then
Qn =
n
i=1
(B(ti) − B(ti−1))2
=
n
i=1
(∆iB)2 L2
−→ T, as n → ∞ (4.61)
and thus it converges also in probability.
CHAPTER 4. BROWNIAN MOTION 43
Proof. We want to see that
E[(Qn − T)2
] −→ 0, as n → ∞ (4.62)
First thing to notice is that E(Qn) = T. Indeed, since ∆iB ∼ N(0, ti − ti−1) we have
E(Qn) = E
n
i=1
(B(ti) − B(ti−1))2
=
n
i=1
E(B(ti) − B(ti−1))2
=
n
i=1
(ti − ti−1) = T (4.63)
From here we get the following expression
E[(Qn − T)2
] = E[(Qn − E(Qn))2
] = V ar(Qn) (4.64)
which can be written using the identity V ar(X) = E(X2
) − E(X)2
and the fact that the
increments ∆iB are independent as
V ar(Qn) =
n
i=1
V ar (∆iB)2
=
n
i=1
E(∆iB)4
− ∆2
i (4.65)
where ∆i = ti − ti−1.
It is well know that for a N(0, 1) random variable B1, EB4
1 = 3, then
E(∆iB)4
= E (∆i)1/2
B1
4
= 3∆2
i (4.66)
which implies
V ar(Qn) = 2
n
i=1
∆2
i (4.67)
thus if
mesh(πn) = max
i=1,...,n
∆i → 0 (4.68)
we obtain that
E[(Qn − T)2
] = V ar(Qn) ≤ 2mesh(πn)
n
i=1
∆i = 2Tmesh(πn) → 0 (4.69)
4.5.2 Unbounded variation
Proposition 4.5.3. Let B = (Bt, t ≥ 0) be a Brownian motion, then almost surely
sup
πn
n
i=1
|∆iB| = +∞ (4.70)
that is
P ω ∈ Ω : sup
πn
n
i=1
|∆iB(ω)| = +∞ = 1 (4.71)
where we take the suprema over all partitions πn of [0, T], where ∆iB = Bti
− Bti−1
.
CHAPTER 4. BROWNIAN MOTION 44
Proof. Let
A = ω ∈ Ω : sup
π
n
i=1
|∆iB(ω)| < C(ω) < ∞ (4.72)
and assume that
P(A) > 0 (4.73)
and consider a sequence of partitions (πn) such that mesh(πn) → 0. From proposition 4.5.2
Qn =
n
i=1
(B(ti) − B(ti−1))2 L2
−→ T (4.74)
which means that there is a subsequence of partitions, σnk
such that
Qnk
a.s
−→ T > 0 (4.75)
and thus
P ω ∈ Ω : lim
k
Qnk
(ω) = T = 1 (4.76)
which implies
P ω ∈ Ω : lim
k
Qnk
(ω) = T = 0 (4.77)
On the other hand for ω ∈ A we have
Qn(ω) =
n
i=1
(B(ti) − B(ti−1))2
≤ max
i=1,...,n
|∆iB(ω)|
n
i=1
∆iB
≤ C(ω) max
i=1,...,n
|∆iB(ω)| → 0
because Bt is continuous and then uniformly continuous on [0, T]. Hence
P ω ∈ Ω : lim
k
Qnk
(ω) = 0 = T > 0 (4.78)
in contradiction with (4.77).
Chapter 5
Simulations: Brownian Motion
In this section we want to simulate a Brownian Motion. For that, some prior knowledge of
numerical integration of stochastic differential equations will be needed. The tools developed
in this chapter will let us indeed integrate more complex SDEs than the Brownian motion.
5.1 Numerical integration of stochastic differential equa-
tions with Gaussian white noise
Let us start with a simple stochastic differential equation:
˙x(t) = f(t) + ξ(t) (5.1)
where f(t) is a deterministic function and ξ(t) is a Gaussian white noise, i.e., ξ(t) ∼ N(0, 1).
If we integrate we get
x(t) = x(0) +
t
0
f(s)ds +
t
0
ξ(s)ds (5.2)
which can be written as
x(t) = x(0) + F(t) + B(t) (5.3)
where F(t) =
t
0
f(s)ds and B(t) is the brownian motion. This expression indicates that x(t)
is a Gaussian process whose mean and correlation are given by
E(x(t)) = x(0) + F(t) (5.4)
E(x(t)x(t )) = [x(0) + F(t)][x(0) + F(t )] + min(t, t ) (5.5)
Now we will focus on a numerical solution, rather than solving the equations. Our final aim will
be to be able to generate trajectories, that is, we want to obtain x(t) at discrete time intervals
x(t + h) = x(t) +
t+h
t
˙x(s)ds = x(t) +
t+h
t
f(s)ds +
t+h
t
ξ(s)ds (5.6)
Introducing
fh(t) :=
t+h
t
f(s)ds (5.7)
and
wh(t) :=
t+h
t
ξ(s)ds = B(t + h) − B(t) (5.8)
45
CHAPTER 5. SIMULATIONS: BROWNIAN MOTION 46
we can write
x(t + h) = x(t) + fh(t) + wh(t) (5.9)
In this equation, as wh(t) is the difference of the Brownian motion at two different times, it is
a Gaussian process and can be fully characterized by giving the mean and correlations:
E(wh(t)) =
t+h
t
E(ξ(s))ds = 0
E(wh(t)wh(t )) =
t+h
t
t +h
t
E(ξ(s)ξ(u))dsdu
=
t+h
t
t +h
t
δ(s − u)dsdu
To evaluate this integral, we make use of the properties of the Dirac δ function. We can assume,
without loss of generality, that t > t. If t > t + h, the integral is 0, as there is no overlap in
the integration intervals, and the delta function vanishes. If t ≤ t < t + h, the double integral
equals the length of the overlap interval, that is
E(wh(t)wh(t )) =
t+h
t
ds = t − t + h (5.10)
We are particularly interested for t = t,
E(wh(t)2
) = h (5.11)
which is in line with what we proved in Proposition (4.5.2). In numerical calculations, time
takes always discrete values as multiples of the integration time step. If we consider discrete
times t = ti = ih, t = tj = jh, the correlation becomes
E(wh(ti)wh(tj)) = hδij (5.12)
We introduce now a set of independent Gaussian random variables {ui} of zero mean and
variance 1:
E(ui) = 0, E(uiuj) = δij (5.13)
in terms of which we can write
wh(ti) =
√
hui (5.14)
Finally, the recurrence relation to generate numerically trajectories of the stochastic process
defined by (5.1) is
x(t0) = x0 (5.15)
x(ti+1) = x(ti) + fh(ti) +
√
hui (5.16)
For small h, the deterministic contribution fh(t) can be approximated as fh(t) = hf(t), implying
that for small h the deterministic contribution is of order h1
and successive contributions go as
h2
, h3
, and so on. In contrast the stochastic contribution is of order h1/2
, an order that never
appears in methods for numerical integration of ordinary differential equations. A consequence
of this scaling with the time step is that at very small times the stochastic contribution, being of
order h1/2
, dominates over the deterministic one, of order h. Over the course of an integration
for a large period, the stochastic contributions on average will be generally of less importance
than the deterministic ones.
A Brownian motion can be now easily simulated from equation (5.16). For a Brownian motion
that starts at the origin, we have x(t0) = 0. Furthemore, fh(ti) = 0 for all i. We obtain the
following simple formula
x(t0) = 0 (5.17)
x(ti+1) = x(ti) +
√
hui (5.18)
CHAPTER 5. SIMULATIONS: BROWNIAN MOTION 47
Euler-Maruyama method
We start with the equation
˙x(t) = q(x) + g(x)ξ(t) (5.19)
For additive noise, g(x) does not depends on x, and g(x) =
√
D with D being a constant, then
the Euler-Maruyama method for stochastic differential equations is given by
x(t + h) = x(t) + hq(x(ti)) +
√
Dhu(t) + O[h3/2
] (5.20)
As we need Stratonovich calculus to show the derivation of this formula, we will just state it
and use it later.
5.1.1 Runge-Kutta-Type methods
Equation (5.16) is enough to simulate the pure brownian motion, but in this section we will
develop a more advance method for integrating other kind of stochastic differential equations.
We start with the equation (5.19) and we would like to develop a method inspired by the
Runge-Kutta methods used for numerical integration of ordinary differential equations. There
is a large family of Runge-Kutta methods. Here, we focus on one of the simplest methods
of this family, known as the Heun method, which is of second order. We start revisiting the
deduction of the Heun numerical algorithm for ordinary differential equations and then we
extend the ideas to the case of stochastic differential equations. Let’s start considering the
ordinary differential equation
˙x(t) = q(t, x) (5.21)
where, in general, q(t, x(t)) is a nonlinear function of x(t) which can also depend on the time
explicitly. We start by applying the Euler method to integrate this equation:
x(ti+1) = x(ti) + hq(ti, x(ti)) + O[h2
] (5.22)
This is an explicit map since the right-hand side depends only on known values of the variable
x at previous times, while the unknown variable x(ti+1) is explicitly isolated in the left-hand
side. In fact, (5.22) corresponds to the explicit Euler, also called the forward Euler method.
There is also an implicit Euler method (also called the backward Euler method) to integrate
the same equation, which is given by
x(ti+1) = x(ti) + hq(ti+1, x(ti+1)) + O[h2
] (5.23)
The implicit Euler method is more stable than the explicit one but it has the disadvantage
that, in general, it is difficult to invert the function q(t, x(ti)) appearing on the right-hand side
so that one could get an explicit expression for x(ti+1) as a function of x(ti). Finally, there is
a semi-implicit Euler method that combines both approaches and which is of order O[h3
]. It is
given by
x(ti+1) = x(ti) +
h
2
[q(ti, x(ti)) + hq(ti+1, x(ti+1))] + O[h3
] (5.24)
This method suffers from the same inconvenience as the implicit Euler: the recurrence relation
is given by an implicit map. A way to circumvent this inconvenience is to replace x(ti+1) on
the right-hand side by the value obtained by using the explicit Euler method (5.22), namely by
x(ti) + hq(t, x(ti)):
x(ti+1) = x(ti) +
h
2
[q(ti, x(ti)) + q(ti+1, x(ti) + hq(t, x(ti)))] + O[h3
] (5.25)
CHAPTER 5. SIMULATIONS: BROWNIAN MOTION 48
This is the Heun method that is usually written as
k = hq(t, x(ti)) (5.26)
x(ti+1) = x(ti) +
h
2
[q(ti, x(ti)) + q(ti+1, x(ti) + k)] (5.27)
We now apply the same ideas to a stochastic differential equation with white noise (5.19). Let
us start with a semi-implicit version of Euler’s method given by (5.20)
x(ti+1) = x(ti) +
h
2
[q(ti, x(ti)) + q(ti+1, x(ti+1))] +
√
hui
2
[q(ti, x(ti)) + q(ti+1, x(ti+1))] (5.28)
And now replace x(ti) on the right- hand side by the prediction given by the Euler-Maruyama
algorithm (5.20). The resulting algorithm can be written as
k = hq(t, x(ti)) (5.29)
l =
√
huig(t, x(ti)) (5.30)
x(ti+1) = x(ti) +
h
2
[q(ti, x(ti)) + q(ti+1, x(ti) + k + l)] +
√
hui
2
[g(ti, x(ti)) + g(ti+1, x(ti) + k + l)]
(5.31)
This is known as the stochastic Heun method. Notice that for the pure Brownian motion one
has q(t, x(ti)) = 0 and g(t, x(ti)) = 1 which converges to the simple formula (5.18). 1
5.1.2 Simulations
In this section we will simulate the Brownian motion and will see how long it takes until it
reaches back the value a = 0.1, that is, for which t = 0 we have that Bt = 0.5. The reason
why we do not take a = 0 is not arbitrary. In the discrete case for a random walk there was
no problem in taking a = 0, but for a Brownian motion some issues arise. The most important
is regarding property 4.4.1. Since we know that next to 0 there are infinite points t such that
Bt = 0, it doesn’t make a lot of sense to simulate this case. For this reason we have decided to
take a = 0, for example a = 0.1.
We will gather the results in a histogram. The simulations will be somewhat similar to those for
the random walk. However, one big difference to notice, is that Brownian motion is a continuous
function while a random walk is a discrete one. Another to notice is that the stopping time Ta
has a continuous density, which implies that the probability of every single point is 0. Taking
into account these differences, we cannot make histograms for Brownian motion that reaches a
point after N steps, because every step is infinitely small (theoretically, although in simulations
we will discretize). For this reason counting how many come back after N steps does not make
conceptual sense and, therefore, the bins in the histogram will represent a time interval rather
than a time point. The following simulation contains 106
different points, calculated according
to the formula
x(t0) = 0 (5.32)
x(ti+1) = x(ti) +
√
hui (5.33)
1
These more sophisticated methods were developed in the thesis in order to simulate some more complex
stochastic differential equations than the pure Brownian motion. However, because of lack of time and space
we decided to give priority to other topics.
CHAPTER 5. SIMULATIONS: BROWNIAN MOTION 49
A total of 105
simulations were run. For practical reasons, the bins of the histograms represent
intervals in log(t) rather than just t. We have also ploted the theoretical density obtained in
Theorem 4.4.1 to compare results. First, we need to do a change of variable for the density,
because we are plotting the density of Y = g(Ta) = log(Ta) instead of the density of Ta:
fY (y) = fa(g−1
(y))|(g−1
) (y)|1(−∞,∞)
=
a
√
2πey
e− a2
2ey
This is the result we obtain:
Figure 5.1: Shows the relative number of particles that reached Bt = 0.5 for the first time at
time log(t).
First thing to notice is that theoretical results and empirical results do not match as perfectly
as in the random walk. We observe that for several values the experimental data is lightly large
than the predicted value. The reason for this discrepancy is that we plotted the histogram for a
fixed number of bins and selected the option ‘normed=True’, that is, the sum of all bins is equal
to 1. For a perfect match to the theoretical curve, we should consider every bin from −∞ to
∞. However, we plotted the high probability bins and, appart from those small discrepancies,
we observe a quite good match.
5.1.3 Code
We will now write a code to plot four different Brownian motion samples, using the equation
(5.16). In our case
def plotBrownianMotion (h=1, l =1000):
x=[]
x . append (0)
y=[]
y . append (0)
CHAPTER 5. SIMULATIONS: BROWNIAN MOTION 50
z =[]
z . append (0)
v=[]
v . append (0)
for i in range (0 , int ( l /h ) ) :
x . append (x [ i ]+np . sqrt (h)*np . random . normal ( loc =0.0 , s c a l e =1.0))
plt . plot (x , c=’b ’ )
for i in range (0 , int ( l /h ) ) :
y . append (y [ i ]+np . sqrt (h)*np . random . normal ( loc =0.0 , s c a l e =1.0))
plt . plot (y , c=’ r ’ )
for i in range (0 , int ( l /h ) ) :
z . append ( z [ i ]+np . sqrt (h)*np . random . normal ( loc =0.0 , s c a l e =1.0))
plt . plot ( z , c=’y ’ )
for i in range (0 , int ( l /h ) ) :
v . append (v [ i ]+np . sqrt (h)*np . random . normal ( loc =0.0 , s c a l e =1.0))
plt . plot (v , c=’ g ’ )
plt . show ()
This will alow us to draw Brownian motion samples. The same code is valid for plotting
Brownian motion samples in 2D, only changing plt.plot(x,c=’b’) for plt.plot(x,y,c=’b’) For
plotting the histogram 5.1 we have written the following code
def simBrownianMotion (h=1, l =10000,N=1000):
v=[]
for n in range (1 ,N) :
#x=numpy . random . normal (0 ,1 ,3)
i=0
suma=0
sumaa=0
while (0.5 −sumaa)*(0.5 −suma)>=0 and i<l :
sumaa=suma
suma=suma+np . sqrt (h)*np . random . normal (0 ,1)
i=i+h
i f (0.5 −sumaa)*(0.5 −suma)<0:
v . append ( i−h)
return v
t1 = np . arange (−6, 10 , 0.1)
plt . plot ( t1 ,
np . exp ( −0.5**2/(2*np . exp ( t1 )))* 0.5/ np . sqrt (2*math . pi *np . exp ( t1 ) ) )
def freqHistogramBrownian (h=0.01 , l =1000,N=100000):
bins=13
X=l i s t (map( log , simBrownianMotion (h , l ,N) ) )
(n , bins , patches ) = plt . h i s t (X, bins =[−5,−4.5,−4,−3.5,−3,−2.5,
−2 , −1.5 , −1 , −0.5 ,0 ,0.5 ,1 ,
1. 5 , 2 , 2.5 ,3 ,3 .5 , 4 , 4.5 ,5 ,
5 . 5 , 6 , 6 . 5 , 7 , 7 . 5 , 8 ] , normed=True )
plt . xlabel ( ’ log ( t ) ’ )
CHAPTER 5. SIMULATIONS: BROWNIAN MOTION 51
plt . ylabel ( ’ Frequency ’ )
plt . show ()
5.1.4 Path samples
Running the code above for 1D Brownian motion, we generated the following sample paths.
Figure 5.2: Four different samples of 1D Brownian motion, starting at 0.
The time steps used are h = 1 and the total length of the Brownian motion is l/h = 1000. And
the next plot shows the simulation of two independent 2D Brownian motion starting at 0.
Figure 5.3: Two different samples of 2D Brownian motion, starting at (0, 0).
5.2 Dirichlet problem
Now we will simulate the Dirichlet problem stated in theorem 4.3.1. Our boundary ∂U will
be a square centered in the origin of side l = 10 and our function on the boundary will be
f(x, y) = x+y and want to extend it to a harmonic function inside the square. This is a simple
CHAPTER 5. SIMULATIONS: BROWNIAN MOTION 52
example, and we know that the extension will be u(x, y) = f(x, y) = x + y for all (x, y) ∈ U, so
we can verify if the algorithm works. A Brownian motion will start at 0 and will at some point
cross the boundary. The average of all the points at which the simulations crosses the boundary
will give us the value of f(x, y). In this example we will calculate u(0, 0). Intuitively, we would
expect that u(0, 0) = 0, because of the symmetry of this case. For every Brownian motion
that crosses the boundary at some point (x, y) we would expect another Brownian motion to
cross it at the point (−x, −y), so the average of all this points looks like it should be 0. We
will run 105
Brownian motions starting at (x, y) = (0, 0) to compute this point. The result is
u(0, 0) = 0.0176. The code we used is the following.
5.2.1 Code
def f (x , y ) :
return x+y
def d i r i c h l e t (h=1, l =10000,N=100000,x=0,y=0):
v=[]
for n in range (1 ,N) :
#x=numpy . random . normal (0 ,1 ,3)
i=1
sumax=x
sumaax=x
sumay=y
sumaay=y
while (10−sumaax)*(10−sumax)>=0 and (10−sumaay)*(10−sumay)>=0
and (−10−sumaax)*(−10−sumax)>=0 and (−10−sumaay)*(−10−sumay)>=0
and i<l :
sumaax=sumax
sumax=sumax+np . sqrt (h)*np . random . normal (0 ,1)
sumaay=sumay
sumay=sumay+np . sqrt (h)*np . random . normal (0 ,1)
i=i+1
i f sumax*sumaax<0 or sumay*sumaay<0:
v . append ( f (sumax , sumay ))
print (sum(v)/ len (v ))
return sum(v)/ len (v)
We compute a two dimensional Brownian motion in a similar way than the one dimensional
case. In every step we compute the two variables x and y as
x(t0) = 0 (5.34)
y(t0) = 0 (5.35)
x(ti+1) = x(ti) +
√
hui,1 (5.36)
y(ti+1) = y(ti) +
√
hui,2 (5.37)
Chapter 6
Stochastic integrals
In this chapter we will try to develop an integral for stochastic processes. In particular, we are
interested in the integral
t
0
f(s)dBs(ω), where (Bt(ω), t ≥ 0) is a given Brownian sample path
and f is a deterministic function or the sample path of a stochastic process. This integrals may
seem a little too abstract, but they are very useful tools to model different situations. As an
example of application, we will see that they are necessary when developing the next chapter:
Stochastic calculus in Finance. Our first approach will be the Riemann-Stieltjes integral, but
as we will soon see this has a limited use, and another approach will be needed.
6.1 Riemann-Stieltjes integral
We will not go into deep detail in this section, as its only purpose is the motivation for our
next section where we will build the Itˆo integral.
From now let’s consider τn a partition τn : {0 = t0 < t1 < . . . < tn = T} over the interval [0, T]
and σn an intermediate partition of τn:
σn : ti−1 ≤ yi ≤ ti for i = 1, . . . , n (6.1)
and let
∆ig = g(ti) − g(ti−1), i = 1, . . . , n (6.2)
Definition 6.1.1. Let f and g two real-valued functions on [0, 1]. The Riemann-Stieltjes sum
corresponding to τn and σn is given by
Sn = Sn(τn, σn) =
n
i=1
f(yi)∆ig =
n
i=1
f(yi)(g(ti) − g(ti−1)) (6.3)
Definition 6.1.2. If the limit
S = lim
n→∞
Sn = lim
n→∞
n
i=1
f(yi)∆ig (6.4)
exists as mesh(πn) = max(|ti − ti−1|, i = 1, . . . , n) → 0 and S is independent of the choice of
the partitions σn, then S is called the Riemann-Stieltjes integral of f with respect to g on [0, 1]
and we write
S =
T
0
f(t)dg(t) (6.5)
So now we can consider the previous integral for stochastic processes. However, the following
theorem shows its limitations.
53
CHAPTER 6. STOCHASTIC INTEGRALS 54
Theorem 6.1.1. Let g(t) be a continuous function on [0, 1] and (πn) a sequence of refining
partitions of [0, 1] such that its norm tends to zero, then the Riemann-Stieltjes integral
T
0
fdg = lim
n
ti,ti+1∈πn
f(yi)(g(ti) − g(ti−1)) (6.6)
exists and is finite for all f ∈ C([0, 1]) ⇐⇒ g has bounded variation.
Corollary 6.1.1. Let B = (Bt, t ≥ 0) be a Brownian motion, then ∃f ∈ C([0, 1]) such that
T
0
f(t)dBt(ω) does not exist in the Riemann-Stieltjes integral.
Proof. We know from proposition 4.5.3 that Brownian motion has unbounded variation. Taking
g = B a Brownian motion from theorem 6.1.1 we get that there exists f such that
T
0
f(t)dB(ω)
is not well defined in the Riemann-Stieltjes sense.
Indeed, one does not need uncommon functions f for the previous integral not to exist. For ex-
ample, take
T
0
Bt(ω)dBt(ω). It can be shown that this integral does not exist in the Riemann-
Stieltjes sense.
Example 6.1.1. The integral
T
0
Bt(ω)dBt(ω) is not well defined in the Riemann-Stieltjes
sense. Let (πn) a sequence of refining partitions such that Qn → T almost surely. We know
such sequence exist from proposition 4.5.2. Assume the integral is well defined, then the limits
lim
n
n
i=1
Bti
(ω)(Bti+1
(ω) − Bti
(ω)), lim
n
n
i=1
Bti+1(ω)(Bti+1
(ω) − Bti
(ω)) (6.7)
exist and they are equal, which means that the difference is equal to 0
lim
n
n
i=1
Bti
(ω)(Bti+1
(ω) − Bti
(ω)) − Bti+1(ω)(Bti+1
(ω) − Bti
(ω)) = 0 (6.8)
but if one rearranges terms the previous sum becomes
0 = lim
n
n
i=1
(∆iB)2
= lim
n
Qn(ω) (6.9)
and using proposition 4.5.2 one obtains
lim
n
Qn → T (6.10)
in contradiction with the fact that Qn(ω) ≡ 0.
6.2 The Itˆo integral for simple processes
The previous section served as motivation to show the limitations of the Riemann-Stieltjes
integral. At first glance it may seem that it is the most natural definition for stochastic integrals,
but we saw that some simple integrals made no sense in the Riemann-Stieltjes sense. For this
reason, we will develop more advanced tools.
CHAPTER 6. STOCHASTIC INTEGRALS 55
Definition 6.2.1. The stochastic process C = (Ct, t ∈ [0, T]) is said to be simple if it satisfies
the following properties:
There exists a partition
τn : 0 = t0 < t1 < · · · < tn−1 < tn = T
and a sequence (Zi, i = 1, . . . , n) of random variables such that
Ct =
Zn, if t = T
Zi, if ti−1 ≤ t < ti, i = 1, . . . , n
The sequence (Zi) is adapted to (Fti−1
, i = 1, . . . , n),i.e., Zi is a ‘function’ of Brownian motion
up to time ti−1, and satisfies E(Z2
i ) < ∞ for all i.
Definition 6.2.2. Let C = (Ct, t ∈ [0, T) be a simple stochastic process on [0, T], τn : 0 = t0 <
t1 < · · · < tn−1 < tn = T a partition and B = (Bt, t ≥ 0) a Brownian motion.
The Itˆo stochastic integral of a simple process on [0, T] is given by:
T
0
CsdBs :=
n
i=1
Cti−1
(Bti
− Bti−1
) =
n
i=1
Zi∆iB (6.11)
The Itˆo stochastic integral of a simple process on [0, t], for tk−1 ≤ t ≤ tk is given by:
t
0
CsdBs :=
T
0
CsI[0,t](s)dBs =
k−1
i=1
Zi∆iB + Zk(Bt − Btk−1) (6.12)
6.3 The general Itˆo integral
From now on, we will assume that the process C = (Ct, t ∈ [0, T]) serves as the integrand of
the Itˆo stochastic integral and that the following conditions are satisfied:
ˆ C is adapted to Brownian motion on [0, T], i.e., Ct only depends on Bs, s ≤ t.
ˆ The integral
T
0
E(C2
s )ds is finite.
Remark 6.3.1. For a process C satisfying the assumptions one can find a sequence (C(n)
) of
simple processes such that
T
0
E(Cs − C(n)
s )2
ds → 0
This means that the processes (C(n)
) converge in a mean square sense to the process C. The
fact of (C(n)
) being a simple process means that we can evaluate all Itˆo stochastic integrals
It(C(n)
). Furthermore, it can be shown that the sequence It(C(n)
) converges in the mean square
sense to an unique limit process, say It(C), i.e.,
E( sup
0≤t≤T
[It(C) − It(C(n)
)]2
) → 0 (6.13)
Definition 6.3.1. The mean square limit It(C) is called the Itˆo stochastic integral of C. It is
denoted by
It(C) =
t
0
CsdBs, t ∈ [0, T] (6.14)
For a simple process C, the Itˆo stochastic integral has the Riemann-Stieltjes sum representation.
CHAPTER 6. STOCHASTIC INTEGRALS 56
6.4 A simple version of the Itˆo formula
Now that we have grasped the notion of the Itˆo stochastic integral for some stochastic processes
we will introduce one of the most important formulas in stochastic calculus: the Itˆo formula.
This formula is the stochastic counterpart of the classical chain rule. It will be of vital impor-
tance when deriving the Black-Scholes formula in the next chapter. Here we will see a simple
formulation. Since we need advanced mathematical tools not covered in this thesis to reach the
this formula, we will get there using heuristic arguments.
Let’s consider a function f ∈ C2
and let dBt = Bt+dt − Bt. We will consider the stochastic
process f(Bt). The Taylor expansion of f(t + dt, Bt+dt) yields
f(Bt + dBt) − f(Bt) = f (Bt)dBt +
1
2
f (Bt)(dBt)2
+ . . . (6.15)
In proposition 4.5.2 we showed that the square of small increments of a Brownian motion dB2
t
can be interpreted as dt. This is a very important difference with the deterministic case, where
the second order of a Taylor expansion is negligible.
If we integrate both sides we get
t
s
df(Bx) : = f(Bt) − f(Bs) (6.16)
=
t
s
f (Bx)dBx +
1
2
t
s
f (Bx)dx (6.17)
The first integral has to be understood as the Itˆo stochastic integral of f (B) defined in the
previous section. The second integral has to be interpreted as the Riemann integral of f (B).
Theorem 6.4.1. Let f ∈ C2
.
f(Bt) − f(Bs) =
t
s
f (Bx)dBx +
1
2
t
s
f (Bx)dx (6.18)
This formula is known as the Itˆo formula.
6.5 Extension I of the Itˆo formula
We now consider a more general case than the simple one, where have f(t, Bt). If f(t, x) has
partial derivatives ot at least second order and expanding in series as above one can reach to
the following formula
Theorem 6.5.1. Let f(t, x) be a function whose second order partial derivatives are continuous.
Then
f(t, Bt) − f(s, Bs) = (6.19)
=
t
s
f1(x, Bx) +
1
2
f22(x, Bx) dx +
t
s
f2(x, Bx)dBx (6.20)
where
fi =
∂
∂xi
f(x1, x2) x1=t,x2=x
, fij =
∂
∂xi
∂
∂xj
f(x1, x2) x1=t,x2=x
(6.21)
for i, j = 1, 2.
CHAPTER 6. STOCHASTIC INTEGRALS 57
Example 6.5.1. Consider a geometric Brownian motion Xt, which is given by
Xt = f(t, Bt) = X0e(c−1
2
σ2)t+σBt
(6.22)
where X0 is a random variable independent of the Brownian motion. If we apply formula (6.20)
we obtain that Xt satisfies
Xt − X0 = c
t
0
Xsds + σ
t
0
XsdBs (6.23)
6.6 Extension II of the Itˆo formula
We now consider a more general case than the I extension, where we have processes f(t, Xt)
and Xt is an Itˆo process. The reason why we are introducing these extensions of the Itˆo formula
is because we will need to use them in the next chapter.
Definition 6.6.1. A stochastic process Xt is called an Itˆo process if there are processes A(1)
and A(2)
adapted to Brownian motion Bt, and a random variable X0 such that Xt can be
written as.
Xt = X0 +
t
0
A(1)
s ds +
t
0
A(2)
s dBs (6.24)
Remark 6.6.1. One can show that the A(1)
and A(2)
are uniquely determined.
Using arguments similar to those used for the simple Itˆo formula one can arrive to the following
more general Itˆo formula:
Theorem 6.6.1. Let Xt be an Itˆo process and f ∈ C1,2
([0, ∞) × R). Then
f(t, XT ) − f(s, Xs) = (6.25)
=
t
a
f1(s, Xs) + A(1)
s f2(s, Xs) +
1
2
(A2
s)2
f22(s, Xs) ds +
t
a
A(2)
s f2(s, Xs)dBs (6.26)
where fi and fij represent the partial derivatives of f.
6.7 Stratonovich integral
It is useful to notice that the Itˆo integral is not the only possible integral for stochastic pro-
cesses, but rather just a member of a big family. The Itˆo integral has some nice mathematical
properties, but the classical chain rule does not apply. Instead, we need to use Itˆo’s formula.
For some applications it comes more handy to have an integral for which classical chain rule
applies, but the price we have to pay is some of the nice properties that the Itˆo integral has.
We start in the case that the integrand process is of the form f(Bt) where (Bt, t ≥ 0) is a
Brownian motion and f is a twice differentiable function on [0, T]. Let
ˆSn =
n
i=1
f(Byi
)∆iB (6.27)
where
∆iB = Bti
− Bti−1
, yi =
ti−1 + ti
2
, i = 1, . . . , n (6.28)
One can show that the Riemann-Stieltjes sums ˆSn exist if mesh(πn) → 0
CHAPTER 6. STOCHASTIC INTEGRALS 58
Definition 6.7.1. The unique mean square limit ST (f(B)) of the Riemann-Stieltjes sums ˆSn
exists if
T
0
E(f2
(Bt))dt < ∞. This limit is called the Stratonovich stochastic integral of f(B).
It is denoted by
ST (f(B)) =
T
0
f(Bs)ds ◦ dBs (6.29)
In the same way as in the Itˆo integral, we can define the stochastic process of the Stratonovich
stochastic integrals
St(f(B)) =
t
0
f(Bs)ds ◦ dBs, t ∈ [0, T] (6.30)
as the mean square limit of the corresponding Riemann-Stieltjes sums.
To get a feeling of the concept of the Stratonovich integral, it can be useful to find a link
between the Itˆo and Stratonovich integrals. We will assume that
T
0
E(f2
(Bt))dt < ∞,
T
0
E(f 2
(Bt))dt < ∞ (6.31)
The first condition is necessary for the definition of the Itˆo and Stratonovich integrals. We first
write the following Taylor expansion of first order
f(Byi
) = f(Bti−1
) + f (Bti−1
)(Byi
− Bti−1
) + . . . (6.32)
Thus an approximating Riemann-Stieltjes ST (f(B)) sum can be written as follows:
n
i=1
f(Byi
)∆iB =
n
i=1
f(Bti−1
)∆iB +
n
i=1
f (Bti−1
)(Byi
− Bti−1
)∆iB
=
n
i=1
f(Bti−1
)∆iB +
n
i=1
f (Bti−1
)(Byi
− Bti−1
)2
+
n
i=1
f (Bti−1
)(Byi
− Bti−1
)(Bti
− Byi
)
= ˆS(1)
n + ˆS(2)
n + ˆS(3)
n
By definition of the Itˆo integral ˆS(1)
n has mean square limit
T
0
f(Bs)dBs. We still have to see
what the values of ˆS(2)
and ˆS(3)
n are.
To keep things neat, we will show their values in the following two lemmas
Lemma 6.7.1. ˆS(3)
n has square limit zero, that is E(| ˆS(3)
n |2
) → 0
Proof. Let’s write E(| ˆS(3)
n |2
)
E(| ˆS(3)
n |2
) =
n
i=1
E[f (Bti−1
)(Byi
− Bti−1
)(Bti
− Byi
)]2
+
+ 2
i<j
E[f (Bti−1
)(Byi
− Bti−1
)f (Btj−1
)(Byj
− Btj−1
)(Bti
− Byi
)(Btj
− Byj
)]
= A1 + A2
Now the trick is to use properties of the conditional expectation to show that the second
summand A2 is 0:
A2 = 2
i<j
E[E[f (Bti−1
)(Byi
− Bti−1
)f (Btj−1
)(Byj
− Btj−1
)(Bti
− Byi
)(Btj
− Byj
)|Ftj−1]]
= 2
i<j
E[f (Bti−1
)(Byi
− Bti−1
)f (Btj−1
)(Byj
− Btj−1
)E[(Bti
− Byi
)(Btj
− Byj
)|Ftj−1]]
CHAPTER 6. STOCHASTIC INTEGRALS 59
and since Bti
− Byi
and Btj
− Byj
are independent of Ftj−1
and independent between them
E[(Bti
− Byi
)(Btj
− Byj
)|Ftj−1] = E[(Bti
− Byi
)]E[(Btj
− Byj
)] = 0 (6.33)
which means that A2 is 0. Now we will see that A1 tends to zero for refining partitions. To
avoid making the proof very technical, we will assume that |f |2
is a bounded by a constant C.
A1 ≤ C
n
i=1
E[(Byi
− Bti−1
)(Bti
− Byi
)]2
= C
n
i=1
E(Byi
− Bti−1
)2
E(Bti
− Byi
)2
= C
n
i=1
(yi − ti−1)(ti − yi)
= C
n
i=1
(ti − ti−1)2
4
≤
C
4
Tmesh(πn) → 0
These computations showed us that
ˆS(3)
n → 0 (6.34)
in the mean square sense.
Lemma 6.7.2.
ˆS(2)
n →
1
2
T
0
f (Bt)dt (6.35)
Proof. We want to see that
E( ˆS(2)
n −
1
2
T
0
f (Bt)dt)2
→ 0 (6.36)
We will now sum and substract the term
1
2
n
i=1
f (Bti−1
)(ti − ti−1).
E ˆS(2)
n −
1
2
n
i=1
f (Bti−1
)(ti − ti−1) +
1
2
n
i=1
f (Bti−1
)(ti − ti−1) −
1
2
T
0
f (Bt)dt
2
≤ 2E ˆS(2)
n −
1
2
n
i=1
f (Bti−1
)(ti − ti−1)
2
+ 2E
1
2
n
i=1
f (Bti−1
)(ti − ti−1) −
1
2
T
0
f (Bt)dt
2
= 2a1 + 2a2
If we assume again that f is bounded, we can use the dominated convergence theorem to
CHAPTER 6. STOCHASTIC INTEGRALS 60
exchange the limits in a2 and show that a2 → 0. Now for a1:
a1 = E
n
i=1
f (Bti−1
)(Byi
− Bti−1
)2
−
1
2
n
i=1
f (Bti−1
)(ti − ti−1)
2
= E
n
i=1
f (Bti−1
)[(Byi
− Bti−1
)2
− (yi − ti−1)]
2
=
n
i=1
E f (Bti−1
)2
[(Byi
− Bti−1
)2
− (yi − ti−1)]2
+
+ 2E
i<j
f (Bti
)f (Btj
)[(Byi+1
− Bti
)2
− (yi+1 − ti)][(Byj+1
− Btj
)2
− (yj+1 − tj)]
where the last summand can be shown to be 0 using conditional expactation with Ftj−1
, then
a1 =
n
i=1
E f (Bti−1
)2
[(Byi
− Bti−1
)2
− (yi − ti−1)]2
≤ C
n
i=1
E[(Byi
− Bti−1
)2
− (yi − ti−1)]2
= C
n
i=1
Var[(Byi
− Bti−1
)2
] → 0
In the previous chapter, in Proposition 4.5.2, we proved that
n
i=1
Var[(Byi
− Bti−1
)2
] tends to 0,
thus a1 → 0 and therefore
ˆS(2)
n →
1
2
T
0
f (Bt)dt (6.37)
Taking all these things into account we reach the following result:
Proposition 6.7.1. Assume the function f satisfies
T
0
E(f2
(Bt))dt < ∞,
T
0
E(f 2
(Bt))dt < ∞ (6.38)
Then the transformation formula holds:
T
0
f(Bt) ◦ dBt =
T
0
f(Bt)dBt +
1
2
T
0
f (Bt)dt (6.39)
6.8 Stratonovich or Itˆo?
There has been much debate on whether one should use Itˆo or Stratonovich integral. There is
no ‘right’ choice, both integrals are mathematically correct and the decission on which one to
use depends on the application. In this section we will see the most important property of each
stochastic integral.
Definition 6.8.1. A stochastic process (Xt, t ≥ 0) is called a continuous-time martingale with
respect to the filtration (Ft, t ≥ 0), we write (X, (Ft)), if
CHAPTER 6. STOCHASTIC INTEGRALS 61
ˆ E(|Xt|) < ∞ for all t ≥ 0
ˆ X is adapted to (Ft)
ˆ E(Xt|Fs) = Xs for all 0 ≤ s < t
that is, Xs is the best prediction of Xt given Fs
Recall that we say that a process Yt is adapted to a filtration Ft if σ(Yt) ⊂ Ft for all t ≥ 0, i.e.,
if the random variable Yt does not contain more ‘information’ than Ft.
It can be shown that the Brownian motion is a martingale with respect its natural filtration.
That means that the best prediction of the value of the Brownian motion at a future point is
the value at the present point.
The Itˆo stochastich integral also has this important property.
Property 6.8.1. The Itˆo stochastic integral It(C) =
s
0
CsdBs, t ∈ [0, T], is a martingale with
respect to the natural Brownian filtration (Ft, t ∈ [0, T]).
This is important because there are many propositions and theorems that apply to martingales,
so one can apply many of these tools to the Itˆo integral. In general, in mathematics it is prefered
to use the Itˆo stochastic integral because of this nice structure.
Now if we take f(t) = g (t) a combination of the Itˆo lemma and the transformation formula
(6.39) yields:
g(BT ) − g(B0) =
T
0
g (Bs)dBs +
1
2
T
0
g (Bs)ds
=
T
0
f(Bs)dBs +
1
2
T
0
f (Bs)ds
=
T
0
g (Bs) ◦ dBs
This shows that the Stratonovich integral satisfies the classical chain rule of classical calculus.
This means that for certain computations the Stratonovich stochastic integral is more handy
than the Itˆo stochastic integral. That is the reason why for certain models this integral is
prefered, specially in Physics.
After all, which stochastic integral to use depends on the system we want to model as we
have seen that both integrals make mathematical sense. So the basic problem is not what is
the right integral definition, but how do we model real systems by diffusion processes. There
are two rough guidelines to choose the best diffusion model for a real system. If the starting
point is a phenomenological equation in which some fluctuating parameters are approximated
by Gaussian white noise, then the most accurate interpretation is that of Stratonovich. If it
however represents the continuous time limit of a discrete time problem, it is better to use the
Itˆo interpretation. Ito’s integral is a martingale which is very convenient since martingales have
a nice mathematical structure, and there are lots of martingale tools. As for Stratonovich’s
integral, it satisfies the same chain rule as in classical calculus, so it might appear more natural,
but it is harder to work with due to the lack of martingale structure.
Chapter 7
Stochastic calculus in Finance
In 1973 Black, Scholes and Merton published papers in which they gave a solution to the
problem of pricing complex financial derivatives and risky assets such as share price of stocks
or options, using stochastic calculus. Since then these methods have been widely accepted
and led to a new branch of applied probability theory, the field of economic finance. In this
chapter we will see some of these results, which are derived from concepts of some previous
chapters discussed in this thesis, specially that of Brownian motion and Stochastic integrals.
For example we discussed that Brownian motion, as a physical concept, describes the random
movement of particles in a solvent. This model assumes that the price of risky assets depends
in part on random fluctuations, very similar to the behaviour of the random movement of a
Brownian particle.
Before we get started, we will need some basic definitions.
Definition 7.0.1. A European call option is a contract that gives the holder the right, but
not the obligation, to buy an asset at a specified time T (called maturity date), for a specified
price K (called strike price).
A European put option is a contract that gives the holder the right, but not the obligation, to
sell an asset at a specified time T (called maturity date), for a specified price K (called strike
price).
The assets can be of very different types: stocks, commodities, foreign exchange and so on.
While options can be used in very complex ways in trading strategies, one can think of options
as an insurance policy. For example, we can think of a baker who knows how much wheat he is
going to need for his business in twelve moths. However, he is scared that because of forecasted
bad weather wheat price will be scarce and thus peak in price. He thinks that wheat price now
at t = 0 is fair, so he decides to buy a European call option with a strike price K and maturity
date T = 12 (time is in months). In that way he knows how much he will be paying for wheat
in twelve months and can make better plans. Of course, it can be the case that wheat price
actually goes below K and, in that case, he will not exercise the option but rather buy the
wheat in the commodity market. Suppose that the price of wheat ST is greater than the strike
price K, then the payoff will be ST −K. However, if ST < K then the payoff will be 0, meaning
that the contract will expire useless because the baker will buy the commodity directly from
the market at a cheaper price.
One can think also of a farmer who grows wheat and is worried that wheat prices will decline
sharply. Then he could fix the price with a European put option.
In general, there are four possible cases:
ˆ Buy a call option, known as long call.
62
CHAPTER 7. STOCHASTIC CALCULUS IN FINANCE 63
This is the case we explained with the baker, where the long call served as a means of
insurance. In the graph the x-axis represent the underlying asset price at maturity and
the y-axis the profit. The graph shows two lines: one for profit and one for payoff. The
profit represents the net profit one could obtain if one exercises the option (that is, one
buys the asset at the strike price) and immediately sells the asset at a market price.
Because we are buying a call option that is giving us a right to buy, we will need to
pay a premium. Then it is for sure that at the time we buy the option we will have a
loss of the price of the premium. Then as time goes on if the price falls well below the
strike price, we are covered by the call option so we would not be losing more money
than the premium price. It is worth observing that even though the price of the asset
at maturity is greater than the strike price, there is an interval in which we would have
negative profits. That is because the premium was too high or the price movement of
the asset was not large enough. For example assume that the stock of General Motors is
worth today 30e. If I buy a call option for a stock of GM for a price of 2e with strike
price of 30e, then it could happen that at maturity the stock is worth 31e. There has
been an upward movement on the price of the stock of 1e (31 − 30), and therefore the
payoff would be of 1e, but nevertheless the profit would be negative, −1e (31 − 30 − 2),
because we have to take into account the premium price. If the price of the stock goes
higher than 32e, we would start getting positive profits. One important thing to notice
is that there can be in worst case scenario bounded losses (premium price) and in best
case scenario unbounded profits.
ˆ Sell a call option, known as short call.
In the case of a short call we are betting for a downturn in the underlying asset. If the
long call can be understood as buying an insurance, the short call can be understood
as selling that insurance to someone else. As before, the profit represents the net profit
you could obtain if the purchaser of your option exercises it (that is, the purchaser of
your option decides to buy you the asset at the strike price) and immediately you buy
the same asset at the market price. You sell the call option at time 0 for an instant net
profit. However, now you have the obligation of selling the asset if the buyer exercises
CHAPTER 7. STOCHASTIC CALCULUS IN FINANCE 64
the option. If things go as expected, that is, the price of the asset decreases, then you
earn the profits of the premium. If the price increases more than the strike price, but not
too much, you could still earn a quantity between 0 and the premium. If however the
price increases well beyond the strike price, you would lose the premium you obtained at
time 0 plus a quantity proportional to the increase on the price of the asset. Selling call
options is risky, as losses are unbounded (the price of the asset can theoretically grow
without bounds) and possible profits are bounded by the premium.
ˆ Buy a put option, known as long put. Recall that put options gives the holder the right
to sell at a fixed strike price. As it was the case with selling call options, when you buy
a long put you are expecting a downturn for the underlying asset. In these case one can
obtain maximum profits when the stock price goes to 0, but will have negative profits if
the price doesn’t move a lot or increases. Both profits and losses are bounded, being the
maximum loss the premium.
ˆ Sell a put option, known as short put. Similar to the long call, we will make money here
if the price of the underlying asset increases. At time 0 we will receive the premium of
selling the option, but we have the obligation to buy the asset at the strike price if the
holder exercises the option. In this case, if the price of the underlying asset drops a lot
we will have the obligation to buy the asset at a much higher price, thus incurring losses.
Here also profits are bounded (by the premium) and losses are bounded (by the strike
price minus the premium).
What kind of option is best for a given case?
We have seen that there are four general cases for buying and selling options. The first big
difference between buying or selling options is that when you buy options (call or put) you are
paying a premium for reducing and limiting posible losses. It is similar to paying an insurance,
you pay a small fee but you can be sure that you will not lose more money than the premium
of the options if the stocks decline sharply. So for a stock holder this derivatives can be quite
useful. When you are selling (call or put) options you are selling the right to somebody else,
CHAPTER 7. STOCHASTIC CALCULUS IN FINANCE 65
and they can exercise that right whenever they want. That makes selling options a much riskier
choice.
There are some strategies that might look similar, but they are not at all. For example if we
think the price of an asset is going to increase, we could decide to buy a call option or to sell a
put option. In both cases we would make money if the price goes up and lose if it goes down.
However, the biggest difference lies in the level of risk we want to assume. We said that buying
options limited the losses, so it is always safer. In this case, buying a call option would be
the save move. However, to earn money the price of the asset has to increase more than the
premium to start getting profits. Selling a put option, on the other hand, gives you a profit of
the premium at time 0, and no matter how little the price increases we will get a profit. The
price in this case could indeed go down and still get profit. However, if the price decreases a
lot there are not lower bounds to cover us and we can lose a lot of money. So we see that a
person who thinks that the price of an asset is going to increase could both buy call options or
sell put options, the main difference being the level of risk they want to take.
Definition 7.0.2. The payoff of an European call option with maturity T and strike price K
is
(ST − K)+
= max{ST − K, 0} (7.1)
The payoff of an European put option with maturity T and strike price K is
(K − ST )+
= max{K − ST , 0} (7.2)
The natural question arises: how much should the baker pay to buy this contract?. What is the
fair price of a European option? This is known as the option pricing problem and Black-Scholes
aim to solve it.
7.1 Black-Scholes simple model for option pricing
In this model we will make some ideal assumptions that do not hold exactly in real world, but
serve as approximations. Our model will have two components:
1. A risky asset (called stock). We will start assuming that the price of a stock is given by
a geometric Brownian motion St,
St = f(t, Bt) = S0e(µ−0.5σ2)t+σBt
(7.3)
where Bt is a Brownian motion and S0 is assumed to be independent of Bt. A naive
justification of such choice comes as follows. We showed that the geometric Brownian
motion (7.3) is solution of the equation
St − S0 = µ
t
0
Ssds + σ
t
0
SsdBs (7.4)
which can be written as
dSt = cStdt + σStdBt (7.5)
and can be interpreted as
St+dt − St = cStdt + σStdBt (7.6)
or equivalently,
St+dt − St
St
= µdt + σdBt (7.7)
CHAPTER 7. STOCHASTIC CALCULUS IN FINANCE 66
Let’s try to interpret equation (7.7). This tells us that the relative return of a stock is
determined firstly by a linear deterministic term µdt and perturbed by an undeterministic
term σdBt. The constant µ is called the mean rate of return and σ the volatility. The
volatility is a measure of how risky an asset is. The more volatility, the more unexpected
fluctuations we would expect to see in the price of an asset. If σ were 0, then the price of
the stock would be deterministic.
2. A non-risky asset (called bond), whose returns are deterministic and are determined by
compounded interests. For example, a bank account. The price of such asset over time
can be modelled as
βt = β0ert
(7.8)
where r is called the risk free rate. This is also an idealization, since interest rates do not
usually stay constant in time.
Definition 7.1.1. A trading strategy is a portfolio whose value is given by
Vt = atSt + btβt (7.9)
where at and bt are stochastic processes adapted to Brownian motion.
A trading strategy is, widely speaking, a choice of how many shares will one hold of risky and
non-risky assets. Notice that at and bt can be negative values also. If at is negative we say that
we are short-selling an asset, which means that we sell an asset that we do not have with the
promise that we will buy it at later time, expecting that the price of the asset drops. If bt is
negative we are borrowing money.
We assume that our trading strategy is self-financing. This means that we do not take money
in or out from our portfolio, so that the increments in the wealth will come only from the
change in prices in the assets St and βt that we hold. Mathematically speaking this means that
dVt = d(atSt + btβt) = atdSt + btdβt (7.10)
or
Vt − V0 =
t
0
asdSs +
t
0
bsdβs (7.11)
Coming back to our initial problem, we will try to give a fair price to a European option. First,
a definition:
Definition 7.1.2. We say there is an arbitrage oportunity if there exists a riskless strategy of
buying and selling assets where one can obtain profits at t = 0
Notice that if an individual could find an arbitrage oportunity in markets, one could obtain
potentially unbounded profits. There exists an hypotehsis stating that markets are arbitrage-
free or, in other words, nobody is giving money for free. Of course it can be the case that there
are some punctual arbitrage oportunities in the market, but they often disappear very fast as
eager investors notice them and after selling and buying enough assets an equilibrium situation
where no arbitrage exists is reached1
.
Black, Scholes and Merton defined such value as follows
ˆ An individual can invest the price of an option and manage his portfolio according to a
self-financing strategy so as to yield the same payoff (St − K)+
as if the option had be
purchased.
ˆ If the price of the option were any different from this rational value there would be an
aribrtrage situation.
1
However, new research suggests that there exists a ‘memory’ and some long-range correlations in the financial
markets, which may cause arbitrage situations. See [6]
CHAPTER 7. STOCHASTIC CALCULUS IN FINANCE 67
7.1.1 A mathematical formulation for the option pricing problem
Now that the background of the problem has been explained, we will get into more mathematical
development. The general scheme will be as follows: first we will assume that our value process
Vt is a smooth function u(t, x). We will apply the Itˆo formula to our value process Vt (which
is an Itˆo process) and then we will use the fact that we are using a self-financing strategy
(at, bt). We will get two integral identities for Vt − V0. In previous chapters we stated that the
coefficients of an Itˆo process are unique, so they must coincide. From this property one can get
to a partial differential equation for u(t, x) which, surprisingly, can be explicitly solved. This
function u(t, x) will give us the fair value of an option.
Let’s suppose we want to find a self-financing strategy (at, bt) and a value process Vt such that
Vt = atSt + btβt = u(T − t, St), t ∈ [0, T] (7.12)
for some smooth deterministic function u(t, x). This is again another assumption, since we
assume that the value of our portfolio depends in a smooth way on t and St. We have the
following terminal condition
VT = u(0, ST ) = (ST − K)+
(7.13)
and this condition is necessary for arbitrage not to exist in our economy. For example, if VT =
u(0, ST ) < (ST −K)+
one could sell the portfolio for a value V0 and buy the option for a value V0
whose payoff is (ST −K)+
. The net profit would be in this case +V0 −V0 +(ST −K)+
−VT > 0.
The reverse strategy would be valid if VT = u(0, ST ) > (ST − K)+
.
Recall that St is a geometric Brownian motion, which in particular means that it satisfies the
following equation
Xt = X0 + µ
t
0
Xsds + σ
t
0
XsdBs (7.14)
so St is an Itˆo process with A(1)
= µX and A(2)
= σX. So we can apply the Itˆo formula from
theorem 6.6.1 to the process Vt = u(T − t, St). If we write f(t, x) = u(T − t, x) the partial
derivatives are
f1(t, x) = −u1(T − t, x), f2(t, x) = u2(T − t, x), f22(t, x) = u22(T − t, x) (7.15)
and the Itˆo formula yields
Vt − V0 =
t
0
[−u1(T − s, Ss) + µSsu2(T − s, Xs) +
1
2
σ2
S2
s u22(T − s, Xs)]ds (7.16)
+
t
0
[σSsu2(T − s, Xs)]dBs (7.17)
On the other hand, (at, bt) is self financing so
Vt − V0 =
t
0
asdSs +
s
0
bsdβs (7.18)
In order to be able to compare equations (7.17) and (7.18) we must first write (7.18) in the
same differentials as (7.17). Recall that
βt = β0ert
(7.19)
and thus
dβt = β0rert
dt = rβtdt (7.20)
CHAPTER 7. STOCHASTIC CALCULUS IN FINANCE 68
Moreover Vt = atSt + btβt so
bt =
Vt − atSt
βt
(7.21)
and combining this
bsdβs =
Vs − asSs
βs
rβsds (7.22)
We can also write dSs in terms of ds and dBs:
dSs = µSsds + σSsdBs (7.23)
Combining all this we can rewrite 7.18 as
Vt − V0 =
t
0
as(µSsds + σSsdBs) +
t
0
Vs − asSs
βs
rβsds (7.24)
=
t
0
[(µ − r)asSs + rVs]ds +
t
0
σasSsdBs (7.25)
Now we can compare identities 7.17 and 7.25. Because Vt is an Itˆo process its coefficients are
uniquely determined and thus
at = u2(T − t, St)
(µ − r)atSt + ru(T − t, St) = (µ − r)u2(T − t, St)St + ru(T − t, St)
= −u1(T − s, Ss) + µSsu2(T − s, Xs) +
1
2
σ2
S2
s u22(T − s, Xs)
and finally we can write from this last identity the following PDE
u1(t, x) =
1
2
σ2
x2
u22(t, x) + rxu2(t, x) − ru(t, x) (7.26)
for x > 0 and t ∈ [0, T] with the deterministic terminal condition u(0, x) = (x − K)+
. The
solution can be found explicitly. A full derivation can be found in section 14.5 in the book of
Rosario N. Mantegna [6].
Theorem 7.1.1 (Black-Scholes formula). The solution of the PDE 7.26 is
u(t, x) = xΦ(g(t, x)) − Ke−rt
Φ(h(t, x)) (7.27)
where
g(t, x) =
ln(x/K) + (r + 0.5σ2
)t
σt1/2
,
h(t, x) = g(t, x) − σt1/2
and
Φ(x) =
1
(2π)1/2
x
−∞
e−y2/2
dy, x ∈ R (7.28)
is the standard normal distribution.
Hence the rational price at time t = 0 for a European call option with strike price K is given
by
V0 = u(T, S0) = S0Φ(g(T, S0)) − KerT
Φ(h(T, S0)) (7.29)
Equation (7.29) is the celebrated Black-Scholes option pricing formula.
CHAPTER 7. STOCHASTIC CALCULUS IN FINANCE 69
Remark 7.1.1. The stochastic process Vt = u(T − t, St) is the value of the self-financing
portfolio at time t ∈ [0, T] and the self-financing strategy (at, bt) is given by
at = u2(T − t, St), bt =
u(T − t, St) − atSt
βt
(7.30)
Formula 7.29 is the most used formula for pricing options in finance. Part of its success comes
from the fact that it admits an explicit solution, which is quite rare when solving PDEs. Let’s
give an example of why is this formula so important.
Imagine that the price of the option at time t = 0 is p, with p = V0. Suppose that p > V0, then
one could do the following strategy:
ˆ Sell the option to someone else for a price of p. You gain p at t = 0
ˆ Invest V0 to buy a0 in stock and b0 in bonds, where a0 and b0 are given by (7.30). You
pay V0 at t = 0.
Following this strategy it is immediate to see that you obtain a net profit of p−V0 at t = 0. But
what’s interesting is that this profit remains unchanged at at maturity date T, no matter how
the stocks will move. Indeed, at T the value of our portfolio will be VT = u(0, ST ) = (ST −K)+
and we will have the obligation to pay (ST − K)+
to the buyer of our option. That means that
at T we will have had a cash flow equal to p − V0 + (ST − K)+
− (ST − K)+
for a net profit
of p − V0 > 0. We could increase the scale arbitrarily, selling n options for np and investing
nV0 in stocks and bonds for a net profit of n(p − V0), so we could obtain instantaneous and
unbounded profits.
Remark 7.1.2. Throughout the derivation we have implicitly or explicitly used a set of as-
sumptions. Let’s list them all here:
i) The stock price is an Itˆo process
ii) Security trading is continuous
iii) There are no arbitrage oportunities
iv) Selling of securities is possible at any time
v) There are no transaction costs
vi) The market interest rate r is constant
vii) There are no dividends between t = 0 and t = T
Provided that these assumptions hold, Black-Scholes formula gives the fair price of an option,
meaning that if an option is valued at a different price there exists an arbitrage opportunity.
7.1.2 Graphical representations of the Black-Scholes formula
We will see now some graphical representation for the price of an option. The following plots
have been obtained from the website [13]
CHAPTER 7. STOCHASTIC CALCULUS IN FINANCE 70
Figure 7.1: Option price vs stock price. E is the strike price, r the risk free rate, σ the volatilty
and T − t the maturity date
The first thing we observe in this graph is that it is an increasing function. That makes perfect
sense, the more expensive is the asset the greater can be the downturns and thus the more one
should pay to cover those losses. We observe that the value of the option is almost identically
0 for values smaller than 15. The reason for this is that the maturity date and volatility are
small (and thus we don’t expect a huge drop in price in a short time interval). We see that if
the stock price is worth 30 and the strike price is 30, the rational price to buy a call option is
around 5. If we accept such deal, we would want that the stock price goes above 35 in the next
1 unit time, what would bring us profits.
We see now what happens in the limits as T − t → ∞ or σ → ∞. We represent now the graph
T − t → ∞ but the same plot is obtained when σ → ∞.
Figure 7.2: Option price vs stock price. E is the strike price, r the risk free rate, σ the volatilty
and T − t the maturity date
We observe that the graph has become a line. Indeed, it is the identity function and it doesn’t
CHAPTER 7. STOCHASTIC CALCULUS IN FINANCE 71
seem that the strike price affects the values. The fact that it is the identity function means
that it is the same to buy the call option than to buy the stock itself, buying options is no
longer of any use. If we think about it, it makes sense. As maturity date goes to infinity, there
is plenty time and ‘anything’ could happen. Because the stock follows a random movement,
there is no likely prediction on what the value of the price might be, and that huge uncertainty
is reflected in the price of the option. The same argument is valid if the volatility is infinite, in
this scenario movements in price will be so sharp that they could take virtually any (positive)
value even in a short period of time.
Appendices
72
Appendix A
Fokker-Planck equation
The Fokker–Planck equation is a partial differential equation that describes the time evolution
of the probability density function of the velocity of a particle under the influence of drag forces
and random forces. Let’s start with the evolution equation for a stochastic process x(t)
dx
dt
= q(x, t) + g(x, t)ξ(t) (A.1)
where q(x, t), g(x, t) are some deterministic functions and ξ(t) is white noise. So the process
has some deterministic function and has a random fluctuating component, described by g(x, t).
Because of this random component, one cannnot reach a deterministic solution. However, one
can instead define a function P(x, t) which gives us the probability that the solution x(t) of the
SDE at time t has the value x, averaged over all the possible realizations of the noise. One can
arrive to the formula
∂P(x, t)
∂t
= −
∂
∂x
[q(x, t)P(x, t)] +
D
2
∂
∂x
g(x(t), t)[g(x(t), t)P(x, t)] (A.2)
For a Brownian motion one has q(x, t) = 0 and g(x, t) =
√
2D, so the Fokker-Planck equation
reads
∂P
∂t
= D
∂2
P
∂x2
(A.3)
which is the diffusion equation.
73
Appendix B
Results and definitions in Probability
Theorem B.0.1 (Chebyshev inequality).
P(|X − EX|) ≥ ε) ≤
V (X)
ε2
(B.1)
B.1 Conditional expectation
Definition B.1.1. Let (Ω, F, P) be a probability space and G ⊂ F a σ-algebra. Let X be a
random variable with E(|X|) < ∞. We say that the random variable E(X|G) is the conditional
expectation of X given G if E(X|G) is G-measurable and
A
E(X|G)dP =
A
XdP ∀A ∈ G (B.2)
If X is a random variable F−measurable and G ⊂ F, then E[X|G] is a G−measurable ran-
dom variable and it is the best estimation of X that is G−measurable. The existance of the
conditional expectation can be shown using the Theorem of Radon-Nikodym. There are some
properties that we will use:
Property B.1.1. By definition, E(X) = E(E(X|G)) for G a σ−algebra
Property B.1.2. If X is F−measurable, E(XY ) < ∞ and E(Y ) < ∞ then
E(XY |G) = XE(Y |G) (B.3)
Property B.1.3. If X is independent of G and E(X) < ∞, then
E(X|G) = E(X) (B.4)
74
Bibliography
[1] Bardina, Xavier. Caminant a l’atzar tots els camins porten a Roma. Revista Electr`onica
de Divulgaci´o Matem`atica Editada por el Departament de Matem`atiques de la Universitat
Aut`onoma de Barcelona, 2008.
[2] Billingsley, Patrick. Convergence of Probability Measures. New York: Wiley, 1999.
[3] G´ora, Pawel F. The theory of Brownian Motion: A Hundred’s Year Anniversary. Marian
Smoluchowski Institute of Physics. Jagellonian University, Cracow, Poland.
[4] Ioannis Karatzas. Brownian Motion and Stochastic Calculus. New York: Springer, cop. 1991
[5] Jolis, Maria. Apuntes de Probabilidad. Universitat Aut`onoma de Barcelona.
[6] Mantegna, Rosario N. and Stanley, H. Eugene. An introduction to Econophysics. Correla-
tions and Complexity in Finance. Cambridge University Press.
[7] M´endez, Vicen¸c; Campos, Daniel and Bartumeus Frederic. Stochastic Foundations in Move-
ment Ecology. Springer.
[8] Mikosch, Thomas. Elementary Stochastic Calculus with Finance in view. World scientific.
[9] M¨orters, Peter and Peres, Yuval. Brownian motion. Cambridge University Press.
[10] Samaniego Vidal, Daniel. Moviment Browni`a. Project from the course ‘Tend`encies Actuals
de les Matm`atiques’.
[11] S. Lemons, Don. An Introduction to Stochastic Processes in Physics. The Johns Hopkins
University Press Baltimore and London.
[12] Toral, Ra´ul and Colet, Pere. Stochastic Numerical Methods: An Introduction for Students
and Scientists. Wiley-VCH.
[13] http://socr.ucla.edu/htmls/HTML5/econ apps/BlackScholesPlot/BlackScholesPlot.html
[14] https://en.wikipedia.org/wiki/Put option
[15] https://en.wikipedia.org/wiki/Call option
[16] http://introcs.cs.princeton.edu/java/15inout/RandomWalk.java.html
75

tfg

  • 1.
    Universitat Aut`onoma deBarcelona Brownian Motion and Introduction to Stochastic Calculus Author: David Nebra Colmenares Supervisors: Maria Jolis Gim´enez Daniel Campos Moreno July 7, 2016
  • 3.
    Contents 1 Introduction 1 2Random Walk 5 2.1 One-dimensional random walk . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.1.1 Back to original position . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.1.2 Get to a specific position . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.1.3 Expected time to get back to origin . . . . . . . . . . . . . . . . . . . . . 8 2.2 Two-dimensional random walk . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.3 Back to the original position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.4 Get to a specific position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.5 Three-dimensional random walk . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.6 Back to the origin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.7 Get to a specific position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3 Simulations: Random walks 16 3.1 One-dimensional random walk . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 3.1.1 Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3.2 Two-dimensional random walk . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 3.2.1 Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 3.2.2 Path samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 3.2.3 Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 3.3 Three-dimensional random walk . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 3.3.1 Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 4 Brownian motion 29 4.1 History of Brownian motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 4.2 The Difussion Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 4.2.1 Einstein’s derivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 4.2.2 Langevin’s approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 4.2.3 Macroscopic Derivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 4.2.4 Solution of the diffusion equation . . . . . . . . . . . . . . . . . . . . . . 34 4.3 Recurrence of Brownian motion . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 4.4 Expected time to reach a specific position . . . . . . . . . . . . . . . . . . . . . 40 4.5 Other properties of Brownian motion . . . . . . . . . . . . . . . . . . . . . . . . 42 4.5.1 Quadratic variation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 4.5.2 Unbounded variation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 5 Simulations: Brownian Motion 45 5.1 Numerical integration of stochastic differential equations with Gaussian white noise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 5.1.1 Runge-Kutta-Type methods . . . . . . . . . . . . . . . . . . . . . . . . . 47 2
  • 4.
    CONTENTS 3 5.1.2 Simulations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 5.1.3 Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 5.1.4 Path samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 5.2 Dirichlet problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 5.2.1 Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 6 Stochastic integrals 53 6.1 Riemann-Stieltjes integral . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 6.2 The Itˆo integral for simple processes . . . . . . . . . . . . . . . . . . . . . . . . 54 6.3 The general Itˆo integral . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 6.4 A simple version of the Itˆo formula . . . . . . . . . . . . . . . . . . . . . . . . . 56 6.5 Extension I of the Itˆo formula . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 6.6 Extension II of the Itˆo formula . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 6.7 Stratonovich integral . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 6.8 Stratonovich or Itˆo? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 7 Stochastic calculus in Finance 62 7.1 Black-Scholes simple model for option pricing . . . . . . . . . . . . . . . . . . . 65 7.1.1 A mathematical formulation for the option pricing problem . . . . . . . . 67 7.1.2 Graphical representations of the Black-Scholes formula . . . . . . . . . . 69 Appendices 72 A Fokker-Planck equation 73 B Results and definitions in Probability 74 B.1 Conditional expectation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
  • 5.
    Abstract This bachelor thesisaims to introduce the concepts of random walks, Wiener process and Stochastic Calculus and to illustrate some of its applications. Before going into details, we will explain the random walk and the Wiener process, and see how the latter can be understood as a limit of the former. In Chapter 2 we will deal with 1, 2 and 3-dimensional random walks and we will focus on the probability that the random walker will get back to its departing point (recurrence problem). We will then simulate some cases to see that experimental results match theoretical ones, and simulate some cases for the 2 and 3-dimensional case for which we don’t have theoretical results. The next part will be an introduction to Brownian motion, its importance in Physics and how it can be modelled via a Wiener process. As we did with the random walk we will see that, among other properties, the 1-dimensional Brownian motion is recurrent and, finally, we will run several simulations. Chapter 6 is an introduction to Stochastic Calculus that will provide us with useful results which will be used later in Chapter 7. This last chapter will introduce us some financial concepts and one of the most important formulas in modern Quantitative Finance: Black-Scholes formula for option pricing.
  • 6.
    Chapter 1 Introduction In thischapter we want to explain the similarities between the Brownian motion and the random walk, and see that the former can be undersood as a limit of the latter. The next chapters will focus more in detail on the properties of each one, here we just want to see the link existing between them. Definition 1.0.1. Given a probability space (Ω, F, P) and a measurable space (S, Σ) a stochas- tic process X is a collection of random variables on Ω, indexed by a totally ordered set T, i.e, X = {Xt : t ∈ T} (1.1) where each Xt is a random variable on Ω with values in S, that is X−1 t (E) ∈ F ∀E ∈ Σ ∀t ∈ R (1.2) Definition 1.0.2. A 1-dimensional Wiener process or Browian motion B = (Bt, t ∈ [0, ∞)) is a stochastic process characterized by the following properties 1. B0 = 0 a.s. 2. B has independent increments. 3. B has Gaussian increments: Bt+u − Bt ∼ N(0, u). 4. B has continuous paths: Bt(ω) is a.s. continuous in t. Definition 1.0.3. A n-dimensional Wiener process or Browian motion is a vector-valued stochastic process Bt = (B (1) t , B (2) t , . . . , B (n) t ) (1.3) whose components B (i) t are independent, one dimensional Wiener-processes. Remark 1.0.1. Throughout most of this thesis we will use the terms Wiener process and Brownian indistinctly. In Physics literature Brownian motion is often understood as the ran- dom movement that a particle does, and the Wiener process is one of the many possible inter- pretations of this movement. In this way, many physicists understand Brownian motion as a physical concept that has to do with the movement itself, while here we will understand it as a mathematical object. In some chapters however when we talk about Brownian motion we will refer to the physical concept. In any case, it should be clear to what we refer depending on the context. Definition 1.0.4. Let Xn be independent random variables that can only take values 1 or −1 with equal probability, i.e., P(Xn = 1) = 1/2 and P(Xn = −1) = 1/2. A one-dimensional random walk with n steps is the sum of n of such variables Sn = X1 + X2 + . . . + Xn 1
  • 7.
    CHAPTER 1. INTRODUCTION2 There are many properties in common between the random walk and the Brownian motion. In fact, the Brownian motion can be understood as a limit of a random walk, and that’s what we will show here. First we need to make some definitions. There are many types of convergence for random variables, we will need now the convergence in distribution. Definition 1.0.5. Let X, X1, X2, . . . be random variables (which don’t need to be defined on the same probability space). Let Fn, F be the distribution functions of Xn and X respectively. We say Xn converges in distribution to X if for every t where F is continuous we have: lim n Fn(t) = F(t) (1.4) and we write Xn d → X This is the weakest type of convergence for random variables. Indeed it can be shown that Xn a.s −→ X =⇒ Xn P −→ X =⇒ Xn d −→ X (1.5) Convergence in distribution does not have good properties, for example it is not true that the limit of the sum is the sum of the limits. However, when one of the sequences converges to a constant, then we have the results we would expect. Theorem 1.0.1 (Slutsky’s theorem). Assume that Xn d → X and Yn d → c, where c is a constant. Assume also that every n, Xn and Yn are defined on the same probability space. Then 1. Xn + Yn d → X + c 2. Xn · Yn d → cX 3. Xn Yn d → X c , if c = 0 Finally we will need the Central Limit Theorem, which is the most important Theorem in Probability Theory. It basically states that we can approximate the sum of a large number of random variables to the normal distribution. This has a huge number of applications in many fields. Theorem 1.0.2 (Central Limit Theorem, L´evy-Lindeberg version). Let X1, X2, . . . be iden- pendent and identically distributed (i.i.d) random variables with finite second order moment. Write E(Xn) = µ and Var(Xn) = σ2 , and let ¯Xn = 1 n n i=1 Xi (1.6) and Z ∼ N(0, 1). Then ¯Xn − µ σ√ n d −→ Z (1.7) Now that we have these tools, we will proceed to show the relationship between random walk and Brownian motion. Let ξ1, ξ2, . . . be a sequence of random variables with ξi = ±1 with probability 1/2. Let Sn = ξ1 + . . . + ξn (S0 = 0), and let Xn t (ω) be Xn t (ω) = 1 √ n S nt (ω) + (nt − nt ) 1 √ n ξ nt +1(ω) ψn,t (1.8)
  • 8.
    CHAPTER 1. INTRODUCTION3 where x is the floor function, that is, it takes the largest integer that is smaller or equal than x. Notice that a random walk is defined for discrete values. The previous definition admits any value t ≥ 0. Because we have S nt instead of S t for big enough n the term 1 √ n S nt will change quickly as t grows. In a way we have made a ‘continuous’ random walk. Theorem 1.0.3. With {Xn } defined by (1.8), we have that for any t > 0 Xn t d −→ Bt as n → ∞ (1.9) where {Bt, t ≥ 0} is a Brownian motion. Proof. First we see that ψn,t P −→ 0 as n → ∞. We have that |ψn,t| = Xn t − 1 √ n S nt ≤ 1 √ n |ξ nt +1| (1.10) and by Chebyshev inequality P (|ψn,t| > ε) ≤ P 1 √ n |ξ nt +1| > ε ≤ E 1√ n ξ nt +1 2 ε2 = 1 ε2n → 0 (1.11) Because ψn,t P −→ 0 this also means that ψn,t d −→ 0 se we can use Slutsky’s theorem (1.0.1) and we obtain Xn t has the same limit as 1 √ n S nt . By the Central Limit Theorem and because nt /n → t 1 nt S nt d −→ N, N ∼ N(0, 1) (1.12) If we consider Yn = nt √ n , then Y d −→ √ t = c and we can use Slutzky’s theorem to 1 nt S nt · Yn: 1 √ n S nt = 1 √ n nt nt S nt = 1 nt S nt · Yn d −→ √ tN (1.13) and because Xn t has the same limit as 1 √ n S nt we have that Xn t d −→ √ tN d = Bt (1.14) This result gives us a feeling on the concept of Brownian motion, as we can understand it as a limit of a random walk. We have assumed that the random variables ξi can only take discrete values 1 and −1. There is a stronger result, in which we don’t need to assume that the random variables take only these two discrete values. It is called Donsker’s invariance Theorem and it is a generalization of what we have just seen. If we take i.i.d random variables ξi Theorem (1.0.3) still holds true. We won’t show this result here, but more details can be found in the book of Billinsgley [2]. The following Proposition can translate some properties we see in random walks to properties in Brownian motion.
  • 9.
    CHAPTER 1. INTRODUCTION4 Proposition 1.0.1. Let C([0, ∞)) be the space of continuous functions with the topology of uniform convergence on compacts. Then for every continuous Ψ : C([0, ∞]) → R we have that Ψ(Xn ) d −→ Ψ(B) (1.15) where Xn is defined by (1.8) and B = (Bt, t ≥ 0) is the Brownian motion. Example 1.0.1. Let’s consider Y n = max 0≤t≤T Xn t . The functional Ψ(f) = max 0≤t≤T f(t) is continu- ous, so we can apply Proposition (1.0.1). It tells us that Y n d −→ max 0≤t≤T Bt (1.16) This tool sometimes can be of great help, because if one has proved some property for the random walk this Proposition can help with the proof for the Brownian motion taking limits. However, we will encounter non-continuous functionals such as the stopping time: τ = inf{n > 0, Sn = a} (1.17) Because this functional is not continuous we cannot apply theorem (1.0.1). A consequence of this is for example that to show the recurrence of the random walk and the recurrence of Brownian motion we will need to prove these results separately. Although it seems quite intuitive that properties in the random walk must keep true in the Brownian motion (and as a matter of fact it almost always happens), we cannot deduce these results just taking limits.
  • 10.
    Chapter 2 Random Walk 2.1One-dimensional random walk Definition 2.1.1. Let Xn independent be random variables that can only take values 1 or −1 with equal probability, i.e., P(Xn = 1) = 1/2 and P(Xn = −1) = 1/2. A one-dimensional random walk with n steps is the sum of n of such variables Sn = X1 + X2 + . . . + Xn In the following we will consider a particle that can move with equal probability to the left (Xn = −1) and to the right (Xn = 1). The position it will be after n steps will be Sn. We consider it always starts at the origin, that is, S0 = 0. 2.1.1 Back to original position We are now interested in knowing whether the particle will ever return to the original position, that is P(∃n ≥ 1 : Sn = 0) (2.1) For this computation we consider two different events. An will be the event that the particle comes back to its original position for the first time at time n. We have then that A0 = ∅ because the particle could not come back as it didn’t even leave the origin yet, and A1 = ∅ because it is impossible to come back after 1 step. Then for n > 1 we define An := {Sn = 0, Sn−1 = 0, . . . S1 = 0} (2.2) Bn will be the event that the particle is in the original position, no matter if it’s not the first time. That is Bn := {Sn = 0} (2.3) and we define the probabilities an := P(An), bn := P(Bn) (2.4) For n = 0 we have a0 = 0 and b0 = 1. Notice that for n ≥ 1 Bn = n k=0 (Bn ∩ Ak) (2.5) because these events are disjoint we have bn = n k=0 P(Bn ∩ Ak) (2.6) 5
  • 11.
    CHAPTER 2. RANDOMWALK 6 and because of the independence of Ak and {Xk+1 + . . . + Xn = 0}: P(Bn ∩ Ak) = P(Sn = 0, Sk = 0, Sk−1 = 0, . . . S1 = 0) (2.7) = P(Ak, Xk+1 + . . . + Xn = 0) (2.8) = P(Ak)P(Xk+1 + . . . + Xn = 0) (2.9) Notice that P(Xk+1 + . . . + Xn = 0) = P(X1 + . . . + Xn−k) (2.10) hence we have just shown that bn = n k=0 akbn−k (2.11) Lemma 2.1.1. With the previous definitions the following equation holds ∞ n=0 an = 1 − 1 ∞ n=0 bn (2.12) Proof. For values s ∈ (−1, 1) the series ∞ n=0 ansn and ∞ n=0 bnsn converge. Indeed, because an and bn are bounded by 1, then ∞ n=0 an|s|n ≤ ∞ n=0 |s|n < 1 1 − |s| < ∞ (2.13) and absolute convergence implies convergence. If we multiply these series ∞ n=0 ansn · ∞ n=0 bnsn = ∞ n=0 cnsn (2.14) and if we compare the coefficients of sn on the LHS and RHS we get cn = ∞ k=0 akbn−k. We showed that a0 = 0, hence c0 = 0 and therefore ∞ n=0 ansn · ∞ n=0 bnsn = ∞ n=1 bnsn = ∞ n=0 bnsn − 1 (2.15) thus we obtain ∞ n=0 ansn = 1 − 1 ∞ n=0 bnsn (2.16) but an and bn are always positive. If we do the limit s → 1− we obtain a monotone increasing sequence. Then by the Monotone Convergence Theorem the limit gives ∞ n=0 an = 1 − 1 ∞ n=0 bn (2.17)
  • 12.
    CHAPTER 2. RANDOMWALK 7 Coming back to our previous problem, we want to see the probability that the particle will come back to its original position: P(∃n ≥ 1 : Sn = 0) = P( ∞ n=0 An) = ∞ n=0 an = 1 − 1 ∞ n=0 bn (2.18) We will show that ∞ n=0 bn = ∞ and, therefore, the particle will come back to its original position with probability 1. Let’s think what are the possible values of bn. To come back, the particle will need to go left as many times as it goes right. If it does n steps, it will have to go n/2 times right and n/2 times left. If n is odd it’s clear that bn = 0. If n = 2k then there are 2k k different paths it can follow, k to the left and k to the right, each with probability 1/2. Thus for n ≥ 1 bn =    0 , if n odd 2k k 1 2 k 1 2 k , if n = 2k (2.19) Recall that the Stirling’s approximation is k! ∼ k e k √ 2πk (2.20) when k → ∞. Then we have for big enough k b2k = (2k)! (k!)2 1 2 2k ∼ (2k)2k √ 4πk k2k2kπ 1 22k = 1 √ π 1 √ k (2.21) so we conclude ∞ n=0 bn = ∞ k=0 b2k = ∞ (2.22) that means, the particle will come back to its original position with probability 1. 2.1.2 Get to a specific position After showing that the particle will come back with probability 1 to its original position, we could further analyse whether the particle will ever visit a specific position. Let’s define f(x) := P(∃n ≥ 1 : Sn = x) (2.23) Lemma 2.1.2. With the previous definition, f(x) = 1 2 f(x − 1) + 1 2 f(x + 1) (2.24)
  • 13.
    CHAPTER 2. RANDOMWALK 8 Proof. Suppose x = 1, −1, then f(x) = P(∃n ≥ 1 : Sn = x) = P(∃n ≥ 1 : X1 + . . . + Xn = x) = P(∃n ≥ 1 : X1 + . . . + Xn = x, X1 = 1) + P(∃n ≥ 1 : X1 + . . . + Xn = x, X1 = −1) = P(∃n ≥ 1 : X1 + . . . + Xn = x|X1 = 1)P(X1 = 1)+ + P(∃n ≥ 1 : X1 + . . . + Xn = x|X1 = −1)P(X1 = −1) = 1 2 P(∃n ≥ 2 : X2 + . . . + Xn = x − 1) + 1 2 P(∃n ≥ 2 : X2 + . . . + Xn = x + 1) = 1 2 P(∃n − 1 ≥ 1 : X1 + . . . + Xn−1 = x − 1) + 1 2 P(∃n − 1 ≥ 1 : X1 + . . . + Xn−1 = x + 1) = 1 2 P(∃m ≥ 1 : X1 + . . . + Xm = x − 1) + 1 2 P(∃m ≥ 1 : X1 + . . . + Xm = x + 1) = 1 2 f(x − 1) + 1 2 f(x + 1) For x = 1, −1 because f(0) = 1 if S0 = 0 then f(1) = 1 2 + 1 2 f(2) and f(−1) = 1 2 f(−2)+ 1 2 . Suppose f(x) = 1 for some x, then 1 = f(x) = 1 2 f(x − 1) + 1 2 f(x + 1) (2.25) but f(x − 1) ≤ 1 and f(x + 1) ≤ 1 because they are probability measures. Thus to obtain the previous equality follows that f(x − 1) = 1 and f(x + 1) = 1. By induction using that we have already seen that f(0) = 1 we can cover the whole line, so we proved that f(x) = 1 for all x ∈ Z. 2.1.3 Expected time to get back to origin The aim of this section will be to compute the “average” time the particle will need to get back to the original position. One could at first think that this time will not be very large. After all, the probability that it will go back to the origin after the first step, whichever this is, is 1/2. We will however show that the average time is infinite. Lemma 2.1.3. 1 √ 1 − 4x = ∞ m=0 2m m xm (2.26) Proof. We will use the generalized binomial theorem, which states that (x + y)r = ∞ r=0 r k xr−k yk (2.27) where r k = r(r − 1) . . . (r − k + 1) k! (2.28) Let’s apply this formula to our problem: (1 − 4x)−1/2 = ∞ m=0 m k=1(2k − 1) 2mm! (4x)m = ∞ m=0 m k=1(2k − 1) m! 2m xm (2.29)
  • 14.
    CHAPTER 2. RANDOMWALK 9 so we need to see that the coefficients coincide, that is m k=1(2k − 1) m! 2m = 2m m (2.30) the last equation can be rewritten in a simpler way m k=1 (2k − 1)2m = (2m)! m! = 2m k=m+1 k (2.31) Let’s show it by induction. For m = 1 the equation holds. Suppose it true for m. For m + 1 we have m+1 k=1 (2k − 1)2m+1 = 2(2m + 1)2m m k=1 (2k − 1) (2.32) and 2m+2 k=m+2 k = 1 m + 1 (2m + 2)(2m + 1) 2m k=m+1 k (2.33) using the induction hypothesis 2(2m + 1) = 1 m + 1 (2m + 2)(2m + 1) (2.34) which is true. Theorem 2.1.1. For m ≥ 1, the probability of a first return to the origin at a time 2m is given by a2m = b2m 2m − 1 = 2m m (2m − 1)22m (2.35) Proof. Let’s begin defining the functions U(x) = ∞ m=0 b2mxm (2.36) and F(x) = ∞ m=0 a2mxm (2.37) Since we know that for m ≥ 1 b2m = 2m m=0 a2kb2m−2k (2.38) then U(x) = 1 + U(x)F(x) (2.39) where the 1 in the RHS from the last equation comes from the fact that b0 = 1. We note that both functions converge on the interval (−1, 1), since both an and bn are less than 1 in absolute value. Thus solving for F(x) F(x) = U(x) − 1 U(x) (2.40) From (2.19) we have that U(x) = ∞ m=0 2m m 2−2m xm (2.41)
  • 15.
    CHAPTER 2. RANDOMWALK 10 and from (2.26) 1 √ 1 − 4x = ∞ m=0 2m m xm (2.42) so that U(x) = 1 √ 1 − x (2.43) and therefore F(x) = U(x) − 1 U(x) (2.44) = (1 − x)−1/2 − 1 (1 − x)−1/2 (2.45) = 1 − (1 − x)1/2 (2.46) and we note that F (x) = U(x)/2. So if we integrate the series U(x)/2 and equate the coeffi- cients of these series to those of F(x), we can obtain an expression for a2m: a2m = b2m−2 2m = 2m−2 m−1 m22m−1 = 2m m (2m − 1)22m = b2m 2m − 1 where we have used in the third step that 2m − 2 m − 1 = m 2(2m − 1) 2m m Corollary 2.1.1. The expected time to get back to the origin is infinite Proof. From (2.35) we know the expression of a2m a2m = b2m 2m − 1 and from (2.21) we know that b2m ∼ 1 √ m so we conclude that a2m ∼ 1 m √ m (2.47) hence the expected time to get back to the origin diverges E(T) = ∞ m=1 a2m · 2m ∼ ∞ m=1 2m m √ m = ∞ m=1 2 √ m = ∞ (2.48)
  • 16.
    CHAPTER 2. RANDOMWALK 11 2.2 Two-dimensional random walk Definition 2.2.1. Let Xn be independent random vectors that can take values (1, 0), (0, 1), (0, −1) or (−1, 0) with equal probability of 1/4. A two-dimensional random walk with n steps is the sum of such random vectors Sn = X1 + X2 + . . . + Xn In this case the particle will be able to move up, down, left and right. 2.3 Back to the original position We are interested in knowing if it will come back to the origin, as it happened for 1 dimension. That is, we want to compute P(∃n ≥ 1 : Sn = 0) (2.49) Using the same definitions as before, an := P(Sn = 0, Sn−1 = 0, . . . , S1 = 0) bn := P(Sn = 0) and P(∃n ≥ 1 : Sn = 0) = ∞ n=0 an = 1 − 1 ∞ n=0 bn (2.50) Hence if ∞ n=0 bn = ∞, the probability that it will come back to the origin will be 1. Note that in order to come back to the origin we need the same amount of up and down steps, and the same amount of left and right steps. That makes bn = 0 for n odd. If n = 2k then each path that finishes in the origin has equal probability 1 42k . Now let’s count how many possible paths there are. The particle may go j steps up and j steps down, and k −j left and k − j right (note that the number total of steps is 2k), where j can be any number for 0 to k. If every step were different, there would be (2k)! choices, but given any path we can reorder the j down steps in j! different ways without changing the path. The same holds for up, left and right steps. Thus the number of possible combinations is (2k)! j!j!(k − j)!(k − j)! (2.51) and the probability bn = 1 42k k j=0 (2k)! j!j!(k − j)!(k − j)! (2.52)
  • 17.
    CHAPTER 2. RANDOMWALK 12 We can rewrite bn as follows b2k = 1 42k k j=0 (2k)! j!j!(k − j)!(k − j)! (2.53) = 1 42k k j=0 2k k!k! k!k! j!j!(k − j)!(k − j)! (2.54) = 1 42k 2k k k j=0 k j 2 (2.55) = 1 42k 2k k 2 (2.56) where we have use the equation k j=0 k j 2 = 2k k (2.57) Let’s explain from where this formula comes. We know by Newton Binomial that (x + 1)2k = 2k i=0 2k i xi (2.58) but this can also be writen as (x + 1)k (x + 1)k = k j=0 k j xj k i=0 k i xi (2.59) the coefficient of xk in both expressions have to be the same, that is 2k k = k j=0 k j k k − j = k j=0 k j k j = k j=0 k j 2 (2.60) then b2k = 1 22k 2k k 2 (2.61) If we look closely we will see that this is the same expression as in one dimension to the square. Using Stirling’s formula, b2k = 1 22k 2k k 2 ∼ 1 πk (2.62) And finally we see that the following series is divergent ∞ n bn ≥ ∞ k=0 b2k = ∞ (2.63) and hence P(∃n ≥ 1 : Sn = 0) = 1 (2.64)
  • 18.
    CHAPTER 2. RANDOMWALK 13 2.4 Get to a specific position As for the one-dimensional case, it can be seen that the particle will reach any position with probability 1 in the plane. Let x = x1e1 + x2e2, with x1, x2 ∈ Z, e1 = (1, 0), e2 = (0, 1) and g(x) be the probability that there exists n ≥ 1 such that Sn = x, i.e. g(x) = P(∃n ≥ 1 : Sn = x) (2.65) The same reasoning as in the one-dimensional case shows that g(x) = 1 4 (g(x − e1) + g(x + e1) + g(x − e2) + g(x + e2)) (2.66) and because g(x) are probabilities, 0 ≤ g(x) ≤ 1. So if g(x) = 1 it must follow that g(x − e1) = g(x + e1) = g(x − e2) = g(x + e2) = 1. But we showed in the previous section that g(0) = 1, so inductively follows that g(x) = 1 for every x. 2.5 Three-dimensional random walk Definition 2.5.1. Let Xn be independent random vectors that can take values (1, 0, 0), (0, 1, 0), (0, 0, 1), (−1, 0, 0), (0, −1, 0) or (0, 0, −1) with equal probability of 1/6. A three-dimensional random walk with n steps is the sum of such random vectors Sn = X1 + X2 + . . . + Xn Now the particle has freedom to move along up, down, left, right, backward and forward. 2.6 Back to the origin Adapting the same definitions as in previous sections we have P(∃n ≥ 1 : Sn = 0) = ∞ n=0 an = 1 − 1 ∞ n=0 bn (2.67) so the particle will go back to the origin if ∞ n=0 bn = ∞. As before for n ≥ 1 odd bn = P(Sn = 0) = 0 (2.68) If n = 2k then the same reasing as in the two-dimensional case applies. The particle can go j steps up and down, i backward and forward and k − j − i left and right. If every path were differenth there would be (2k)! possibilites, but because we can reorder all the j up and down steps in j!j! ways, all the i!i! backward and forward steps in i! ways and all the k − j − i left and right steps in (k − j − i)!(k − j − i)! ways without changing the path, the probability is b2k = 1 62k k j=0 k−j i=0 (2k)! j!j!i!i!(k − j − i)!(k − j − i)! (2.69)
  • 19.
    CHAPTER 2. RANDOMWALK 14 where we are summing over all the possible values of j and i. If we rewrite b2k we obtain b2k = 1 62k k j=0 k−j i=0 (2k)! j!j!i!i!(k − j − i)!(k − j − i)! (2.70) = 1 22k 1 32k k j=0 k−j i=0 2k k!k! k!k! j!j!i!i!(k − j − i)!(k − j − i)! (2.71) = 1 22k 2k k k j=0 k−j i=0 1 32k k!k! j!j!i!i!(k − j − i)!(k − j − i)! (2.72) = 1 22k 2k k k j=0 k−j i=0 1 3k k! j!i!(k − j − i)! 2 (2.73) The terms in the last summation are the terms of a trinomial distribution. This can be thought as the urn problem given k draws with replacement where we have white, black and red balls. If X, Y and Z are random variables that take values on the number of white, black and red balls drawn respectively then for j + i ≤ k P(X = j, Y = i, Z = k − j − i) = 1 3k k! j!i!(k − j − i)! (2.74) Hence the sum of the probability of all possible outcomes has to be 1, that is k j=0 k−j i=0 1 3k k! j!i!(k − j − i)! = 1 (2.75) but in the expression above we have the summation of the square terms. If a random variable can only take n values with probabilities p1, . . . , pn then n j=1 p2 j ≤ n j=1 pj( max 1≤i≤n pi) ≤ ( max 1≤i≤n pi) n j=1 pj = ( max 1≤i≤n pi) (2.76) therefore b2k ≤ 1 22k 2k k max 1≤i,j≤k 1 3k k! j!i!(k − j − i)! (2.77) Let’s think where this term achieves its maximum. It will be when the denominator is minimum. If k = 3m from the definition of factorial itself it can be easily checked that the denominator takes its minimum when j = m, i = m and k − j − i = m. If k = 3m + 1 then it will be when two of them are m and one m + 1 and if k = 3m − 1 when two of them are m and one m − 1. For k = 3m b2k ≤ 1 22k 2k k 1 3k k! m!m!m! (2.78) and using Stirling’s approximation 1 22k 2k k 1 3k k! m!m!m! ∼ 1 √ πk (3m e )3m √ 6mπ (m e )m √ 2mπ = C1 k √ k (2.79) where C1 is a constant. For k = 3m + 1 and k = 3m − 1 the behaviour for big enough values will be the same as in the case k = 3m, so ∞ k=0 b2k ≤ C ∞ k=0 1 k √ k < ∞ (2.80)
  • 20.
    CHAPTER 2. RANDOMWALK 15 This shows that the probability to come back to the origin is strictly less than 1. But the probability is also strictly positive. For example, we know that a2 = 1 6 . That is, after the first step the probability that it will come back is the probability that it will take a step in the opposite way to the first step. We see that as we are including more dimensions, the power of k in the denominator of b2k increases. In dimensions higher than 3 we would expect that the power of k is even higher, making the probability to return to origin even smaller than for d = 3. The idea widely speaking is that as we grow in dimensions there are more ‘choices’ for the movement of the particle and that makes it more ‘difficult’ for the particle to come back. We will however not show that for d > 3 the probability of coming back to the origin of the random walk is less than 1. 2.7 Get to a specific position Adapting the same definitions as in the previous sections for the three-dimensional case, g(d) = 1 6 (g(d + e1) + g(d + e2) + g(d + e3)+ + g(d − e1) + g(d − e2) + g(d − e3)) if d were a point such that g(d) = 1 then g(d + e1) + g(d + e2) + g(d + e3) + g(d − e1) + g(d − e2) + g(d − e3) = 1 (2.81) but by induction we would arrive to g(0) = 1, which contradicts what we have just shown. Therefore it must be g(d) < 1 for all d ∈ Z3 .
  • 21.
    Chapter 3 Simulations: Randomwalks In this chapter we will run different simulations to compare experimental results to theoretical results explained in the previous chapters. For most simulations we will use Python, and in some cases Java. All scripts have been made by David Nebra unless otherwise stated. 3.1 One-dimensional random walk We will run several simulations of random walks starting at the origin and count the number of steps it takes for the particle to get back to the origin for the first time for every simulation. We will gather this information in two histograms. In the same plots we will draw the curve that represents the theoretical probabilites, computed in Theorem (2.35). For the first histogram we run 50000 simulations and every simulation will be cut off if after 60 steps the particle has not returned to the origin. For the second histogram we run 10000 simulations and every simulation will be cut off if after 3000 steps the particle has not returned to the origin. In order to represent the information in the second histogram, the x-axis and y-axis will be in log scale so we can see a better representation of the data. Figure 3.1 For a closer look at the results depicted in 3.1 we show the following table, which compares the 16
  • 22.
    CHAPTER 3. SIMULATIONS:RANDOM WALKS 17 values obtained by both the simulation and the theory. N Theory Simulations Desviation (%) 2 25000 25030 0.1 4 6250 6196 -0.8 6 3125 3139 0.4 8 1953 1956 0.14 10 1367 1389 1.5 12 1025 1016 -0.9 14 806 780 -3.2 16 655 683 4.3 18 545 590 8.2 20 463 469 1.1 22 400 396 -1.1 24 350 359 2.5 26 310 293 -5.4 28 277 301 8.7 30 249 237 -4.8 N Theory Simulations Desviation (%) 32 226 240 6.3 34 206 235 14.1 36 189 176 -6.7 38 174 181 4.2 40 161 154 -4.2 42 149 149 0 44 139 128 -7.9 46 130 120 -7.6 48 122 96 -21.2 50 115 104 -9.2 52 108 115 6.5 54 102 104 2.0 56 96 91 -5.6 58 92 91 -0.5 Table 3.1: This table gather both the theoretical and experimental frequencies, and also the desviation with respect to the theoretical values. The desviation has been calculated as Desviation = Experimental frequencies − Theoretical frequencies Theoretical frequencies · 100 (3.1) Looking into the data in the table we observe a trend that we could not see in the plotted graph. We observe that the desviation (i.e the error) grows as the number of steps grows. This is something we should expect, because the number of particles that go back to origin after N steps decreases as N grows. That means that we have less data available for N big and therefore the simulations are less accurate. This is a direct implication of the Law of Large Numbers (see page 8 of the reference [5]). For the theoretical counts, we have used the formula 2.35. The expected count Y2m of the number of particles that reach back the origin after 2m steps will be given by E(Y2m) = N · a2m (3.2) where N is the total number of simulations. For example, the expected count of particles that come back to origin after 2 steps for 50000 simulations is E(Y2m) = 50000 · 1 2 = 25000 (3.3) Now we will see another simulation in log-log scale.
  • 23.
    CHAPTER 3. SIMULATIONS:RANDOM WALKS 18 Figure 3.2: Particles to reach back origin in log-log scale It is important to remark that even though the bins in the figure (3.2) are the same width, the more to the right they are the more number of steps they represent. To make it easier to understand let’s take an example, the bin 0 to 1 is the sum of all the simulations in which the particle returned back to the origin and took between e0 = 1 and e1 = 2.71 . . . steps. So we now that the bin 0 to 1 only represent the case when the particle returned back to the origin after 2 steps. If we take the bin 7 to 8 it represents all the simulations in which the particle returned back to the origin and took between e7 = 1096.63 . . . and e8 = 2980.95 . . . steps. So this bin counts for every simulation in which it took the particle 1098 steps, or 1100 steps,..., or 2980 steps to go back to the origin. We can collect this data in a table: log(N) Theory Simulations Desviation [0 − 1) 5000 4921 -1.5 [1 − 2) 1875 1906 1.6 [2 − 3) 1363 1356 -0.5 [3 − 4) 681 680 -0.1 [4 − 5) 426 445 4.4 [5 − 6) 257 285 10.8 [6 − 7) 156 146 -6.8 [7 − 8) 94 90 -5.1 3.1.1 Code The following script runs M different simulations of random walks of length at most N. For every simulation when the random walk reaches 0 for the first time it stops the simulation and keeps the number of steps in a vector v. def SimRandomWalk(N=100, M=1000): v=[] for l in range (1 ,M) :
  • 24.
    CHAPTER 3. SIMULATIONS:RANDOM WALKS 19 x=numpy . random . uniform ( −0.5 ,0.5 ,(N, 1 ) ) x[0]=0 i=1 k=0 suma=1 while suma!=0 and i<N or k==0: i f k==0: k=1 suma=0 i f x [ i ] >0: x [ i ]=1 else : x [ i ]=−1 suma=suma+x [ i ] i=i+1 i f suma==0: v . append ( i −1) return v The next script on the one hand computes the theoretical probabilities a2m (yam in the script) and then it plots these probabilites together with an histogram of the simulations. This is the code used for plotting figure (3.1). def freqHistogram1D (N=30,M=50000): f=math . f a c t o r i a l yam=[] xam=[] for m in range (1 ,N) : yam. append (M* f (2*m)/( f (m)* f (m)*(2*m−1)*2**(2*m) ) ) xam. append(1+2*m) X=SimRandomWalk(2*N,M) (n , bins , patches ) = plt . h i s t (X, bins=N−1) #p l t . s c a t t e r (xam,yam, c=’r ’) plt . plot (xam,yam, c=’ r ’ ) red patch = mp. Patch ( color=’ red ’ , l a b e l=’ Theoretical frequencies ’ ) blue patch = mp. Patch ( color=’ blue ’ , l a b e l=’ Experimental frequencies ’ ) plt . legend ( handles =[ red patch , blue patch ] ) plt . xlabel ( ’N’ ) plt . ylabel ( ’ Frequency ’ ) plt . show () xam [ : ] = [ x−1 for x in xam] yam=numpy . array (yam) X=numpy . array (X) for i in range (0 ,N−1): print (( n [ i ]−yam[ i ] ) /yam[ i ] ) print (xam,yam, n) Lastly, to make the plot in figure (3.2) we used the following code. def freqHistogram1DLogLog (N=3000,M=10000): f=math . f a c t o r i a l yam=[]
  • 25.
    CHAPTER 3. SIMULATIONS:RANDOM WALKS 20 xam=[] bins=9 suma1 , suma2 , suma3 , suma4 , suma5 , suma6 , suma7 , suma8 , suma9 = [ 0 ] * 9 for m in range (1 ,N) : mm=2*m yam. append (M* f (mm)/( f (m)* f (m)*(mm−1)*2**(mm) ) ) i f 0<=math . log (mm)<1: suma1=suma1+yam[m−1] e l i f 1<math . log (mm)<2: suma2=suma2+yam[m−1] e l i f 2<math . log (mm)<3: suma3=suma3+yam[m−1] e l i f 3<math . log (mm)<4: suma4=suma4+yam[m−1] e l i f 4<math . log (mm)<5: suma5=suma5+yam[m−1] e l i f 5<math . log (mm)<6: suma6=suma6+yam[m−1] e l i f 6<math . log (mm)<7: suma7=suma7+yam[m−1] e l i f 7<math . log (mm)<8: suma8=suma8+yam[m−1] e l i f 8<math . log (mm)<9: suma9=suma9+yam[m−1] yam=[suma1 , suma2 , suma3 , suma4 , suma5 , suma6 , suma7 , suma8 , suma9 ] for m in range (0 , bins ) : xam. append (0.5+m) X=l i s t (map(math . log , SimRandomWalk(2*N,M) ) ) (n , bins , patches ) = plt . h i s t (X, bins=numpy . arange ( bins ) , log=True ) plt . plot (xam,yam, c=’ r ’ ) plt . xlabel ( ’ log (N) ’ ) plt . ylabel ( ’ Frequency ’ ) red patch = mp. Patch ( color=’ red ’ , l a b e l=’ Theoretical frequencies ’ ) blue patch = mp. Patch ( color=’ blue ’ , l a b e l=’ Experimental frequencies ’ ) plt . legend ( handles =[ red patch , blue patch ] ) for i in range ( 0 , 8 ) : print (( n [ i ]−yam[ i ] ) /yam[ i ] ) print (xam,yam, n) plt . show () 3.2 Two-dimensional random walk The simulations here are identical as in the previous section, but for two-dimensional random walks. The first histogram shows the count of all the particles that come back to origin after 60 steps. The values we selected for making the second plot are N = 60 and M = 50000, being M the number of simulations. In the second histogram, we took N = 1000 and M = 10000.
  • 26.
    CHAPTER 3. SIMULATIONS:RANDOM WALKS 21 Figure 3.3 From this chart we could try to compute the probabilites an. We just need to read from the plot the number of particles that returned after n steps, and then divide by the total number of simulations, that is M = 50000. For example, a2 ≈ 12500 50000 = 1/4 = 0.25 a4 ≈ 4000 50000 = 2/25 = 0.08 a6 ≈ 2000 50000 = 1/25 = 0.04 . . . If we take into account again the Law of Large Numbers, this method would allow us to re- construct the theoretical probabilites an. Of course, it would only be an approximation, but it can be as good as we want, we just need big values of M. For an with n big there will be trouble because we will need much computation power, but for small values of n one can find the probability with great accuracy. The next plot is again in log-log scale for better visualization. Because we have no theoretical data to compare it with, we have computed the regression line y = mx + b. For its calculation, we have taken the middle point of every bin and its corresponding log frequency. Because the y-axis of the plot are in logarithmic scale, we actually draw 10y instead of y, so we would see a line in the plot. Exact details of its calculation can be found in the code.
  • 27.
    CHAPTER 3. SIMULATIONS:RANDOM WALKS 22 Figure 3.4: Plot and regression line y = mx + b with m = −0.14 and b = 3.38 This regression line can help us make some rough predictions. For example, if we take the value x = 12.5 with the information of the regression line we know that a total of 10y = 10−0.14·12.5+3.38 simulations reached back the origin between e12 and e13 steps. That is, only 43 simulations from a total of 10000 reached back the origin for the first time after doing between 162754 and 442414 steps. In the next section we will compare this regression line to that of the three dimensional case. 3.2.1 Code The following script runs M different simulations of random walks of length at most N. For every simulation when the random walk reaches 0 for the first time it stops the simulation and keeps the number of steps in a vector v. def SimRandomWalk2D(N=100,M=1000): v=[] for l in range (1 ,M) : x=numpy . random . uniform ( −0.5 ,0.5 ,(N, 1 ) ) x[0]=0 i=1 k=0 sumax=1 sumay=1 while (sumax!=0 or sumay!=0) and i<N or k==0: i f k==0: k=1 sumax=0 sumay=0 i f x [ i ] >0.25: sumax=sumax+1
  • 28.
    CHAPTER 3. SIMULATIONS:RANDOM WALKS 23 i f x [ i ]>0 and x [ i ] <0.25: sumax=sumax−1 i f x [ i ] < −0.25: sumay=sumay+1 i f x [ i ]<0 and x [ i ] > −0.25: sumay=sumay−1 i=i+1 i f sumax==0 and sumay==0: v . append ( i −1) return v for plotting figure (3.3): def freqHistogram2D (N=30,M=50000): plt . h i s t (SimRandomWalk2D(2*N,M) , bins=N−1) blue patch = mp. Patch ( color=’ blue ’ , l a b e l=’ Experimental frequencies ’ ) plt . legend ( handles =[ blue patch ] ) plt . xlabel ( ’N’ ) plt . ylabel ( ’ Frequency ’ ) and for plotting figure (3.4): def freqHistogram2DLogLogLine (N=1000,M=10000): bins=9 xam=[] logn =[] x = numpy . linspace (0 ,8 ,100) X=l i s t (map(math . log , SimRandomWalk2D(2*N,M) ) ) (n , bins , patches ) = plt . h i s t (X, bins=numpy . arange ( bins ) , log=True ) blue patch = mp. Patch ( color=’ blue ’ , l a b e l=’ Experimental frequencies ’ ) plt . legend ( handles =[ blue patch ] ) plt . xlabel ( ’ log (N) ’ ) plt . ylabel ( ’ Frequency ’ ) for m in range ( 0 , 8 ) : xam. append (0.5+m) i f n [m]!=0: logn . append (math . log10 (n [m] ) ) else : logn . append (0) print ( logn ,xam) m, b = numpy . p o l y f i t (xam, logn , 1) plt . plot (x , 10**(m*x+b ) , ’−’ ) print (m, b) 3.2.2 Path samples
  • 29.
    CHAPTER 3. SIMULATIONS:RANDOM WALKS 24 Figure 3.5: Two different simulations for a 2D random walk. The particle (blue) will go up, down, left or right with equal probability. 3.2.3 Code We used a code in Java provided by Princeton: public class randomWalk2 { public static void main( String [ ] args ) { int N = 60; StdDraw . setXscale(−N, +N) ; StdDraw . setYscale(−N, +N) ; StdDraw . c l e a r (StdDraw .GRAY) ; int x = 0 , y = 0; int steps = 0; while (Math . abs (x) < N && Math . abs (y) < N) { StdDraw . setPenColor (StdDraw .WHITE) ; StdDraw . f i l l e d S q u a r e (x , y , 0 . 4 5 ) ; double r = Math . random ( ) ; i f ( r < 0.25) x−−; else i f ( r < 0.50) x++; else i f ( r < 0.75) y−−; else i f ( r < 1.00) y++; steps++; StdDraw . setPenColor (StdDraw .BLUE) ; StdDraw . f i l l e d S q u a r e (x , y , . 4 5 ) ; StdDraw . show ( 4 0 ) ; } StdOut . println ( ”Total steps = ” + steps ) ; } } The functions StdDraw and StdOut are just for drawing and printing the results. They are
  • 30.
    CHAPTER 3. SIMULATIONS:RANDOM WALKS 25 defined in other documents but they are not interesting for our purposes. The algorithm creates a loop, for which in each step a random number r in the interval (0, 1] is created. The interval is divided into four equal parts. Depending on the value of r the particle will go down, up, left or right. 3.3 Three-dimensional random walk The first two simulations in the section are identical as in the previous section, but for three- dimensional random walks. The values for the first histogram are N = 60 and M = 50000 and for the second histogram N = 1000 and M = 10000. The histograms are the following Figure 3.6 As before, we could compute the probabilites an with the information in the plot a2 ≈ 8500 50000 = 0.17 (3.4) a4 ≈ 2000 50000 = 0.04 (3.5) a6 ≈ 1000 50000 = 0.02 (3.6) . . . (3.7) Next histogram is in log-log scale for better visualization, and the regression line has been calculated
  • 31.
    CHAPTER 3. SIMULATIONS:RANDOM WALKS 26 Figure 3.7: Plot and regression line y = mx + b with m = −0.24 and b = 3.24 Before we move on, let’s have a look at the regression lines for the 2D and 3D random walks. For the 2D random walk we obtained y = −0.14x + 3.38 while for the 3D random walk y = −0.24x + 3.24. First we start with the similarities. They both have a negative slope and a positive intercept. This all makes sense, a negative slope means that the number of particles that come back to the origin after N steps is smaller than the number that come back after n steps, where N > n. Alternatively, the more steps that a particle has been away from the origin, the less ‘probable’ it is to come back in the next step. For this reason, the intercept must be positive. Otherwise it would lack of any physical sense as the number of steps would take negative values. The big difference between them is the slope of the regression lines. For the 2D case we have m = −0.14 and for the 3D m = −0.24 which is a difference close to 50%. This means that the increment ∆N = N2 − N1, where N2 > N1, is smaller for 2D than for 3D. That is, the histogram for 3D is more ‘heavy’ for small values of N and it decreases faster to 0 as N grows than for the 2D case. 3.3.1 Code The following script runs M different simulations of random walks of length at most N. For every simulation when the random walk reaches 0 for the first time it stops the simulation and keeps the number of steps in a vector v. def SimRandomWalk3D(N=100,M=1000): v=[] for l in range (1 ,M) : x=numpy . random . uniform (0 ,6 ,(N, 1 ) ) x[0]=0 i=1 k=0 sumax=1
  • 32.
    CHAPTER 3. SIMULATIONS:RANDOM WALKS 27 sumay=1 sumaz=1 while (sumax!=0 or sumay!=0 or sumaz!=0) and i<N or k==0: i f k==0: k=1 sumax=0 sumay=0 i f x [ i ]>0 and x [ i ] <1: sumax=sumax+1 i f x [ i ]>1 and x [ i ] <2: sumax=sumax−1 i f x [ i ]>2 and x [ i ] <3: sumay=sumay+1 i f x [ i ]>3 and x [ i ] <4: sumay=sumay−1 i f x [ i ]>4 and x [ i ] <5: sumaz=sumaz+1 i f x [ i ]>5 and x [ i ] <6: sumaz=sumaz−1 i=i+1 i f sumax==0 and sumay==0 and sumaz==0: v . append ( i −1) return v for plotting figure (3.6): def freqHistogram3D (N=30,M=50000): plt . h i s t (SimRandomWalk3D(2*N,M) , bins=N−1) blue patch = mp. Patch ( color=’ blue ’ , l a b e l=’ Experimental frequencies ’ ) plt . legend ( handles =[ blue patch ] ) plt . xlabel ( ’N’ ) plt . ylabel ( ’ Frequency ’ ) and for plotting figure (3.7): def freqHistogram3DLogLogLine (N=1000,M=10000): bins=9 xam=[] logn =[] x = numpy . linspace (0 ,8 ,100) X=l i s t (map(math . log , SimRandomWalk3D(2*N,M) ) ) (n , bins , patches ) = plt . h i s t (X, bins=numpy . arange ( bins ) , log=True ) blue patch = mp. Patch ( color=’ blue ’ , l a b e l=’ Experimental frequencies ’ ) plt . legend ( handles =[ blue patch ] ) plt . xlabel ( ’ log (N) ’ ) plt . ylabel ( ’ Frequency ’ ) for m in range ( 0 , 8 ) : xam. append (0.5+m) i f n [m]!=0: logn . append (math . log10 (n [m] ) ) else : logn . append (0)
  • 33.
    CHAPTER 3. SIMULATIONS:RANDOM WALKS 28 print ( logn ,xam) m, b = numpy . p o l y f i t (xam, logn , 1) plt . plot (x , 10**(m*x+b ) , ’−’ ) print (m, b)
  • 34.
    Chapter 4 Brownian motion 4.1History of Brownian motion Brownian motion takes its name after a Scottish botanist, Robert Brown. Brown was a famous man in his time, but not for the discovery that has his name, but for the classification of the plants of the New World. When looking through a microscope in 1827 at grains of pollens suspended in water, Brown noticed that a group of grains always disperses and that individual grains move around continuously, irregularly and very quickly. Such phenomena were observed already prior to Brown, but only in organic particles. It was believed back then that it was a property from organic molecules, having some kind of mysterious ‘vital force’. Brown was not very excited about this idea that could fit the living pollen, so he decided to check if the same motion was observed with non-organic particles. Both organic and non-organic particles dis- played the same kind of motion, which showed that the motion had a physical origin. Brown’s limited equipment could only show that this motion was not caused by currents in the liquid, nor by convection, nor by evaporation of the solvent. The mystery was left unsolved for many years. It was not considered as an important problem in Physics but nevertheless many people attempted to solve it. Appart from the causes that Brown himself showed that were not responsible for Brownian motion, chemical composition, shape of container, and several of external influence were eliminated as possible causes. After Maxwell and Boltzmann formulated the so-called kinetic theory, many physicists tried to ex- plain Brownian motion in those terms, in particular by determining the velocity of the particles. All those attempts failed. Now all these failures are of historical interest, but back to the beginning of the 20th they were of great importance for two men: Albert Einstein and Marian Smoluchowski. That many scientists had failed to explained the Brownian motion in terms of conventional Physics pre- pared the ground for a new revolutionary explanations proposed by them. The year 1905 is considered to be a miracle year for theoretical physics. In this year not only Einstein did pub- lish a famous paper where he explained the mechanism of the Brownian motion, but he also published two papers lying foundations for the Special Theory of Relativity and one explaining the photoelectric effect, that would win him the Nobel prize in 1921. An independent paper explaining also the Brownian motion was published in 1905 by Smoluchowski. This new and revolutionary concepts were for many years heavily opposed by leading scientists. Einstein’s and Smoluchowski’s idea was that the movement of Brownian particles was caused by collisions with molecules of the solvent. This molecules move in display of their thermal energy, of which the temperature is a measure. When a particle is suspended in any fluid, like air or water, the atoms or molecules composing the fluid hit the particle from different directions. While the human eye cannot see the effect of individual impacts, it can observe the net motion caused by many impacts over a period of time. While this explanation may seem 29
  • 35.
    CHAPTER 4. BROWNIANMOTION 30 today trivial, it was far from trivial over 100 years ago. In fact, the atomistic hypothesis, that is, the hypothesis that matter is grainy and cannot be continuously divided infinitely, was not commonly accepted. Some scientists treated it as an unsupported working hypothesis and oth- ers, including eminent figures as Wilhelm Ostwald, the 1909 Nobel Prize in chemistry, opposed it vigorously. Einstein and Smoluchowski claimed that this motion provided a proof of the existence of molecules in the solvent and, what is more, that by observing the Brownian particles one could get much insight into the properties of the molecules of the solvent. They observed that the mean displacement of a particle (squared) was proportional to the duration of the obser- vation, and that the proportionality constant was related to the so-called diffusion coefficient D: E[(Bt − B0)2 ] = 2Dt, D = KBT γ (4.1) where KB is the Boltzmann constant, T the temperature and γ = 6πνR is the Stokes friction coefficient for a spehere with radius R. These results rendered feasible many specific measures, for example it was possible to experimentally determine the Avogadro constant. It is interesting to know that explaining Brownian motion was not Einstein’s goal. He was aiming to establish a relationship between the diffusion coefficient and the themperature, in which he succeeded, but he also guessed what the thermal motion should look like. On the contrary, Smoluchowski knew the experimental data on the Brownian motion very well and in- tended to explain them. It is now clear that Smoluchowski obtained the results before Einsten, but decided to publish them after he was impressed by Einstein work. These papers have also answered several other questions. First, they provided a microscopical explanation of diffusion (molecules of the substance that diffuses are ‘pulled through’ by the collisions with the molecules in the solvent), second, they derived an equation known today as the diffusion equation, and third they explained why all other attemps in describing the Brownian motion in terms of velocities had failed. Smoluchowski noticed that displacements of Brownian particles seen in a microscope resulted from a huge number of collisions with the molecules of the solvent: the displacements were averaged over many such collisions. The time between two consecutive collisions is much shorter that we can now, in the 21t h century, ob- serve. At any two observed zigzags there are many other zigzags that have happened and we have failed to observe. There is an important remark to do here. The Newtonian dynamics, commonly used in Smolu- chowski times and today for explaining a large array of phenomena, says that the trajectory of any particle can be described by means of a certain differential equation. To write down this equation, you need to know all the forces acting on this particle. The forces may be changing but as long as these changes are smooth, the trajectory of the particle will also be smooth. Smoluchowski revolutionary point of view was that Brownian motion was not smooth, therefore challenging a ‘sacred’ canon of Physics back then. This was truly a deviation of a well-established paradigm, but it was succesful in explaning an experiment that other theories could not explain. The diffusion equation mentioned above does not aim to explain perfectly the behaviour of a single particle, but rather the behaviour a large enough amount of particles, for example a drop of ink in a water tank. While the motion of a single particle may be erratic and awkward, the collective behaviour can be quite decent and predictible. This is a totally new approach in Physics, that changes from deterministic to probabilistic. The works of Einstein and Smoluchowski have become one of the cornerstones of Probability Calculus and the theory of Stochastic Processes
  • 36.
    CHAPTER 4. BROWNIANMOTION 31 4.2 The Difussion Equation The diffusion equation is an equation that describes the behaviour of a collective motion of particles in a material, resulting from the random movement of each particle. There are many approaches to derive this equation, we will use two of them: the Einstein’s derivation and the Macroscopic Derivation. First we will explain Einstein’s derivation. Then we will see Langevin’s approach and how the diffusion equation is related to the Wiener process. After this we will go through the Macroscopic derivation, which will give us insight on the importance of the diffusion equation in ecology and biology. Lastly, we will see that the solution of the diffusion equation follows the density of a Wiener process. 4.2.1 Einstein’s derivation This derivation is very interesting from a historical point of view because it is the one that appeared for the first time in 1905 in Albert Einstein’s papers. For mathematical simplicity we consider the one dimensional case. We assume that that the motion is a composition of jumps that can take arbitrary lengths z. Each possible jump is assigned a probability according to a PDF φ(z). If we assume i.i.d jumps, the density of individuals located at x at time t + τ is equal to the density of individuals that were located at a point at distance z at time τ before and jumped to point x after waiting a time τ. Because the jump can be from any point, we must consider all possible distances. Mathematically this means ρ(x, t + τ) = ∞ −∞ ρ(x − z, t)φ(z)dz (4.2) Notice that this equation is discrete in time and continuous in space. The function φ(z) is known in ecology as the dispersal kernel. Equation (4.2) holds only when the population is large enough, otherwise we should take care of possible fluctuations. If we consider τ and z small enough, we can do a Taylor expansion. First for τ ρ(x, t + τ) = ∞ n=0 τn n! ∂n ρ(x, t) ∂tn (4.3) and for z ρ(x − z, t) = ∞ n=0 (−z)n n! ∂n ρ(x, t) ∂xn (4.4) and now we can insert these expressions into equation (4.2): ρ(x, t) + τ ∂ρ(x, t) ∂t + ◦(τ2 ) =ρ(x, t) ∞ −∞ φ(z)dz − ∂ρ(x, t) ∂x ∞ −∞ zφ(z)dz+ + ∂2 ρ(x, t) ∂x2 ∞ −∞ z2 2! φ(z)dz + ◦(z3 ) because φ(z) is a density function, it must be normalised which means ∞ −∞ φ(z)dz = 1. Besides, we can assume isotropic movements, which means that φ(z) = φ(−z). Hence, when n is odd we have ∞ −∞ zn φ(z)dz = 0. With this things in mind we can rewrite the previous equation ρ(x, t) + τ ∂ρ(x, t) ∂t + ◦(τ2 ) = ρ(x, t) + ∂2 ρ(x, t) ∂x2 ∞ −∞ z2 2! φ(z)dz + ◦(z4 ) (4.5)
  • 37.
    CHAPTER 4. BROWNIANMOTION 32 and now simplyfing and dividing by τ ∂ρ ∂t = ∂ρ ∂t ∞ −∞ z2 2τ φ(z)dz + ◦(z4 /τ) (4.6) Finally we take the limit z → 0 and τ → 0, but in such way that z2 /τ is finite. Thus, ∂ρ ∂t = D ∂2 ρ ∂x2 (4.7) where D ≡ 1 2τ ∞ −∞ z2 φ(z)dz = E(z2 ) 2τ (4.8) Equation (4.7) is the well-known the diffusion equation. We will see later that the solution is closely related to the Wiener process. 4.2.2 Langevin’s approach As we mentioned earlier, explaining the Brownian motion by probabilistic means and as a consequence of atomic collisions was revolutionary back in the time of Einstein. One of the earliest models to describe Brownian motion was to suppose that the movement followed a pure Wiener process. That description is quite accurate, however the Wiener process is known for having some mathematical properties that cannot find an easy translation into the fields of Physics. For example, we will see that if the particle starts at x = 0, then the point 0 is an accumulation point, meaning that for every ε there exists infinitely many t ∈ (0, ε) such that x = 0. It is difficult to imagine a real particle moving in this way. One of the big problems about modelling Brownian motion via the Wiener process is that it does not have a well-defined velocity, since the Wiener process is nowhere differentiable and hence v = dW dt is not defined in the ordinary sense. However, in Physics we usually assign the velocity v = dW dt = σξ(t) (4.9) to a particle with a random motion, where σ is a constant and ξ(t) represents white noise. From this we see that the velocity is totally random. Just some months after Einstein’s work, Paul Langevin presented an alternative description to Brownian motion that is still very referenced in the literature. He also considered that the fluctuating velocities observed in the Brownian particles should be due to noisy effects coming from the surrounding particles in the solvent, but he also considered the friction effects on the motion of the particles. So Langevin’s description of Brownian motion reads dv dt = −γv + σξ(t) (4.10) where the term −γv represents a friction force proportional to the particle velocity. Equation (4.15) is usually named Ornstein-Uhlenbeck process since these two researchers provided in 1930 a detailed analysis of its statistical properties. The constant σ measures how large noise fluctuations are. The velocity now is not simply a fluctuating variable but it changes smoothly as a result of the joint effect of fluctuations and the friction force −γv. We can apply now the limit of strong friction m|dv/dt| |γv|. As this suggests, the corresponding persistance introduced in the particle motion is mainly governed by the friction term. In consequence, γ is usually known as the persistence parameter. Under this limit equation (4.10) reads γv = γ dx dt = σξ(t) (4.11)
  • 38.
    CHAPTER 4. BROWNIANMOTION 33 and it can be shown that an equation of the form dx dt = √ 2Dξ(t) (4.12) leads in the macroscopic limit to a Fokker-Planck equation (see Appendix A) identical to the diffusion equation: ∂P ∂t = D ∂2 P ∂x2 (4.13) For both equations to be equal it must happen that D = σ2 2γ2 (4.14) From here it should already be clear the close relationship between diffusion equation and par- ticle moving according to a Wiener process. Now, if we don’t take the assumption that m|dv/dt| |γv| equation (4.10) can be integrated to obtain v(t) = v(0)e−γt + √ 2DW(t) (4.15) So we see that if the particle had an initial velocity, it will decrease until becoming purely random. In the limit t → ∞ we recover the velocity of a particle moving according to the Wiener process. The average position will be given again by integration: E(x(t)) = E(x0) + t 0 E(v)dt = E(x0) + E(v0) 1 − e−γt γ (4.16) and we see that for the limit t → ∞ we have E(x) = E(x0) + E(v0) γ , in comparison with E(x) = E(x0) for the pure Wiener process. 4.2.3 Macroscopic Derivation We consider a population with density ρ(x, t) located at some point x at time t (for example a group of insects, or a drop of ink in water). To describe the movement it is necessary to introduce another dependent quantity, the population flux J(x, t). This quantity is a vector pointing in the direction of movement and indicates the net quantity of particles flowing in that direction per unit time and per unit length (or area or volume). We will assume that the density and flux are smooth functions of space and time. The balance equation states that the rate of change of ρ(x, t) in a volume V closed by a surface Ω is due to the fluxes inward or outward on V through Ω. Writing this in mathematical language we have ∂ ∂t V ρ(x, t)dV = − Ω J(x, t) · ndS (4.17) where n is a unit vector normal to Ω and · is the scalar product. Applying the divergence theorem Ω J(x, t) · ndS = V · J(x, t)dV (4.18) into (4.17) yields V ∂ρ(x, t) ∂t + · J(x, t) dV = 0 (4.19)
  • 39.
    CHAPTER 4. BROWNIANMOTION 34 where is the vector ∂ ∂x , ∂ ∂y , ∂ ∂z . Since the volume of integration V can be arbitrarily small we obtain the continuity equation ∂ρ(x, t) ∂t + · J(x, t) = 0 (4.20) In order to get an equation for the evolution of the population density we need to know how J(x, t) depends on ρ(x, t). We will assume here that the flux J(x, t) is proportional to the spatial population gradient ρ(x, t). This assumption is known as the Fick’s law, which can be written as J(x, t) = −D ρ(x, t) (4.21) The minus sign takes into account that the flux is a vector pointing in the direction where the population density decreases. Writing this last expression in (4.20) we get the diffusion equation ∂ρ ∂t = · (D ρ) (4.22) which in the one-dimensional case it can be written simply as ∂ρ ∂t = D ∂2 ρ ∂x2 (4.23) and is also known as the heat equation. 4.2.4 Solution of the diffusion equation The solution of such equation can be easily given using Fourier transforms. Tranforming (4.23) by Fourier we obtain ∂ˆρ(k, t) ∂t = −Dk2 ˆρ(k, t) (4.24) where we have used the property of the transform of a derivative: dnf(x) dxn = (−ik)n ˆf(k) (4.25) Integrating (4.24) we obtain ˆρ(k, t) = ρ(k, 0)e−Dk2t (4.26) In the simple case we consider that the population density is concentrated in x = x0, then we have the initial condition ρ(x, 0) = δ(x − x0), which implies ˆρ(k, 0) = e−ikx0 . To obtain back the original density function we apply the inverse Fourier transform ρ(x, t) = ∞ −∞ eikx ˆρ(k, t)dk = ∞ −∞ eik(x−x0)−Dk2t dk = 1 √ 4πDt e− (x−x0)2 4Dt (4.27) which is the density function of a Wiener process (Wt, t ≥ 0). From this result we conclude that systems governed by the diffusion equation will behave following a Wiener process. From result (4.27) we can calculate E(x(t)) = ∞ −∞ xρ(x, t)dx = x0 (4.28)
  • 40.
    CHAPTER 4. BROWNIANMOTION 35 and E(x2 (t)) = ∞ −∞ xρ(x, t)dx = x2 0 + 2Dt (4.29) This result indicates that the scaling E(x2 (t)) ∼ t (4.30) holds in the large time limit. This is a fundamental sign of any diffusive transport. We will see this result in more mathematical detail in a following section ‘Quadratic variation’. 4.3 Recurrence of Brownian motion Now we will try to establish a comparison between the Brownian motion properties and those of the random-walk reported in the previous Chapter. Definition 4.3.1. A filtration on a probability space (Ω, F, P) is a family (F(t) : t ≥ 0} for σ-algebras such that F(s) ⊂ F(t) ⊂ F for all s ≤ t. If (Xt : t ≥ 0) is a stochastic process, then {F(t) : t ≥ 0} is the natural filtration for X if F(t) = σ{Xs, s ≤ t}, where σ{X} denotes the smallest σ-algebra under which the random variables Xs, s ≤ t are measurable. Definition 4.3.2. Let X = (Xt, t ≥ 0) be a stochastic process and {F(t) : t ≥ 0} a filtration. We say X is adapted to {F(t) : t ≥ 0} if σ(Xt) ⊂ Ft, ∀t ≥ 0 (4.31) that means that Xt is measurable with respect to Ft. Definition 4.3.3. Let B = (Bt, t ≥ 0) be the Brownian motion and F(t) = σ{Bs, s ≤ t} its corresponding natural filtration. A stochastic process X = (Xt, t ≥ 0) is adapted to Brownian motion if X is adapted to {F(t) : t ≥ 0}. Definition 4.3.4. Let (S, S) be a measure space and X = (Xt, t ≥ 0) a S-valued stochastic process adapted to a filtration {F(t) : t ≥ 0}. We say the process X possesses the Markov property with respect to F(t) if for each A ∈ S and each s, t ∈ T with s ≤ t: P(Xt ∈ A|Fs) = P(Xt ∈ A|Xs) (4.32) A Markov process is a stochastic process that satisfies the Markov property with respect its natural filtration. Remark 4.3.1. Said in simple terms, a Markov process is a process in which a future outcome is only affected by the last outcome, and it doesn’t matter what happened before. For example, we can imagine a fair coin tossing game in which every toss you win or lose 1e and you start with 10e. If I know I have now 15e and want to guess the money I will have after the next toss, only the information that I have 15e can help me predict the future outcome. It does not matter how I came to have those 15e. This example is for the discrete case, but the continuous works the same going to the limit. Definition 4.3.5. We call a Markov process {X(t) > 0 : t ≥ 0} with values in Rd ˆ Point recurrent, if, almost surely, for every x ∈ Rd there is a (random) sequence tn → ∞ such that X(tn) = x for all n ∈ N.
  • 41.
    CHAPTER 4. BROWNIANMOTION 36 ˆ Neighbourhood recurrent, if, almost surely, for every x ∈ Rd and ε > 0, there exists a (random) sequence tn → ∞ such that X(tn) ∈ B(x, ε) for all n ∈ N. ˆ Transient, if it converges to infinity almost surely Before we can prove the Brownian motion recurrence, we will need some understanding on harmonic functions. Especifically, we will have a look at the Dirichlet Problem. This problem raises the following question: given a continuous function ϕ on the boundary of a domain, is there a function u such that u(x) = ϕ(x) in the boundary of the domain and such that u(x) is harmonic inside the domain? That is, we are trying to extend the definition of ϕ in the boundary to a ’nice’ function in the whole domain. Gauss posed this problem in 1840, and he thought he proved there was always a solution, but his reasoning was wrong and Zaremba in 1911 gave counterexamples. However, if the domain is ’nice enough’ (see Poincar´e cone condition below) there is always a solution. The Dirichlet Problem can be solved purely by analytical tools. We will however solve it by probabilistic means. Definition 4.3.6. Let U be a domain, i.e., a connected open set U ⊂ Rd . A function ϕ : U → R is harmonic (on U) if it is twice continuously differentiable and, for any x ∈ U, ∆u(x) := d j=1 ∂2 u ∂x2 j (x) = 0 (4.33) Definition 4.3.7. Let U ⊂ Rd be a domain. We say that U satisfies the Poincar´e cone condition at x ∈ ∂U if there exists a cone V based at x with opening angle α > 0, and h > 0 such that V ∩ B(x, h) ⊂ Uc . Definition 4.3.8. A random variable T with values in [0, ∞], defined on a probability space with filtration (F(t) : t ≥ 0) is called a stopping time with respect to (F(t) : t ≥ 0) if {ω : T(ω) ≤ t} ∈ F(t) for every t ≥ 0. Remark 4.3.2. Speaking intuitively, for T to be a stopping time, it should be possible to decide whether or not {T ≤ t} has occurred on the basis of the knowledge of F(t). Definition 4.3.9. Suppose that X = (Xt : t ≥ 0) is a stochastic process on a probability space (Ω, F, P) with natural filtration {F(t) : t ≥ 0)}. For any t ≥ 0 we can define the sigma algebra F(t+ ) to be the intersection of all Fs for s ≥ t. Then for any stopping time τ on Ω we can define F(τ) = {A ∈ F : {τ = t} ∩ A ∈ F(t+ ), ∀t ≥ 0} (4.34) Then X is said to have the strong Markov property if, for each stopping time τ, conditioned on the event {τ < ∞}, we have that for each t ≥ 0, Xτ+t is independent of F(τ) given Xτ . Theorem 4.3.1 (Dirichlet Problem). Suppose U ∈ Rd is a bounded domain such that every boundary point satisfies the Poincar´e cone condition, and suppose ϕ is a continuous function on ∂U. Let τ(∂U) = inf{t > 0 : B(t) ∈ ∂U}, which is an almost surely finite stopping time. Then the function u : ¯U → R given by u(x) = E(ϕ(B(τ(∂U)))|B(0) = x), for x ∈ U (4.35) is the unique continuous function harmonic on U with u(x) = ϕ(x) for all x ∈ ∂U. Remark 4.3.3. If the Poincar´e cone condition holds at every boundary point, one can simulate the solution of the Dirichlet problem by running many independent Brownian motions, starting in x ∈ U until they hit the boundary of U and letting u(x) be the average of the values of ϕ on the hitting points.
  • 42.
    CHAPTER 4. BROWNIANMOTION 37 With this result in mind, let’s find explicit solutions u : cl A → R of the Dirichlet problem on an annulus A = {x ∈ Rd : r < |x| < R}. The reason to study this case is that the recurrence problem will be a particular case of this solution. It is first reasonable to assume that u is spherically symmetric, i.e. there is a function ψ : [r, R] → R such that u(x) = ψ(|x|2 ). We can express derivatives of u in terms of ψ as ∂iψ(|x|2 ) = ψ (|x|2 )2xi (4.36) ∂iiψ(|x|2 ) = ψ (|x|2 )4x2 i + 2ψ (|x|2 ) (4.37) Therefore, ∆u = 0 means 0 = d i=1 ψ (|x|2 )4x2 i + 2ψ (|x|2 ) = 4|x|2 ψ (|x|2 ) + 2dψ (|x|2 ) Letting y = |x|2 > 0 we can write this as ψ (y) = − d 2y ψ (y) This is solved by every ψ satisfying ψ (y) = Cy−d/2 and thus ∆u = 0 holds on {|x| = 0} for u(x) =    |x| if d = 1 2 log |x| if d = 2 |x|2−d if d = 3 (4.38) We write u(r) for the value of u(x) for all x ∈ ∂B(0, r). Now define stopping times Tr = τ(∂B(0, r)) = inf{t > 0 : |B(t)| = r} for r > 0 (4.39) and denote by T = Tr ∧ TR the first exit time from A. By the Dirichlet Problem Theorem (4.3.1) we have u(x) = E(u(B(T))|B(0) = x) = u(r)P(Tr < TR|B(0) = x) + u(R)(1 − P(Tr < TR)) which can be solved P(Tr < TR|B(0) = x) = u(R) − u(x) u(R) − u(r) (4.40) This formula gives an explicit computation of the probability that the Brownian motion hits ∂B(0, r) before ∂B(0, R). We have just proved the following theorem Theorem 4.3.2. Suppose {B(t) : t ≥ 0} is a Brownian motion in dimension d ≥ 1 started in x ∈ A, which is an open annulus A with radii 0 < r < R < ∞. Then, P(Tr < TR|B(0) = x) =    R − |x| R − r if d = 1 log R − log |x| log R − log r if d = 2 R2−d − |x|2−d R2−d − r2−d if d ≥ 3 (4.41) if we take the limit R → ∞ we get the following corollary
  • 43.
    CHAPTER 4. BROWNIANMOTION 38 Corollary 4.3.1. For any x /∈ B(0, r), we have P(Tr < ∞|B(0) = x) =    1 if d ≤ 2 rd−2 |x|d−2 if d ≥ 3 (4.42) finally, we have enough tools to prove the following theorem Theorem 4.3.3. Brownian motion is ˆ point recurrent in dimension d = 1, ˆ neighbourhood recurrent, but not point recurrent, in d = 2, ˆ transient in dimension d ≥ 3. Proof. ˆ For d = 1 fix x ∈ R. Let’s take B(x + 2, 1) and B(x − 2, 1). Notice that x lies in between these two balls. We know by Corollary (4.3.1) that the stopping time t1 = inf{t > 0 : B(t) ∈ B(x + 2, 1)} is almost surely finite. Also, by the same corollary, the stopping time t2 = inf{t > 0 : B(t) ∈ B(x − 2, 1)} is almost surely finite. Because of the continuity of the Brownian motion there exists a time t such that t1 < t < t2 and B(t) = x. Using the strong Markov property at time t2 + 1 we can repeat the previous argument. In fact, we can repeat this argument as many times as we want, so the Brownian motion in one dimension is recurrent. ˆ For d = 2 fix ε > 0 and x ∈ Rd . By Corollary (4.3.1)the stopping time t1 = inf{t > 0 : B(t) ∈ B(x, ε)} is almost surely finite. Using the Markov property at time t1 + 1 we see that this applies to t2 = {t > t1 + 1 : B(t) ∈ B(x, ε)}, and continuing like this, we obtain a sequence of times tn → ∞ such that, almost surely, B(tn) ∈ B(x, ε) for all n ∈ N and hence is neighbourhood recurrent. ˆ For d = 3 to make notation less cumbersome we use the notation Px(A) := P(A|B(0) = x). We first see that that the probability that the Brownian motion does not go out from a ball is 0, that is Px(|Bt| < R, ∀t ≥ 0) = 0 (4.43) Indeed, if we take the first coordinate, B1 t , of Bt we have Px(|Bt| < R, ∀t ≥ 0) ≤ Px(|B1 t | < R, ∀t ≥ 0) = 0 (4.44) where we have used property 4.3.2. Let x ∈ R3 and n ∈ N such that n3 > |x|. From the previous argument we have that the exit time Tn3 = inf{t > 0 : |Bt| = n3 } < ∞ (4.45) almost surely. That means that if the Brownian motion starts at x then it will get out of the ball of radius n3 with probability one. What we will see next is that for every ω ∈ Ω
  • 44.
    CHAPTER 4. BROWNIANMOTION 39 there exists n(ω) ∈ N such that ∀n ≥ n(ω) we have that Bt(ω) ≥ n for every t ≥ Tn3 (ω). Px(|Bt| < n for some t > Tn3 ) = Ex(1{|Bt|<n for some t>Tn3 }) = Ex(E(1{|Bt|<n for some t>Tn3 }|BTn3 )) = Ex(P(|Bt+Tn3 | < n for some t > 0|BTn3 )) = Ex(PBT n3 (|Bt| < n for some t > 0)) = Ex(PBT n3 (Tn ≤ ∞)) = Ex n |BTn3 | d−2 = Ex n n3 d−2 = 1 n2 d−2 where we have used the strong Markov property in the fourth equality and corollary 4.3.1 in the sixth equality. If we write An = {|Bt| < n for some t > Tn3 } then we have for d ≥ 3 ∞ n=1 P(An) < ∞ (4.46) and thus using Borel Cantelli lemma the events An can happen with probability 1 only a finite number of times. Alternative proof for recurrence in 1D For a one dimensional Brownian motion, there is a faster way to show that it is point recurrent. We think it is interesting to add this section because appart from showing an alternative proof, we see two important properties of the Brownian motion that help us understand it better. Property 4.3.1 (Reflection principle). Let B = (Bt, t ∈ [0, ∞)) be one dimensional Brownian motion and a > 0, then P(max 0≤s≤t Bs > a) = 2P(Bt > a) (4.47) Proof. We will prove this property using heuristic arguments, for a formal proof requires ad- vanced tools not covered in this thesis. We have the following equation P(max 0≤s≤t Bs > a, Bt > a) = P(max 0≤s≤t Bs > a, Bt < a) (4.48) The idea behind it is that if the Brownian motion has reached value a at some time τ < t, then since Bτ ∼ N(0, τ) there is a bijective correspondence between paths with Bt > a and Bt < a. In other words, for every path from τ to t there exists a reflective path with respect the horizontal line y = a that has the same “probability” as such path. Of course the actual probability of any path is 0, hence this argument is only heuristic. See figure ??. Since P(Bs = a) = 0 if we add P(max 0≤s≤t Bs > a, Bt > a) to both sides of equation (4.48) we obtain 2P(max 0≤s≤t Bs > a, Bt > a) = P(max 0≤s≤t Bs > a) (4.49) and noting that {max 0≤s≤t Bs > a, Bt > a} = {Bt > a} we are done.
  • 45.
    CHAPTER 4. BROWNIANMOTION 40 Property 4.3.2. Let B = (Bt, t ∈ [0, ∞)) one dimensional Brownian motion, then P(lim sup t→∞ Bt = +∞) = P(lim inf t→∞ Bt = −∞) = 1 (4.50) Proof. Let a > 0, then using property 4.3.1 P(sup t≥0 Bt > a) ≥ P( sup 0≤s≤t Bs > a) = 2P(Bt > a) = 2P Bt √ t > a √ t = 2 1 − Φ a √ t where Φ is the distribution function of a N(0, 1). 2 1 − Φ a √ t −→ 2(1 − Φ(0)) = 1, as t −→ ∞ (4.51) and P(lim sup t→∞ Bt = ∞) = P( ∞ a=1 {sup t≥0 Bm > a}) = 1 (4.52) And we also obtain P(lim inf t→∞ Bt = −∞) = P(lim sup t→∞ (−Bt) = ∞) = 1 (4.53) because (−Bt, t ∈ [0, ∞)) is a Brownian motion. Corollary 4.3.2. Brownian motion is point recurrent for d = 1. Proof. Let A = {ω : B(ω) does not have infinite zeros}. Suppose P(A) > 0. Then for ω ∈ A there is no sequence tn → ∞ such that Btn (ω) = 0 for all n ∈ N. That means there exists T > 0 such that Bt(ω) = 0 for all t > T. Without loss of generality suppose Bt(ω) > 0 for all t > T, but this implies that lim inf t→∞ Bt(ω) = −∞ since the Brownian motion cannot cross the x-axis, because Brownian motion has continuous paths. Hence P(lim inf t→∞ Bt(ω) = −∞) > 0 which means that P(lim inf t→∞ Bt(ω) = −∞) < 1 in contradiction with property 4.3.2. 4.4 Expected time to reach a specific position We showed in 2.1.1 that the expected time for a random walk to get back to the origin for dimension 1 was infinite. We will now show a similar result for Brownian motion, but in this case we will see that the expected time for the Brownian motion to reach any point is infinite. Theorem 4.4.1. Let a = 0. If inf{t > 0 : Bt = a} exists we define Ta = inf{t > 0 : Bt = a}; if inf{t > 0 : Bt = a} does not exist we define Ta = ∞. Then E(Ta) = ∞, that is, the expected time to reach any point different than 0 for the brownian motion is infinite.
  • 46.
    CHAPTER 4. BROWNIANMOTION 41 Proof. We will show a relation between the density of Ta and Bt and from here deduce that E(Ta) = ∞. Let’s first assume that a > 0, then P(Ta > t) = P(max 0≤s≤t Bt < a} = 1 − P(max 0≤s≤t Bt > a) = 1 − 2P(Bt > a) where in the last step we used property 4.3.1. This implies that P(Ta ≤ t) = 2P(Bt > a) = 2P(Bt ≤ −a) = 2 √ 2π −a/ √ t −∞ e−x2/2 dx (4.54) and Ta < ∞ almost surely, so the density function of Ta is fa(t) = d dt P(Ta ≤ t) = d dt 2P(Bt ≤ −a) = d dt 2P Bt √ t ≤ − a √ t = 2 1 √ 2π d dt − a√ t −∞ e−x2/2 dx = 2 1 √ 2π e−a2 2t a 2 √ t3 = a √ 2πt3 e−a2 2t where we have used that Bt/ √ t ∼ N(0, 1) and the fundamental theorem of calculus. Hence E(Ta) = ∞ 0 tfa(t)dt ∼ ∞ 0 1 √ t e −a 2t dt = ∞ (4.55) The argument applies mutatis mutandi for a < 0. We notice that for a = 0 something does not work, since if we use the density function from theorem 4.4.1 we get fa(t) ≡ 0, which obviously is not a density function. The problem lies that for a Brownian motion that starts at 0, the point 0 is an accumulation point for the zeroes of the Brownian motion, i.e., for every ε > 0 there exists infinitely many t ∈ (0, ε) such that Bt = 0. The following property will support this claim: Property 4.4.1. Let h > 0, then P( max 0≤s≤h Bs > 0) = P( min 0≤s≤h Bs < 0) = 1 (4.56) Proof. Take a > 0, then P( max 0≤s≤h Bs > 0) ≥ P( max 0≤s≤h Bs > a) = 2 1 − Φ a σ √ h → 1 as a → 0
  • 47.
    CHAPTER 4. BROWNIANMOTION 42 where we have used in the second step property 4.3.1. Hence we obtain P( max 0≤s≤h Bs > 0) = 1 (4.57) Finally, if we notice that P( min 0≤s≤h Bs < 0) = P( max 0≤s≤h −Bs > 0) (4.58) we can use the same arguments and get P( min 0≤s≤h Bs < 0) = 1 (4.59) 4.5 Other properties of Brownian motion In this section we will show some interesting properties of the Brownian motion that we will use in the next sections. 4.5.1 Quadratic variation Let πn : 0 = t0 < t1 < · · · < tn = T be a partition on [0, T]. For a smooth function we have the following proposition. Proposition 4.5.1. Let (πn) a sequence of refining partitions with mesh(πn) → 0 on [0, T] and f ∈ C1 . Then n i=1 (f(ti) − f(ti−1))2 → 0, as n → ∞ (4.60) Proof. We can use the mean value theorem, since f ∈ C1 . n i=1 (f(ti) − f(ti−1))2 = n i=1 f(ξi)2 (ti − ti−1)2 ≤ max 0≤i≤n (f(ξi)2 ) n i=1 (ti − ti−1)2 ≤ max 0≤i≤n (f(ξi)2 )mesh(πn) n i=1 (ti − ti−1) = Cmesh(πn)T → 0 where ξi ∈ (ti, ti+1). However, for the Brownian motion we have a different result. Proposition 4.5.2. Let (πn) be a sequence of refining partitions with mesh(πn) → 0 on [0, T] and B = (Bt, t ≥ 0) a Brownian motion. Then Qn = n i=1 (B(ti) − B(ti−1))2 = n i=1 (∆iB)2 L2 −→ T, as n → ∞ (4.61) and thus it converges also in probability.
  • 48.
    CHAPTER 4. BROWNIANMOTION 43 Proof. We want to see that E[(Qn − T)2 ] −→ 0, as n → ∞ (4.62) First thing to notice is that E(Qn) = T. Indeed, since ∆iB ∼ N(0, ti − ti−1) we have E(Qn) = E n i=1 (B(ti) − B(ti−1))2 = n i=1 E(B(ti) − B(ti−1))2 = n i=1 (ti − ti−1) = T (4.63) From here we get the following expression E[(Qn − T)2 ] = E[(Qn − E(Qn))2 ] = V ar(Qn) (4.64) which can be written using the identity V ar(X) = E(X2 ) − E(X)2 and the fact that the increments ∆iB are independent as V ar(Qn) = n i=1 V ar (∆iB)2 = n i=1 E(∆iB)4 − ∆2 i (4.65) where ∆i = ti − ti−1. It is well know that for a N(0, 1) random variable B1, EB4 1 = 3, then E(∆iB)4 = E (∆i)1/2 B1 4 = 3∆2 i (4.66) which implies V ar(Qn) = 2 n i=1 ∆2 i (4.67) thus if mesh(πn) = max i=1,...,n ∆i → 0 (4.68) we obtain that E[(Qn − T)2 ] = V ar(Qn) ≤ 2mesh(πn) n i=1 ∆i = 2Tmesh(πn) → 0 (4.69) 4.5.2 Unbounded variation Proposition 4.5.3. Let B = (Bt, t ≥ 0) be a Brownian motion, then almost surely sup πn n i=1 |∆iB| = +∞ (4.70) that is P ω ∈ Ω : sup πn n i=1 |∆iB(ω)| = +∞ = 1 (4.71) where we take the suprema over all partitions πn of [0, T], where ∆iB = Bti − Bti−1 .
  • 49.
    CHAPTER 4. BROWNIANMOTION 44 Proof. Let A = ω ∈ Ω : sup π n i=1 |∆iB(ω)| < C(ω) < ∞ (4.72) and assume that P(A) > 0 (4.73) and consider a sequence of partitions (πn) such that mesh(πn) → 0. From proposition 4.5.2 Qn = n i=1 (B(ti) − B(ti−1))2 L2 −→ T (4.74) which means that there is a subsequence of partitions, σnk such that Qnk a.s −→ T > 0 (4.75) and thus P ω ∈ Ω : lim k Qnk (ω) = T = 1 (4.76) which implies P ω ∈ Ω : lim k Qnk (ω) = T = 0 (4.77) On the other hand for ω ∈ A we have Qn(ω) = n i=1 (B(ti) − B(ti−1))2 ≤ max i=1,...,n |∆iB(ω)| n i=1 ∆iB ≤ C(ω) max i=1,...,n |∆iB(ω)| → 0 because Bt is continuous and then uniformly continuous on [0, T]. Hence P ω ∈ Ω : lim k Qnk (ω) = 0 = T > 0 (4.78) in contradiction with (4.77).
  • 50.
    Chapter 5 Simulations: BrownianMotion In this section we want to simulate a Brownian Motion. For that, some prior knowledge of numerical integration of stochastic differential equations will be needed. The tools developed in this chapter will let us indeed integrate more complex SDEs than the Brownian motion. 5.1 Numerical integration of stochastic differential equa- tions with Gaussian white noise Let us start with a simple stochastic differential equation: ˙x(t) = f(t) + ξ(t) (5.1) where f(t) is a deterministic function and ξ(t) is a Gaussian white noise, i.e., ξ(t) ∼ N(0, 1). If we integrate we get x(t) = x(0) + t 0 f(s)ds + t 0 ξ(s)ds (5.2) which can be written as x(t) = x(0) + F(t) + B(t) (5.3) where F(t) = t 0 f(s)ds and B(t) is the brownian motion. This expression indicates that x(t) is a Gaussian process whose mean and correlation are given by E(x(t)) = x(0) + F(t) (5.4) E(x(t)x(t )) = [x(0) + F(t)][x(0) + F(t )] + min(t, t ) (5.5) Now we will focus on a numerical solution, rather than solving the equations. Our final aim will be to be able to generate trajectories, that is, we want to obtain x(t) at discrete time intervals x(t + h) = x(t) + t+h t ˙x(s)ds = x(t) + t+h t f(s)ds + t+h t ξ(s)ds (5.6) Introducing fh(t) := t+h t f(s)ds (5.7) and wh(t) := t+h t ξ(s)ds = B(t + h) − B(t) (5.8) 45
  • 51.
    CHAPTER 5. SIMULATIONS:BROWNIAN MOTION 46 we can write x(t + h) = x(t) + fh(t) + wh(t) (5.9) In this equation, as wh(t) is the difference of the Brownian motion at two different times, it is a Gaussian process and can be fully characterized by giving the mean and correlations: E(wh(t)) = t+h t E(ξ(s))ds = 0 E(wh(t)wh(t )) = t+h t t +h t E(ξ(s)ξ(u))dsdu = t+h t t +h t δ(s − u)dsdu To evaluate this integral, we make use of the properties of the Dirac δ function. We can assume, without loss of generality, that t > t. If t > t + h, the integral is 0, as there is no overlap in the integration intervals, and the delta function vanishes. If t ≤ t < t + h, the double integral equals the length of the overlap interval, that is E(wh(t)wh(t )) = t+h t ds = t − t + h (5.10) We are particularly interested for t = t, E(wh(t)2 ) = h (5.11) which is in line with what we proved in Proposition (4.5.2). In numerical calculations, time takes always discrete values as multiples of the integration time step. If we consider discrete times t = ti = ih, t = tj = jh, the correlation becomes E(wh(ti)wh(tj)) = hδij (5.12) We introduce now a set of independent Gaussian random variables {ui} of zero mean and variance 1: E(ui) = 0, E(uiuj) = δij (5.13) in terms of which we can write wh(ti) = √ hui (5.14) Finally, the recurrence relation to generate numerically trajectories of the stochastic process defined by (5.1) is x(t0) = x0 (5.15) x(ti+1) = x(ti) + fh(ti) + √ hui (5.16) For small h, the deterministic contribution fh(t) can be approximated as fh(t) = hf(t), implying that for small h the deterministic contribution is of order h1 and successive contributions go as h2 , h3 , and so on. In contrast the stochastic contribution is of order h1/2 , an order that never appears in methods for numerical integration of ordinary differential equations. A consequence of this scaling with the time step is that at very small times the stochastic contribution, being of order h1/2 , dominates over the deterministic one, of order h. Over the course of an integration for a large period, the stochastic contributions on average will be generally of less importance than the deterministic ones. A Brownian motion can be now easily simulated from equation (5.16). For a Brownian motion that starts at the origin, we have x(t0) = 0. Furthemore, fh(ti) = 0 for all i. We obtain the following simple formula x(t0) = 0 (5.17) x(ti+1) = x(ti) + √ hui (5.18)
  • 52.
    CHAPTER 5. SIMULATIONS:BROWNIAN MOTION 47 Euler-Maruyama method We start with the equation ˙x(t) = q(x) + g(x)ξ(t) (5.19) For additive noise, g(x) does not depends on x, and g(x) = √ D with D being a constant, then the Euler-Maruyama method for stochastic differential equations is given by x(t + h) = x(t) + hq(x(ti)) + √ Dhu(t) + O[h3/2 ] (5.20) As we need Stratonovich calculus to show the derivation of this formula, we will just state it and use it later. 5.1.1 Runge-Kutta-Type methods Equation (5.16) is enough to simulate the pure brownian motion, but in this section we will develop a more advance method for integrating other kind of stochastic differential equations. We start with the equation (5.19) and we would like to develop a method inspired by the Runge-Kutta methods used for numerical integration of ordinary differential equations. There is a large family of Runge-Kutta methods. Here, we focus on one of the simplest methods of this family, known as the Heun method, which is of second order. We start revisiting the deduction of the Heun numerical algorithm for ordinary differential equations and then we extend the ideas to the case of stochastic differential equations. Let’s start considering the ordinary differential equation ˙x(t) = q(t, x) (5.21) where, in general, q(t, x(t)) is a nonlinear function of x(t) which can also depend on the time explicitly. We start by applying the Euler method to integrate this equation: x(ti+1) = x(ti) + hq(ti, x(ti)) + O[h2 ] (5.22) This is an explicit map since the right-hand side depends only on known values of the variable x at previous times, while the unknown variable x(ti+1) is explicitly isolated in the left-hand side. In fact, (5.22) corresponds to the explicit Euler, also called the forward Euler method. There is also an implicit Euler method (also called the backward Euler method) to integrate the same equation, which is given by x(ti+1) = x(ti) + hq(ti+1, x(ti+1)) + O[h2 ] (5.23) The implicit Euler method is more stable than the explicit one but it has the disadvantage that, in general, it is difficult to invert the function q(t, x(ti)) appearing on the right-hand side so that one could get an explicit expression for x(ti+1) as a function of x(ti). Finally, there is a semi-implicit Euler method that combines both approaches and which is of order O[h3 ]. It is given by x(ti+1) = x(ti) + h 2 [q(ti, x(ti)) + hq(ti+1, x(ti+1))] + O[h3 ] (5.24) This method suffers from the same inconvenience as the implicit Euler: the recurrence relation is given by an implicit map. A way to circumvent this inconvenience is to replace x(ti+1) on the right-hand side by the value obtained by using the explicit Euler method (5.22), namely by x(ti) + hq(t, x(ti)): x(ti+1) = x(ti) + h 2 [q(ti, x(ti)) + q(ti+1, x(ti) + hq(t, x(ti)))] + O[h3 ] (5.25)
  • 53.
    CHAPTER 5. SIMULATIONS:BROWNIAN MOTION 48 This is the Heun method that is usually written as k = hq(t, x(ti)) (5.26) x(ti+1) = x(ti) + h 2 [q(ti, x(ti)) + q(ti+1, x(ti) + k)] (5.27) We now apply the same ideas to a stochastic differential equation with white noise (5.19). Let us start with a semi-implicit version of Euler’s method given by (5.20) x(ti+1) = x(ti) + h 2 [q(ti, x(ti)) + q(ti+1, x(ti+1))] + √ hui 2 [q(ti, x(ti)) + q(ti+1, x(ti+1))] (5.28) And now replace x(ti) on the right- hand side by the prediction given by the Euler-Maruyama algorithm (5.20). The resulting algorithm can be written as k = hq(t, x(ti)) (5.29) l = √ huig(t, x(ti)) (5.30) x(ti+1) = x(ti) + h 2 [q(ti, x(ti)) + q(ti+1, x(ti) + k + l)] + √ hui 2 [g(ti, x(ti)) + g(ti+1, x(ti) + k + l)] (5.31) This is known as the stochastic Heun method. Notice that for the pure Brownian motion one has q(t, x(ti)) = 0 and g(t, x(ti)) = 1 which converges to the simple formula (5.18). 1 5.1.2 Simulations In this section we will simulate the Brownian motion and will see how long it takes until it reaches back the value a = 0.1, that is, for which t = 0 we have that Bt = 0.5. The reason why we do not take a = 0 is not arbitrary. In the discrete case for a random walk there was no problem in taking a = 0, but for a Brownian motion some issues arise. The most important is regarding property 4.4.1. Since we know that next to 0 there are infinite points t such that Bt = 0, it doesn’t make a lot of sense to simulate this case. For this reason we have decided to take a = 0, for example a = 0.1. We will gather the results in a histogram. The simulations will be somewhat similar to those for the random walk. However, one big difference to notice, is that Brownian motion is a continuous function while a random walk is a discrete one. Another to notice is that the stopping time Ta has a continuous density, which implies that the probability of every single point is 0. Taking into account these differences, we cannot make histograms for Brownian motion that reaches a point after N steps, because every step is infinitely small (theoretically, although in simulations we will discretize). For this reason counting how many come back after N steps does not make conceptual sense and, therefore, the bins in the histogram will represent a time interval rather than a time point. The following simulation contains 106 different points, calculated according to the formula x(t0) = 0 (5.32) x(ti+1) = x(ti) + √ hui (5.33) 1 These more sophisticated methods were developed in the thesis in order to simulate some more complex stochastic differential equations than the pure Brownian motion. However, because of lack of time and space we decided to give priority to other topics.
  • 54.
    CHAPTER 5. SIMULATIONS:BROWNIAN MOTION 49 A total of 105 simulations were run. For practical reasons, the bins of the histograms represent intervals in log(t) rather than just t. We have also ploted the theoretical density obtained in Theorem 4.4.1 to compare results. First, we need to do a change of variable for the density, because we are plotting the density of Y = g(Ta) = log(Ta) instead of the density of Ta: fY (y) = fa(g−1 (y))|(g−1 ) (y)|1(−∞,∞) = a √ 2πey e− a2 2ey This is the result we obtain: Figure 5.1: Shows the relative number of particles that reached Bt = 0.5 for the first time at time log(t). First thing to notice is that theoretical results and empirical results do not match as perfectly as in the random walk. We observe that for several values the experimental data is lightly large than the predicted value. The reason for this discrepancy is that we plotted the histogram for a fixed number of bins and selected the option ‘normed=True’, that is, the sum of all bins is equal to 1. For a perfect match to the theoretical curve, we should consider every bin from −∞ to ∞. However, we plotted the high probability bins and, appart from those small discrepancies, we observe a quite good match. 5.1.3 Code We will now write a code to plot four different Brownian motion samples, using the equation (5.16). In our case def plotBrownianMotion (h=1, l =1000): x=[] x . append (0) y=[] y . append (0)
  • 55.
    CHAPTER 5. SIMULATIONS:BROWNIAN MOTION 50 z =[] z . append (0) v=[] v . append (0) for i in range (0 , int ( l /h ) ) : x . append (x [ i ]+np . sqrt (h)*np . random . normal ( loc =0.0 , s c a l e =1.0)) plt . plot (x , c=’b ’ ) for i in range (0 , int ( l /h ) ) : y . append (y [ i ]+np . sqrt (h)*np . random . normal ( loc =0.0 , s c a l e =1.0)) plt . plot (y , c=’ r ’ ) for i in range (0 , int ( l /h ) ) : z . append ( z [ i ]+np . sqrt (h)*np . random . normal ( loc =0.0 , s c a l e =1.0)) plt . plot ( z , c=’y ’ ) for i in range (0 , int ( l /h ) ) : v . append (v [ i ]+np . sqrt (h)*np . random . normal ( loc =0.0 , s c a l e =1.0)) plt . plot (v , c=’ g ’ ) plt . show () This will alow us to draw Brownian motion samples. The same code is valid for plotting Brownian motion samples in 2D, only changing plt.plot(x,c=’b’) for plt.plot(x,y,c=’b’) For plotting the histogram 5.1 we have written the following code def simBrownianMotion (h=1, l =10000,N=1000): v=[] for n in range (1 ,N) : #x=numpy . random . normal (0 ,1 ,3) i=0 suma=0 sumaa=0 while (0.5 −sumaa)*(0.5 −suma)>=0 and i<l : sumaa=suma suma=suma+np . sqrt (h)*np . random . normal (0 ,1) i=i+h i f (0.5 −sumaa)*(0.5 −suma)<0: v . append ( i−h) return v t1 = np . arange (−6, 10 , 0.1) plt . plot ( t1 , np . exp ( −0.5**2/(2*np . exp ( t1 )))* 0.5/ np . sqrt (2*math . pi *np . exp ( t1 ) ) ) def freqHistogramBrownian (h=0.01 , l =1000,N=100000): bins=13 X=l i s t (map( log , simBrownianMotion (h , l ,N) ) ) (n , bins , patches ) = plt . h i s t (X, bins =[−5,−4.5,−4,−3.5,−3,−2.5, −2 , −1.5 , −1 , −0.5 ,0 ,0.5 ,1 , 1. 5 , 2 , 2.5 ,3 ,3 .5 , 4 , 4.5 ,5 , 5 . 5 , 6 , 6 . 5 , 7 , 7 . 5 , 8 ] , normed=True ) plt . xlabel ( ’ log ( t ) ’ )
  • 56.
    CHAPTER 5. SIMULATIONS:BROWNIAN MOTION 51 plt . ylabel ( ’ Frequency ’ ) plt . show () 5.1.4 Path samples Running the code above for 1D Brownian motion, we generated the following sample paths. Figure 5.2: Four different samples of 1D Brownian motion, starting at 0. The time steps used are h = 1 and the total length of the Brownian motion is l/h = 1000. And the next plot shows the simulation of two independent 2D Brownian motion starting at 0. Figure 5.3: Two different samples of 2D Brownian motion, starting at (0, 0). 5.2 Dirichlet problem Now we will simulate the Dirichlet problem stated in theorem 4.3.1. Our boundary ∂U will be a square centered in the origin of side l = 10 and our function on the boundary will be f(x, y) = x+y and want to extend it to a harmonic function inside the square. This is a simple
  • 57.
    CHAPTER 5. SIMULATIONS:BROWNIAN MOTION 52 example, and we know that the extension will be u(x, y) = f(x, y) = x + y for all (x, y) ∈ U, so we can verify if the algorithm works. A Brownian motion will start at 0 and will at some point cross the boundary. The average of all the points at which the simulations crosses the boundary will give us the value of f(x, y). In this example we will calculate u(0, 0). Intuitively, we would expect that u(0, 0) = 0, because of the symmetry of this case. For every Brownian motion that crosses the boundary at some point (x, y) we would expect another Brownian motion to cross it at the point (−x, −y), so the average of all this points looks like it should be 0. We will run 105 Brownian motions starting at (x, y) = (0, 0) to compute this point. The result is u(0, 0) = 0.0176. The code we used is the following. 5.2.1 Code def f (x , y ) : return x+y def d i r i c h l e t (h=1, l =10000,N=100000,x=0,y=0): v=[] for n in range (1 ,N) : #x=numpy . random . normal (0 ,1 ,3) i=1 sumax=x sumaax=x sumay=y sumaay=y while (10−sumaax)*(10−sumax)>=0 and (10−sumaay)*(10−sumay)>=0 and (−10−sumaax)*(−10−sumax)>=0 and (−10−sumaay)*(−10−sumay)>=0 and i<l : sumaax=sumax sumax=sumax+np . sqrt (h)*np . random . normal (0 ,1) sumaay=sumay sumay=sumay+np . sqrt (h)*np . random . normal (0 ,1) i=i+1 i f sumax*sumaax<0 or sumay*sumaay<0: v . append ( f (sumax , sumay )) print (sum(v)/ len (v )) return sum(v)/ len (v) We compute a two dimensional Brownian motion in a similar way than the one dimensional case. In every step we compute the two variables x and y as x(t0) = 0 (5.34) y(t0) = 0 (5.35) x(ti+1) = x(ti) + √ hui,1 (5.36) y(ti+1) = y(ti) + √ hui,2 (5.37)
  • 58.
    Chapter 6 Stochastic integrals Inthis chapter we will try to develop an integral for stochastic processes. In particular, we are interested in the integral t 0 f(s)dBs(ω), where (Bt(ω), t ≥ 0) is a given Brownian sample path and f is a deterministic function or the sample path of a stochastic process. This integrals may seem a little too abstract, but they are very useful tools to model different situations. As an example of application, we will see that they are necessary when developing the next chapter: Stochastic calculus in Finance. Our first approach will be the Riemann-Stieltjes integral, but as we will soon see this has a limited use, and another approach will be needed. 6.1 Riemann-Stieltjes integral We will not go into deep detail in this section, as its only purpose is the motivation for our next section where we will build the Itˆo integral. From now let’s consider τn a partition τn : {0 = t0 < t1 < . . . < tn = T} over the interval [0, T] and σn an intermediate partition of τn: σn : ti−1 ≤ yi ≤ ti for i = 1, . . . , n (6.1) and let ∆ig = g(ti) − g(ti−1), i = 1, . . . , n (6.2) Definition 6.1.1. Let f and g two real-valued functions on [0, 1]. The Riemann-Stieltjes sum corresponding to τn and σn is given by Sn = Sn(τn, σn) = n i=1 f(yi)∆ig = n i=1 f(yi)(g(ti) − g(ti−1)) (6.3) Definition 6.1.2. If the limit S = lim n→∞ Sn = lim n→∞ n i=1 f(yi)∆ig (6.4) exists as mesh(πn) = max(|ti − ti−1|, i = 1, . . . , n) → 0 and S is independent of the choice of the partitions σn, then S is called the Riemann-Stieltjes integral of f with respect to g on [0, 1] and we write S = T 0 f(t)dg(t) (6.5) So now we can consider the previous integral for stochastic processes. However, the following theorem shows its limitations. 53
  • 59.
    CHAPTER 6. STOCHASTICINTEGRALS 54 Theorem 6.1.1. Let g(t) be a continuous function on [0, 1] and (πn) a sequence of refining partitions of [0, 1] such that its norm tends to zero, then the Riemann-Stieltjes integral T 0 fdg = lim n ti,ti+1∈πn f(yi)(g(ti) − g(ti−1)) (6.6) exists and is finite for all f ∈ C([0, 1]) ⇐⇒ g has bounded variation. Corollary 6.1.1. Let B = (Bt, t ≥ 0) be a Brownian motion, then ∃f ∈ C([0, 1]) such that T 0 f(t)dBt(ω) does not exist in the Riemann-Stieltjes integral. Proof. We know from proposition 4.5.3 that Brownian motion has unbounded variation. Taking g = B a Brownian motion from theorem 6.1.1 we get that there exists f such that T 0 f(t)dB(ω) is not well defined in the Riemann-Stieltjes sense. Indeed, one does not need uncommon functions f for the previous integral not to exist. For ex- ample, take T 0 Bt(ω)dBt(ω). It can be shown that this integral does not exist in the Riemann- Stieltjes sense. Example 6.1.1. The integral T 0 Bt(ω)dBt(ω) is not well defined in the Riemann-Stieltjes sense. Let (πn) a sequence of refining partitions such that Qn → T almost surely. We know such sequence exist from proposition 4.5.2. Assume the integral is well defined, then the limits lim n n i=1 Bti (ω)(Bti+1 (ω) − Bti (ω)), lim n n i=1 Bti+1(ω)(Bti+1 (ω) − Bti (ω)) (6.7) exist and they are equal, which means that the difference is equal to 0 lim n n i=1 Bti (ω)(Bti+1 (ω) − Bti (ω)) − Bti+1(ω)(Bti+1 (ω) − Bti (ω)) = 0 (6.8) but if one rearranges terms the previous sum becomes 0 = lim n n i=1 (∆iB)2 = lim n Qn(ω) (6.9) and using proposition 4.5.2 one obtains lim n Qn → T (6.10) in contradiction with the fact that Qn(ω) ≡ 0. 6.2 The Itˆo integral for simple processes The previous section served as motivation to show the limitations of the Riemann-Stieltjes integral. At first glance it may seem that it is the most natural definition for stochastic integrals, but we saw that some simple integrals made no sense in the Riemann-Stieltjes sense. For this reason, we will develop more advanced tools.
  • 60.
    CHAPTER 6. STOCHASTICINTEGRALS 55 Definition 6.2.1. The stochastic process C = (Ct, t ∈ [0, T]) is said to be simple if it satisfies the following properties: There exists a partition τn : 0 = t0 < t1 < · · · < tn−1 < tn = T and a sequence (Zi, i = 1, . . . , n) of random variables such that Ct = Zn, if t = T Zi, if ti−1 ≤ t < ti, i = 1, . . . , n The sequence (Zi) is adapted to (Fti−1 , i = 1, . . . , n),i.e., Zi is a ‘function’ of Brownian motion up to time ti−1, and satisfies E(Z2 i ) < ∞ for all i. Definition 6.2.2. Let C = (Ct, t ∈ [0, T) be a simple stochastic process on [0, T], τn : 0 = t0 < t1 < · · · < tn−1 < tn = T a partition and B = (Bt, t ≥ 0) a Brownian motion. The Itˆo stochastic integral of a simple process on [0, T] is given by: T 0 CsdBs := n i=1 Cti−1 (Bti − Bti−1 ) = n i=1 Zi∆iB (6.11) The Itˆo stochastic integral of a simple process on [0, t], for tk−1 ≤ t ≤ tk is given by: t 0 CsdBs := T 0 CsI[0,t](s)dBs = k−1 i=1 Zi∆iB + Zk(Bt − Btk−1) (6.12) 6.3 The general Itˆo integral From now on, we will assume that the process C = (Ct, t ∈ [0, T]) serves as the integrand of the Itˆo stochastic integral and that the following conditions are satisfied: ˆ C is adapted to Brownian motion on [0, T], i.e., Ct only depends on Bs, s ≤ t. ˆ The integral T 0 E(C2 s )ds is finite. Remark 6.3.1. For a process C satisfying the assumptions one can find a sequence (C(n) ) of simple processes such that T 0 E(Cs − C(n) s )2 ds → 0 This means that the processes (C(n) ) converge in a mean square sense to the process C. The fact of (C(n) ) being a simple process means that we can evaluate all Itˆo stochastic integrals It(C(n) ). Furthermore, it can be shown that the sequence It(C(n) ) converges in the mean square sense to an unique limit process, say It(C), i.e., E( sup 0≤t≤T [It(C) − It(C(n) )]2 ) → 0 (6.13) Definition 6.3.1. The mean square limit It(C) is called the Itˆo stochastic integral of C. It is denoted by It(C) = t 0 CsdBs, t ∈ [0, T] (6.14) For a simple process C, the Itˆo stochastic integral has the Riemann-Stieltjes sum representation.
  • 61.
    CHAPTER 6. STOCHASTICINTEGRALS 56 6.4 A simple version of the Itˆo formula Now that we have grasped the notion of the Itˆo stochastic integral for some stochastic processes we will introduce one of the most important formulas in stochastic calculus: the Itˆo formula. This formula is the stochastic counterpart of the classical chain rule. It will be of vital impor- tance when deriving the Black-Scholes formula in the next chapter. Here we will see a simple formulation. Since we need advanced mathematical tools not covered in this thesis to reach the this formula, we will get there using heuristic arguments. Let’s consider a function f ∈ C2 and let dBt = Bt+dt − Bt. We will consider the stochastic process f(Bt). The Taylor expansion of f(t + dt, Bt+dt) yields f(Bt + dBt) − f(Bt) = f (Bt)dBt + 1 2 f (Bt)(dBt)2 + . . . (6.15) In proposition 4.5.2 we showed that the square of small increments of a Brownian motion dB2 t can be interpreted as dt. This is a very important difference with the deterministic case, where the second order of a Taylor expansion is negligible. If we integrate both sides we get t s df(Bx) : = f(Bt) − f(Bs) (6.16) = t s f (Bx)dBx + 1 2 t s f (Bx)dx (6.17) The first integral has to be understood as the Itˆo stochastic integral of f (B) defined in the previous section. The second integral has to be interpreted as the Riemann integral of f (B). Theorem 6.4.1. Let f ∈ C2 . f(Bt) − f(Bs) = t s f (Bx)dBx + 1 2 t s f (Bx)dx (6.18) This formula is known as the Itˆo formula. 6.5 Extension I of the Itˆo formula We now consider a more general case than the simple one, where have f(t, Bt). If f(t, x) has partial derivatives ot at least second order and expanding in series as above one can reach to the following formula Theorem 6.5.1. Let f(t, x) be a function whose second order partial derivatives are continuous. Then f(t, Bt) − f(s, Bs) = (6.19) = t s f1(x, Bx) + 1 2 f22(x, Bx) dx + t s f2(x, Bx)dBx (6.20) where fi = ∂ ∂xi f(x1, x2) x1=t,x2=x , fij = ∂ ∂xi ∂ ∂xj f(x1, x2) x1=t,x2=x (6.21) for i, j = 1, 2.
  • 62.
    CHAPTER 6. STOCHASTICINTEGRALS 57 Example 6.5.1. Consider a geometric Brownian motion Xt, which is given by Xt = f(t, Bt) = X0e(c−1 2 σ2)t+σBt (6.22) where X0 is a random variable independent of the Brownian motion. If we apply formula (6.20) we obtain that Xt satisfies Xt − X0 = c t 0 Xsds + σ t 0 XsdBs (6.23) 6.6 Extension II of the Itˆo formula We now consider a more general case than the I extension, where we have processes f(t, Xt) and Xt is an Itˆo process. The reason why we are introducing these extensions of the Itˆo formula is because we will need to use them in the next chapter. Definition 6.6.1. A stochastic process Xt is called an Itˆo process if there are processes A(1) and A(2) adapted to Brownian motion Bt, and a random variable X0 such that Xt can be written as. Xt = X0 + t 0 A(1) s ds + t 0 A(2) s dBs (6.24) Remark 6.6.1. One can show that the A(1) and A(2) are uniquely determined. Using arguments similar to those used for the simple Itˆo formula one can arrive to the following more general Itˆo formula: Theorem 6.6.1. Let Xt be an Itˆo process and f ∈ C1,2 ([0, ∞) × R). Then f(t, XT ) − f(s, Xs) = (6.25) = t a f1(s, Xs) + A(1) s f2(s, Xs) + 1 2 (A2 s)2 f22(s, Xs) ds + t a A(2) s f2(s, Xs)dBs (6.26) where fi and fij represent the partial derivatives of f. 6.7 Stratonovich integral It is useful to notice that the Itˆo integral is not the only possible integral for stochastic pro- cesses, but rather just a member of a big family. The Itˆo integral has some nice mathematical properties, but the classical chain rule does not apply. Instead, we need to use Itˆo’s formula. For some applications it comes more handy to have an integral for which classical chain rule applies, but the price we have to pay is some of the nice properties that the Itˆo integral has. We start in the case that the integrand process is of the form f(Bt) where (Bt, t ≥ 0) is a Brownian motion and f is a twice differentiable function on [0, T]. Let ˆSn = n i=1 f(Byi )∆iB (6.27) where ∆iB = Bti − Bti−1 , yi = ti−1 + ti 2 , i = 1, . . . , n (6.28) One can show that the Riemann-Stieltjes sums ˆSn exist if mesh(πn) → 0
  • 63.
    CHAPTER 6. STOCHASTICINTEGRALS 58 Definition 6.7.1. The unique mean square limit ST (f(B)) of the Riemann-Stieltjes sums ˆSn exists if T 0 E(f2 (Bt))dt < ∞. This limit is called the Stratonovich stochastic integral of f(B). It is denoted by ST (f(B)) = T 0 f(Bs)ds ◦ dBs (6.29) In the same way as in the Itˆo integral, we can define the stochastic process of the Stratonovich stochastic integrals St(f(B)) = t 0 f(Bs)ds ◦ dBs, t ∈ [0, T] (6.30) as the mean square limit of the corresponding Riemann-Stieltjes sums. To get a feeling of the concept of the Stratonovich integral, it can be useful to find a link between the Itˆo and Stratonovich integrals. We will assume that T 0 E(f2 (Bt))dt < ∞, T 0 E(f 2 (Bt))dt < ∞ (6.31) The first condition is necessary for the definition of the Itˆo and Stratonovich integrals. We first write the following Taylor expansion of first order f(Byi ) = f(Bti−1 ) + f (Bti−1 )(Byi − Bti−1 ) + . . . (6.32) Thus an approximating Riemann-Stieltjes ST (f(B)) sum can be written as follows: n i=1 f(Byi )∆iB = n i=1 f(Bti−1 )∆iB + n i=1 f (Bti−1 )(Byi − Bti−1 )∆iB = n i=1 f(Bti−1 )∆iB + n i=1 f (Bti−1 )(Byi − Bti−1 )2 + n i=1 f (Bti−1 )(Byi − Bti−1 )(Bti − Byi ) = ˆS(1) n + ˆS(2) n + ˆS(3) n By definition of the Itˆo integral ˆS(1) n has mean square limit T 0 f(Bs)dBs. We still have to see what the values of ˆS(2) and ˆS(3) n are. To keep things neat, we will show their values in the following two lemmas Lemma 6.7.1. ˆS(3) n has square limit zero, that is E(| ˆS(3) n |2 ) → 0 Proof. Let’s write E(| ˆS(3) n |2 ) E(| ˆS(3) n |2 ) = n i=1 E[f (Bti−1 )(Byi − Bti−1 )(Bti − Byi )]2 + + 2 i<j E[f (Bti−1 )(Byi − Bti−1 )f (Btj−1 )(Byj − Btj−1 )(Bti − Byi )(Btj − Byj )] = A1 + A2 Now the trick is to use properties of the conditional expectation to show that the second summand A2 is 0: A2 = 2 i<j E[E[f (Bti−1 )(Byi − Bti−1 )f (Btj−1 )(Byj − Btj−1 )(Bti − Byi )(Btj − Byj )|Ftj−1]] = 2 i<j E[f (Bti−1 )(Byi − Bti−1 )f (Btj−1 )(Byj − Btj−1 )E[(Bti − Byi )(Btj − Byj )|Ftj−1]]
  • 64.
    CHAPTER 6. STOCHASTICINTEGRALS 59 and since Bti − Byi and Btj − Byj are independent of Ftj−1 and independent between them E[(Bti − Byi )(Btj − Byj )|Ftj−1] = E[(Bti − Byi )]E[(Btj − Byj )] = 0 (6.33) which means that A2 is 0. Now we will see that A1 tends to zero for refining partitions. To avoid making the proof very technical, we will assume that |f |2 is a bounded by a constant C. A1 ≤ C n i=1 E[(Byi − Bti−1 )(Bti − Byi )]2 = C n i=1 E(Byi − Bti−1 )2 E(Bti − Byi )2 = C n i=1 (yi − ti−1)(ti − yi) = C n i=1 (ti − ti−1)2 4 ≤ C 4 Tmesh(πn) → 0 These computations showed us that ˆS(3) n → 0 (6.34) in the mean square sense. Lemma 6.7.2. ˆS(2) n → 1 2 T 0 f (Bt)dt (6.35) Proof. We want to see that E( ˆS(2) n − 1 2 T 0 f (Bt)dt)2 → 0 (6.36) We will now sum and substract the term 1 2 n i=1 f (Bti−1 )(ti − ti−1). E ˆS(2) n − 1 2 n i=1 f (Bti−1 )(ti − ti−1) + 1 2 n i=1 f (Bti−1 )(ti − ti−1) − 1 2 T 0 f (Bt)dt 2 ≤ 2E ˆS(2) n − 1 2 n i=1 f (Bti−1 )(ti − ti−1) 2 + 2E 1 2 n i=1 f (Bti−1 )(ti − ti−1) − 1 2 T 0 f (Bt)dt 2 = 2a1 + 2a2 If we assume again that f is bounded, we can use the dominated convergence theorem to
  • 65.
    CHAPTER 6. STOCHASTICINTEGRALS 60 exchange the limits in a2 and show that a2 → 0. Now for a1: a1 = E n i=1 f (Bti−1 )(Byi − Bti−1 )2 − 1 2 n i=1 f (Bti−1 )(ti − ti−1) 2 = E n i=1 f (Bti−1 )[(Byi − Bti−1 )2 − (yi − ti−1)] 2 = n i=1 E f (Bti−1 )2 [(Byi − Bti−1 )2 − (yi − ti−1)]2 + + 2E i<j f (Bti )f (Btj )[(Byi+1 − Bti )2 − (yi+1 − ti)][(Byj+1 − Btj )2 − (yj+1 − tj)] where the last summand can be shown to be 0 using conditional expactation with Ftj−1 , then a1 = n i=1 E f (Bti−1 )2 [(Byi − Bti−1 )2 − (yi − ti−1)]2 ≤ C n i=1 E[(Byi − Bti−1 )2 − (yi − ti−1)]2 = C n i=1 Var[(Byi − Bti−1 )2 ] → 0 In the previous chapter, in Proposition 4.5.2, we proved that n i=1 Var[(Byi − Bti−1 )2 ] tends to 0, thus a1 → 0 and therefore ˆS(2) n → 1 2 T 0 f (Bt)dt (6.37) Taking all these things into account we reach the following result: Proposition 6.7.1. Assume the function f satisfies T 0 E(f2 (Bt))dt < ∞, T 0 E(f 2 (Bt))dt < ∞ (6.38) Then the transformation formula holds: T 0 f(Bt) ◦ dBt = T 0 f(Bt)dBt + 1 2 T 0 f (Bt)dt (6.39) 6.8 Stratonovich or Itˆo? There has been much debate on whether one should use Itˆo or Stratonovich integral. There is no ‘right’ choice, both integrals are mathematically correct and the decission on which one to use depends on the application. In this section we will see the most important property of each stochastic integral. Definition 6.8.1. A stochastic process (Xt, t ≥ 0) is called a continuous-time martingale with respect to the filtration (Ft, t ≥ 0), we write (X, (Ft)), if
  • 66.
    CHAPTER 6. STOCHASTICINTEGRALS 61 ˆ E(|Xt|) < ∞ for all t ≥ 0 ˆ X is adapted to (Ft) ˆ E(Xt|Fs) = Xs for all 0 ≤ s < t that is, Xs is the best prediction of Xt given Fs Recall that we say that a process Yt is adapted to a filtration Ft if σ(Yt) ⊂ Ft for all t ≥ 0, i.e., if the random variable Yt does not contain more ‘information’ than Ft. It can be shown that the Brownian motion is a martingale with respect its natural filtration. That means that the best prediction of the value of the Brownian motion at a future point is the value at the present point. The Itˆo stochastich integral also has this important property. Property 6.8.1. The Itˆo stochastic integral It(C) = s 0 CsdBs, t ∈ [0, T], is a martingale with respect to the natural Brownian filtration (Ft, t ∈ [0, T]). This is important because there are many propositions and theorems that apply to martingales, so one can apply many of these tools to the Itˆo integral. In general, in mathematics it is prefered to use the Itˆo stochastic integral because of this nice structure. Now if we take f(t) = g (t) a combination of the Itˆo lemma and the transformation formula (6.39) yields: g(BT ) − g(B0) = T 0 g (Bs)dBs + 1 2 T 0 g (Bs)ds = T 0 f(Bs)dBs + 1 2 T 0 f (Bs)ds = T 0 g (Bs) ◦ dBs This shows that the Stratonovich integral satisfies the classical chain rule of classical calculus. This means that for certain computations the Stratonovich stochastic integral is more handy than the Itˆo stochastic integral. That is the reason why for certain models this integral is prefered, specially in Physics. After all, which stochastic integral to use depends on the system we want to model as we have seen that both integrals make mathematical sense. So the basic problem is not what is the right integral definition, but how do we model real systems by diffusion processes. There are two rough guidelines to choose the best diffusion model for a real system. If the starting point is a phenomenological equation in which some fluctuating parameters are approximated by Gaussian white noise, then the most accurate interpretation is that of Stratonovich. If it however represents the continuous time limit of a discrete time problem, it is better to use the Itˆo interpretation. Ito’s integral is a martingale which is very convenient since martingales have a nice mathematical structure, and there are lots of martingale tools. As for Stratonovich’s integral, it satisfies the same chain rule as in classical calculus, so it might appear more natural, but it is harder to work with due to the lack of martingale structure.
  • 67.
    Chapter 7 Stochastic calculusin Finance In 1973 Black, Scholes and Merton published papers in which they gave a solution to the problem of pricing complex financial derivatives and risky assets such as share price of stocks or options, using stochastic calculus. Since then these methods have been widely accepted and led to a new branch of applied probability theory, the field of economic finance. In this chapter we will see some of these results, which are derived from concepts of some previous chapters discussed in this thesis, specially that of Brownian motion and Stochastic integrals. For example we discussed that Brownian motion, as a physical concept, describes the random movement of particles in a solvent. This model assumes that the price of risky assets depends in part on random fluctuations, very similar to the behaviour of the random movement of a Brownian particle. Before we get started, we will need some basic definitions. Definition 7.0.1. A European call option is a contract that gives the holder the right, but not the obligation, to buy an asset at a specified time T (called maturity date), for a specified price K (called strike price). A European put option is a contract that gives the holder the right, but not the obligation, to sell an asset at a specified time T (called maturity date), for a specified price K (called strike price). The assets can be of very different types: stocks, commodities, foreign exchange and so on. While options can be used in very complex ways in trading strategies, one can think of options as an insurance policy. For example, we can think of a baker who knows how much wheat he is going to need for his business in twelve moths. However, he is scared that because of forecasted bad weather wheat price will be scarce and thus peak in price. He thinks that wheat price now at t = 0 is fair, so he decides to buy a European call option with a strike price K and maturity date T = 12 (time is in months). In that way he knows how much he will be paying for wheat in twelve months and can make better plans. Of course, it can be the case that wheat price actually goes below K and, in that case, he will not exercise the option but rather buy the wheat in the commodity market. Suppose that the price of wheat ST is greater than the strike price K, then the payoff will be ST −K. However, if ST < K then the payoff will be 0, meaning that the contract will expire useless because the baker will buy the commodity directly from the market at a cheaper price. One can think also of a farmer who grows wheat and is worried that wheat prices will decline sharply. Then he could fix the price with a European put option. In general, there are four possible cases: ˆ Buy a call option, known as long call. 62
  • 68.
    CHAPTER 7. STOCHASTICCALCULUS IN FINANCE 63 This is the case we explained with the baker, where the long call served as a means of insurance. In the graph the x-axis represent the underlying asset price at maturity and the y-axis the profit. The graph shows two lines: one for profit and one for payoff. The profit represents the net profit one could obtain if one exercises the option (that is, one buys the asset at the strike price) and immediately sells the asset at a market price. Because we are buying a call option that is giving us a right to buy, we will need to pay a premium. Then it is for sure that at the time we buy the option we will have a loss of the price of the premium. Then as time goes on if the price falls well below the strike price, we are covered by the call option so we would not be losing more money than the premium price. It is worth observing that even though the price of the asset at maturity is greater than the strike price, there is an interval in which we would have negative profits. That is because the premium was too high or the price movement of the asset was not large enough. For example assume that the stock of General Motors is worth today 30e. If I buy a call option for a stock of GM for a price of 2e with strike price of 30e, then it could happen that at maturity the stock is worth 31e. There has been an upward movement on the price of the stock of 1e (31 − 30), and therefore the payoff would be of 1e, but nevertheless the profit would be negative, −1e (31 − 30 − 2), because we have to take into account the premium price. If the price of the stock goes higher than 32e, we would start getting positive profits. One important thing to notice is that there can be in worst case scenario bounded losses (premium price) and in best case scenario unbounded profits. ˆ Sell a call option, known as short call. In the case of a short call we are betting for a downturn in the underlying asset. If the long call can be understood as buying an insurance, the short call can be understood as selling that insurance to someone else. As before, the profit represents the net profit you could obtain if the purchaser of your option exercises it (that is, the purchaser of your option decides to buy you the asset at the strike price) and immediately you buy the same asset at the market price. You sell the call option at time 0 for an instant net profit. However, now you have the obligation of selling the asset if the buyer exercises
  • 69.
    CHAPTER 7. STOCHASTICCALCULUS IN FINANCE 64 the option. If things go as expected, that is, the price of the asset decreases, then you earn the profits of the premium. If the price increases more than the strike price, but not too much, you could still earn a quantity between 0 and the premium. If however the price increases well beyond the strike price, you would lose the premium you obtained at time 0 plus a quantity proportional to the increase on the price of the asset. Selling call options is risky, as losses are unbounded (the price of the asset can theoretically grow without bounds) and possible profits are bounded by the premium. ˆ Buy a put option, known as long put. Recall that put options gives the holder the right to sell at a fixed strike price. As it was the case with selling call options, when you buy a long put you are expecting a downturn for the underlying asset. In these case one can obtain maximum profits when the stock price goes to 0, but will have negative profits if the price doesn’t move a lot or increases. Both profits and losses are bounded, being the maximum loss the premium. ˆ Sell a put option, known as short put. Similar to the long call, we will make money here if the price of the underlying asset increases. At time 0 we will receive the premium of selling the option, but we have the obligation to buy the asset at the strike price if the holder exercises the option. In this case, if the price of the underlying asset drops a lot we will have the obligation to buy the asset at a much higher price, thus incurring losses. Here also profits are bounded (by the premium) and losses are bounded (by the strike price minus the premium). What kind of option is best for a given case? We have seen that there are four general cases for buying and selling options. The first big difference between buying or selling options is that when you buy options (call or put) you are paying a premium for reducing and limiting posible losses. It is similar to paying an insurance, you pay a small fee but you can be sure that you will not lose more money than the premium of the options if the stocks decline sharply. So for a stock holder this derivatives can be quite useful. When you are selling (call or put) options you are selling the right to somebody else,
  • 70.
    CHAPTER 7. STOCHASTICCALCULUS IN FINANCE 65 and they can exercise that right whenever they want. That makes selling options a much riskier choice. There are some strategies that might look similar, but they are not at all. For example if we think the price of an asset is going to increase, we could decide to buy a call option or to sell a put option. In both cases we would make money if the price goes up and lose if it goes down. However, the biggest difference lies in the level of risk we want to assume. We said that buying options limited the losses, so it is always safer. In this case, buying a call option would be the save move. However, to earn money the price of the asset has to increase more than the premium to start getting profits. Selling a put option, on the other hand, gives you a profit of the premium at time 0, and no matter how little the price increases we will get a profit. The price in this case could indeed go down and still get profit. However, if the price decreases a lot there are not lower bounds to cover us and we can lose a lot of money. So we see that a person who thinks that the price of an asset is going to increase could both buy call options or sell put options, the main difference being the level of risk they want to take. Definition 7.0.2. The payoff of an European call option with maturity T and strike price K is (ST − K)+ = max{ST − K, 0} (7.1) The payoff of an European put option with maturity T and strike price K is (K − ST )+ = max{K − ST , 0} (7.2) The natural question arises: how much should the baker pay to buy this contract?. What is the fair price of a European option? This is known as the option pricing problem and Black-Scholes aim to solve it. 7.1 Black-Scholes simple model for option pricing In this model we will make some ideal assumptions that do not hold exactly in real world, but serve as approximations. Our model will have two components: 1. A risky asset (called stock). We will start assuming that the price of a stock is given by a geometric Brownian motion St, St = f(t, Bt) = S0e(µ−0.5σ2)t+σBt (7.3) where Bt is a Brownian motion and S0 is assumed to be independent of Bt. A naive justification of such choice comes as follows. We showed that the geometric Brownian motion (7.3) is solution of the equation St − S0 = µ t 0 Ssds + σ t 0 SsdBs (7.4) which can be written as dSt = cStdt + σStdBt (7.5) and can be interpreted as St+dt − St = cStdt + σStdBt (7.6) or equivalently, St+dt − St St = µdt + σdBt (7.7)
  • 71.
    CHAPTER 7. STOCHASTICCALCULUS IN FINANCE 66 Let’s try to interpret equation (7.7). This tells us that the relative return of a stock is determined firstly by a linear deterministic term µdt and perturbed by an undeterministic term σdBt. The constant µ is called the mean rate of return and σ the volatility. The volatility is a measure of how risky an asset is. The more volatility, the more unexpected fluctuations we would expect to see in the price of an asset. If σ were 0, then the price of the stock would be deterministic. 2. A non-risky asset (called bond), whose returns are deterministic and are determined by compounded interests. For example, a bank account. The price of such asset over time can be modelled as βt = β0ert (7.8) where r is called the risk free rate. This is also an idealization, since interest rates do not usually stay constant in time. Definition 7.1.1. A trading strategy is a portfolio whose value is given by Vt = atSt + btβt (7.9) where at and bt are stochastic processes adapted to Brownian motion. A trading strategy is, widely speaking, a choice of how many shares will one hold of risky and non-risky assets. Notice that at and bt can be negative values also. If at is negative we say that we are short-selling an asset, which means that we sell an asset that we do not have with the promise that we will buy it at later time, expecting that the price of the asset drops. If bt is negative we are borrowing money. We assume that our trading strategy is self-financing. This means that we do not take money in or out from our portfolio, so that the increments in the wealth will come only from the change in prices in the assets St and βt that we hold. Mathematically speaking this means that dVt = d(atSt + btβt) = atdSt + btdβt (7.10) or Vt − V0 = t 0 asdSs + t 0 bsdβs (7.11) Coming back to our initial problem, we will try to give a fair price to a European option. First, a definition: Definition 7.1.2. We say there is an arbitrage oportunity if there exists a riskless strategy of buying and selling assets where one can obtain profits at t = 0 Notice that if an individual could find an arbitrage oportunity in markets, one could obtain potentially unbounded profits. There exists an hypotehsis stating that markets are arbitrage- free or, in other words, nobody is giving money for free. Of course it can be the case that there are some punctual arbitrage oportunities in the market, but they often disappear very fast as eager investors notice them and after selling and buying enough assets an equilibrium situation where no arbitrage exists is reached1 . Black, Scholes and Merton defined such value as follows ˆ An individual can invest the price of an option and manage his portfolio according to a self-financing strategy so as to yield the same payoff (St − K)+ as if the option had be purchased. ˆ If the price of the option were any different from this rational value there would be an aribrtrage situation. 1 However, new research suggests that there exists a ‘memory’ and some long-range correlations in the financial markets, which may cause arbitrage situations. See [6]
  • 72.
    CHAPTER 7. STOCHASTICCALCULUS IN FINANCE 67 7.1.1 A mathematical formulation for the option pricing problem Now that the background of the problem has been explained, we will get into more mathematical development. The general scheme will be as follows: first we will assume that our value process Vt is a smooth function u(t, x). We will apply the Itˆo formula to our value process Vt (which is an Itˆo process) and then we will use the fact that we are using a self-financing strategy (at, bt). We will get two integral identities for Vt − V0. In previous chapters we stated that the coefficients of an Itˆo process are unique, so they must coincide. From this property one can get to a partial differential equation for u(t, x) which, surprisingly, can be explicitly solved. This function u(t, x) will give us the fair value of an option. Let’s suppose we want to find a self-financing strategy (at, bt) and a value process Vt such that Vt = atSt + btβt = u(T − t, St), t ∈ [0, T] (7.12) for some smooth deterministic function u(t, x). This is again another assumption, since we assume that the value of our portfolio depends in a smooth way on t and St. We have the following terminal condition VT = u(0, ST ) = (ST − K)+ (7.13) and this condition is necessary for arbitrage not to exist in our economy. For example, if VT = u(0, ST ) < (ST −K)+ one could sell the portfolio for a value V0 and buy the option for a value V0 whose payoff is (ST −K)+ . The net profit would be in this case +V0 −V0 +(ST −K)+ −VT > 0. The reverse strategy would be valid if VT = u(0, ST ) > (ST − K)+ . Recall that St is a geometric Brownian motion, which in particular means that it satisfies the following equation Xt = X0 + µ t 0 Xsds + σ t 0 XsdBs (7.14) so St is an Itˆo process with A(1) = µX and A(2) = σX. So we can apply the Itˆo formula from theorem 6.6.1 to the process Vt = u(T − t, St). If we write f(t, x) = u(T − t, x) the partial derivatives are f1(t, x) = −u1(T − t, x), f2(t, x) = u2(T − t, x), f22(t, x) = u22(T − t, x) (7.15) and the Itˆo formula yields Vt − V0 = t 0 [−u1(T − s, Ss) + µSsu2(T − s, Xs) + 1 2 σ2 S2 s u22(T − s, Xs)]ds (7.16) + t 0 [σSsu2(T − s, Xs)]dBs (7.17) On the other hand, (at, bt) is self financing so Vt − V0 = t 0 asdSs + s 0 bsdβs (7.18) In order to be able to compare equations (7.17) and (7.18) we must first write (7.18) in the same differentials as (7.17). Recall that βt = β0ert (7.19) and thus dβt = β0rert dt = rβtdt (7.20)
  • 73.
    CHAPTER 7. STOCHASTICCALCULUS IN FINANCE 68 Moreover Vt = atSt + btβt so bt = Vt − atSt βt (7.21) and combining this bsdβs = Vs − asSs βs rβsds (7.22) We can also write dSs in terms of ds and dBs: dSs = µSsds + σSsdBs (7.23) Combining all this we can rewrite 7.18 as Vt − V0 = t 0 as(µSsds + σSsdBs) + t 0 Vs − asSs βs rβsds (7.24) = t 0 [(µ − r)asSs + rVs]ds + t 0 σasSsdBs (7.25) Now we can compare identities 7.17 and 7.25. Because Vt is an Itˆo process its coefficients are uniquely determined and thus at = u2(T − t, St) (µ − r)atSt + ru(T − t, St) = (µ − r)u2(T − t, St)St + ru(T − t, St) = −u1(T − s, Ss) + µSsu2(T − s, Xs) + 1 2 σ2 S2 s u22(T − s, Xs) and finally we can write from this last identity the following PDE u1(t, x) = 1 2 σ2 x2 u22(t, x) + rxu2(t, x) − ru(t, x) (7.26) for x > 0 and t ∈ [0, T] with the deterministic terminal condition u(0, x) = (x − K)+ . The solution can be found explicitly. A full derivation can be found in section 14.5 in the book of Rosario N. Mantegna [6]. Theorem 7.1.1 (Black-Scholes formula). The solution of the PDE 7.26 is u(t, x) = xΦ(g(t, x)) − Ke−rt Φ(h(t, x)) (7.27) where g(t, x) = ln(x/K) + (r + 0.5σ2 )t σt1/2 , h(t, x) = g(t, x) − σt1/2 and Φ(x) = 1 (2π)1/2 x −∞ e−y2/2 dy, x ∈ R (7.28) is the standard normal distribution. Hence the rational price at time t = 0 for a European call option with strike price K is given by V0 = u(T, S0) = S0Φ(g(T, S0)) − KerT Φ(h(T, S0)) (7.29) Equation (7.29) is the celebrated Black-Scholes option pricing formula.
  • 74.
    CHAPTER 7. STOCHASTICCALCULUS IN FINANCE 69 Remark 7.1.1. The stochastic process Vt = u(T − t, St) is the value of the self-financing portfolio at time t ∈ [0, T] and the self-financing strategy (at, bt) is given by at = u2(T − t, St), bt = u(T − t, St) − atSt βt (7.30) Formula 7.29 is the most used formula for pricing options in finance. Part of its success comes from the fact that it admits an explicit solution, which is quite rare when solving PDEs. Let’s give an example of why is this formula so important. Imagine that the price of the option at time t = 0 is p, with p = V0. Suppose that p > V0, then one could do the following strategy: ˆ Sell the option to someone else for a price of p. You gain p at t = 0 ˆ Invest V0 to buy a0 in stock and b0 in bonds, where a0 and b0 are given by (7.30). You pay V0 at t = 0. Following this strategy it is immediate to see that you obtain a net profit of p−V0 at t = 0. But what’s interesting is that this profit remains unchanged at at maturity date T, no matter how the stocks will move. Indeed, at T the value of our portfolio will be VT = u(0, ST ) = (ST −K)+ and we will have the obligation to pay (ST − K)+ to the buyer of our option. That means that at T we will have had a cash flow equal to p − V0 + (ST − K)+ − (ST − K)+ for a net profit of p − V0 > 0. We could increase the scale arbitrarily, selling n options for np and investing nV0 in stocks and bonds for a net profit of n(p − V0), so we could obtain instantaneous and unbounded profits. Remark 7.1.2. Throughout the derivation we have implicitly or explicitly used a set of as- sumptions. Let’s list them all here: i) The stock price is an Itˆo process ii) Security trading is continuous iii) There are no arbitrage oportunities iv) Selling of securities is possible at any time v) There are no transaction costs vi) The market interest rate r is constant vii) There are no dividends between t = 0 and t = T Provided that these assumptions hold, Black-Scholes formula gives the fair price of an option, meaning that if an option is valued at a different price there exists an arbitrage opportunity. 7.1.2 Graphical representations of the Black-Scholes formula We will see now some graphical representation for the price of an option. The following plots have been obtained from the website [13]
  • 75.
    CHAPTER 7. STOCHASTICCALCULUS IN FINANCE 70 Figure 7.1: Option price vs stock price. E is the strike price, r the risk free rate, σ the volatilty and T − t the maturity date The first thing we observe in this graph is that it is an increasing function. That makes perfect sense, the more expensive is the asset the greater can be the downturns and thus the more one should pay to cover those losses. We observe that the value of the option is almost identically 0 for values smaller than 15. The reason for this is that the maturity date and volatility are small (and thus we don’t expect a huge drop in price in a short time interval). We see that if the stock price is worth 30 and the strike price is 30, the rational price to buy a call option is around 5. If we accept such deal, we would want that the stock price goes above 35 in the next 1 unit time, what would bring us profits. We see now what happens in the limits as T − t → ∞ or σ → ∞. We represent now the graph T − t → ∞ but the same plot is obtained when σ → ∞. Figure 7.2: Option price vs stock price. E is the strike price, r the risk free rate, σ the volatilty and T − t the maturity date We observe that the graph has become a line. Indeed, it is the identity function and it doesn’t
  • 76.
    CHAPTER 7. STOCHASTICCALCULUS IN FINANCE 71 seem that the strike price affects the values. The fact that it is the identity function means that it is the same to buy the call option than to buy the stock itself, buying options is no longer of any use. If we think about it, it makes sense. As maturity date goes to infinity, there is plenty time and ‘anything’ could happen. Because the stock follows a random movement, there is no likely prediction on what the value of the price might be, and that huge uncertainty is reflected in the price of the option. The same argument is valid if the volatility is infinite, in this scenario movements in price will be so sharp that they could take virtually any (positive) value even in a short period of time.
  • 77.
  • 78.
    Appendix A Fokker-Planck equation TheFokker–Planck equation is a partial differential equation that describes the time evolution of the probability density function of the velocity of a particle under the influence of drag forces and random forces. Let’s start with the evolution equation for a stochastic process x(t) dx dt = q(x, t) + g(x, t)ξ(t) (A.1) where q(x, t), g(x, t) are some deterministic functions and ξ(t) is white noise. So the process has some deterministic function and has a random fluctuating component, described by g(x, t). Because of this random component, one cannnot reach a deterministic solution. However, one can instead define a function P(x, t) which gives us the probability that the solution x(t) of the SDE at time t has the value x, averaged over all the possible realizations of the noise. One can arrive to the formula ∂P(x, t) ∂t = − ∂ ∂x [q(x, t)P(x, t)] + D 2 ∂ ∂x g(x(t), t)[g(x(t), t)P(x, t)] (A.2) For a Brownian motion one has q(x, t) = 0 and g(x, t) = √ 2D, so the Fokker-Planck equation reads ∂P ∂t = D ∂2 P ∂x2 (A.3) which is the diffusion equation. 73
  • 79.
    Appendix B Results anddefinitions in Probability Theorem B.0.1 (Chebyshev inequality). P(|X − EX|) ≥ ε) ≤ V (X) ε2 (B.1) B.1 Conditional expectation Definition B.1.1. Let (Ω, F, P) be a probability space and G ⊂ F a σ-algebra. Let X be a random variable with E(|X|) < ∞. We say that the random variable E(X|G) is the conditional expectation of X given G if E(X|G) is G-measurable and A E(X|G)dP = A XdP ∀A ∈ G (B.2) If X is a random variable F−measurable and G ⊂ F, then E[X|G] is a G−measurable ran- dom variable and it is the best estimation of X that is G−measurable. The existance of the conditional expectation can be shown using the Theorem of Radon-Nikodym. There are some properties that we will use: Property B.1.1. By definition, E(X) = E(E(X|G)) for G a σ−algebra Property B.1.2. If X is F−measurable, E(XY ) < ∞ and E(Y ) < ∞ then E(XY |G) = XE(Y |G) (B.3) Property B.1.3. If X is independent of G and E(X) < ∞, then E(X|G) = E(X) (B.4) 74
  • 80.
    Bibliography [1] Bardina, Xavier.Caminant a l’atzar tots els camins porten a Roma. Revista Electr`onica de Divulgaci´o Matem`atica Editada por el Departament de Matem`atiques de la Universitat Aut`onoma de Barcelona, 2008. [2] Billingsley, Patrick. Convergence of Probability Measures. New York: Wiley, 1999. [3] G´ora, Pawel F. The theory of Brownian Motion: A Hundred’s Year Anniversary. Marian Smoluchowski Institute of Physics. Jagellonian University, Cracow, Poland. [4] Ioannis Karatzas. Brownian Motion and Stochastic Calculus. New York: Springer, cop. 1991 [5] Jolis, Maria. Apuntes de Probabilidad. Universitat Aut`onoma de Barcelona. [6] Mantegna, Rosario N. and Stanley, H. Eugene. An introduction to Econophysics. Correla- tions and Complexity in Finance. Cambridge University Press. [7] M´endez, Vicen¸c; Campos, Daniel and Bartumeus Frederic. Stochastic Foundations in Move- ment Ecology. Springer. [8] Mikosch, Thomas. Elementary Stochastic Calculus with Finance in view. World scientific. [9] M¨orters, Peter and Peres, Yuval. Brownian motion. Cambridge University Press. [10] Samaniego Vidal, Daniel. Moviment Browni`a. Project from the course ‘Tend`encies Actuals de les Matm`atiques’. [11] S. Lemons, Don. An Introduction to Stochastic Processes in Physics. The Johns Hopkins University Press Baltimore and London. [12] Toral, Ra´ul and Colet, Pere. Stochastic Numerical Methods: An Introduction for Students and Scientists. Wiley-VCH. [13] http://socr.ucla.edu/htmls/HTML5/econ apps/BlackScholesPlot/BlackScholesPlot.html [14] https://en.wikipedia.org/wiki/Put option [15] https://en.wikipedia.org/wiki/Call option [16] http://introcs.cs.princeton.edu/java/15inout/RandomWalk.java.html 75