Stochastic - Lecture Notes
Stochastic - Lecture Notes
Stochastic - Lecture Notes
Byron Schmuland
I returned, and saw under the sun, that the race is not to the swift, nor
the battle to the strong, neither yet bread to the wise, nor yet riches to
men of understanding, nor yet favour to men of skill; but time and chance
happeneth to them all. Ecclesiastes 9:11.
Contents
3 Optimal Stopping 39
A Strategies for winning . . . . . . . . . . . . . . . . . . . . . 39
B Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
C Algorithm to find optimal strategy . . . . . . . . . . . . . . 49
D Two variations . . . . . . . . . . . . . . . . . . . . . . . . . 50
E The binomial pricing model . . . . . . . . . . . . . . . . . . 51
4 Martingales 57
A Conditional Expectation . . . . . . . . . . . . . . . . . . . . 57
B Martingales . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
C Optional sampling theorem . . . . . . . . . . . . . . . . . . 65
D Martingale convergence theorem . . . . . . . . . . . . . . . 70
6 Brownian motion 79
A Basic properties . . . . . . . . . . . . . . . . . . . . . . . . . 79
B The reflection principle . . . . . . . . . . . . . . . . . . . . 81
C The Dirichlet problem . . . . . . . . . . . . . . . . . . . . . 83
7 Stochastic integration 88
A Integration with respect to random walk . . . . . . . . . . . 88
B Integration with respect to Brownian motion . . . . . . . . 89
C Ito’s formula . . . . . . . . . . . . . . . . . . . . . . . . . . 91
8 Appendix 94
A Strong Markov property . . . . . . . . . . . . . . . . . . . . 94
B Matrix magic . . . . . . . . . . . . . . . . . . . . . . . . . . 99
C The algorithm from section 3C . . . . . . . . . . . . . . . . 101
1 FINITE MARKOV CHAINS 1
A Basic definitions
Let (Xn )∞
n=0 be a stochastic process taking values in a state space S that
has N states. To understand the behaviour of this process we will need to
calculate probabilities like
P(X0 = i0 , X1 = i1 , . . . , Xn = in ).
P(X0 = R, X1 = R, X2 = B)
P(X0 = R, X1 = R, X2 = B)
Definition A-1 The process (Xn )∞ n=0 is called a Markov chain if, for any
n and any collection of states i0 , i1 , . . . , in+1 we have
For a Markov chain the future depends only on the current state and not
on past history.
From now on, we will assume that all our Markov chains are time homoge-
neous. The probabilities for a Markov chain are computed using the initial
probabilities φ0 (i) = P(X0 = i) and the transition probabilities p(i, j):
Intuitively, this says that a Markov chain run until time n + m is the same
as the chain stopped at time n, then started anew with initial state Xn and
run for the remaining m time periods.
1 FINITE MARKOV CHAINS 3
Definition A-3 The transition matrix for the Markov chain (Xn )∞
n=0 is
the N × N matrix P whose (i, j)th entry is p(i, j).
B R
² ³
B 1/2 1/2
P =
R 1/2 1/2
P
Every transition matrix satisfies 0 ≤ p(i, j) ≤ 1 and j∈S p(i, j) = 1. Such
matrices are also called stochastic.
vowel consonant
² ³
vowel .128 .872
P =
consonant .663 .337
The state space is S = f0, 1, . . . , Ng, and at each time the walker jumps to
the right with probability p, or to the left with probability 1 − p.
1 1−p p 1
....... .. ....... ..
..... . ........... ...... ..........
..................................... ............ .......................... .................................... .......................................
...... .. ..... ...... ..... ........... .. ..... ...... .....
..... .... ..... .... ... .... ..... ....
.... .... . ....
• • ...
• • ...
• ...
• • ...
Proportion of type A
1.0 ..............................................................................................................................................
...
......... ............
......... .... .......
............
.. .. ..
... .....
..... .......
......
. ..
.
...
...
........
. ... ... ....
. ........ ... ..... .....
......
. . .. ... ..........
.
.. ... .. ...
. .
.
.
.
. . .. . .. .
... ... ...... ... .. ... ..
... .... ..... ... .... ... .. ...........
... .. .. ..... .. .. ............. ..
..
.
...
.
. .. ............... .... ........
.
. .
............ .
... .. ..
.
.... ... .. .... ... .. ... .......... ............ . .
..
... ..... ... ..... ... .... .. . ... ..... .......
.
... .. ............... ........ .... .........
... ..... ... ..... ... .. .. ... . .......... ..... .............. ... ..... ... .. ..... ...
... ... .... .... .. .. ..... ........ ............ ............. . .. ... .... ..... ..... .. ... .. ... ..
.. . . ... .... .... .........
. ................................
. ... .. .
.. . . . . ... .... ....... .... .......... .... ....
.
0.5 . ...... ..
........................... .. ......
.... ... ... ..
... ...
.
.
..... ..
. .
... ........
.
...
.
....... .. .............
.......... ...
.....
. ....
. .
... .. .. ..
... .. ...
....
.. . . .
...
.
... .
........
.
. . .
... ..... .... ....
.. .....
.
...... ..
.....
.
...
... ... . .
.. ................ ....... ....
... .... ..
..... ........ . .
.... .
. ...
. .... .... .. ..
... .. .....
... ..... .. .......... ... . ... ......
... .. ..... .... ....... ............ ........... ... . ...... ....
.... ... ..
... ........... ... ...... . ..... .. .. . ...
... ...
... .... .....
...
. ...... .... .... .....
. ......
.
. .
.. ...
... ... ... . ... ... ... .... .
..... . ....... .... . .............
.
........ .
. .. .
.. ... .. . .
..
....
. ... .. ...
..... ... ......... .. ...... .... .... .... . ... ... .
... ... ...... ......... ...
... ..
... ...
... ...
.....
0.0
0 100
1 FINITE MARKOV CHAINS 5
Here are some pictures of the first 500 steps of a gambler playing red-
black on a roulette wheel. The symmetric walk (p = 1/2) is the idealized
situation of a fair game, while the walk with drift (p = 9/19) shows the
real situation where the casino takes advantage of the green spots on the
wheel.
...
. .... .. .....
....... ... ...... .......
........... ............. ..... .............
30 ........ ...........
.
. .. .... . .. .
.
... .... . ... . . ..... .. .
.
. . .. ....
.
.. ............ . ... ........................ ........ ............. .......................................... ............................ ............................. .............. .............. ............ .... ....... ..........
.. .
.
.
................ ...... ......... . ........... . .... . .................................... ................. ......... ... ... ...... ... ............. ... . . ..
..... ....... .... . ... ...........................................
.
. .. .. .. ..........
... .... ....... .. .. .. ................... ...................................................
.. .. ..... ......... ........ .................. .. ....... .. ....
..... ..... ....... ....... ............... ....
............ . .... ... ................ .. . ................. .. ................ ....... ......
....... . ........................................ .... ..... . ... ... .. .......
...... . .. ...... ..... ....
10 ..... .
. .
..............
.
... .
.
.......
.....
.
......
−30
0 100 200 300 400 500
−80
0 100 200 300 400 500
The central limit theorem can help us understand the result after 500 plays
of the game. In the symmetric case, it is a tossup whether you are ahead
1 FINITE MARKOV CHAINS 6
-26.31 0
B Calculating probabilities
Consider a two state Markov chain with p = 1/4 and q = 1/6 so that
0 1
² ³
0 3/4 1/4
P = .
1 1/6 5/6
To find the probability that the process follows a certain path, you multiply
the initial probability with conditional probabilities. For example, what is
the chance that the process begins with 01010?
As a second example, let’s find the chance that the process begins with
00000.
1
P0 (X1 = 1, X2 = 0, X3 = 1, X4 = 0) = . (1)
576
81
P0 (X1 = 0, X2 = 0, X3 = 0, X4 = 0) = . (2)
256
Theorem B-1 The conditional probability Pi (Xn = j) is the (i, j)th entry
in the matrix P n .
3245
so that P0 (X4 = 0) = 6912
= .46947.
C Invariant Probabilities
Example C-1 Let’s find invariant probability vectors for some Markov
chains.
² ³
0 1
(a) Suppose that P = . An invariant probability vector π =
1 0
(π1 , π2 ) must satisfy
² ³
0 1
(π1 , π2 ) = (π1 , π2 ) ,
1 0
1 FINITE MARKOV CHAINS 9
or, multiplying the right hand side, (π1 , π2 ) = (π2 , π1 ). This equation gives
us π1 = π2 , and since π1 + π2 = 1, we conclude that π1 = 1/2 and π2 = 1/2.
The unique invariant probability vector for P is π = (1/2, 1/2).
² ³
1 0
(b) If P = is the identity matrix, then any probability vector
0 1
satisfies π = πP .
² ³
1−p p
Let’s investigate the general 2 × 2 matrix P = . It has
q 1−q
eigenvalues 1 and 1 − (p + q). If p + q > 0, then P can be diagonalized as
P = QDQ−1 , where
q p
p+q p+q
² ³ ² ³
1 −p 1 0
Q= , D= , Q−1 = .
1 q 0 1 − (p + q) −1 1
p+q p+q
Using these matrices, it is easy to find powers of the matrix P . For example
P 2 = (QDQ−1 )(QDQ−1 ) = QD2 Q−1 . In the same way, for every n ≥ 1 we
1 FINITE MARKOV CHAINS 10
have
P n = QDn Q−1
² n ³
1 0
= Q Q−1
0 (1 − (p + q))n
q
p p −p
p+q p+q np+q p+q
= 1n q p + (1 − (p + q)) −q .
q
p+q p+q p+q p+q
The next result is valid for any Markov chain, ergodic or not.
Proof: We assume the convergence result and prove the second state-
ment. Note that any vector π that is a convex combination of rows of M
can be written π = vM for some probability vector v.
This is the expected value of the random variable representing the average
number of visits the Markov chain makes to state j during the first n time
periods. A law of large numbers type result will be used to show why this
average converges.
Let Tj be the hitting time of the state j. There are two possibilities for
the
Psequence 1(Xk =j) : if Tj = ∞, then it is just a sequence of zeros, and
1 n
n k=1 (Xk =j) = 0. On the other hand, if Tj < ∞, then the history of the
1
process up to Tj is irrelevant and we may just as well start counting visits
to j from time Tj . This leads to the equation
A more rigorous proof of this important formula can be found in the ap-
pendix.
Putting i = j above, we discover that if Pj (Tj < ∞) < 1, then mjj = 0.
Thus mij = 0 for all i ∈ S and hence πj = 0 for any invariant probability
vector π.
Now assume that Pj (Tj < ∞) = 1; in this case Ej (Tj ) < ∞ (see Theorem
A-3 in the appendix). The following sample path shows the first n + 1
values of the sequence 1(Xk =j) , where we assume that the (` + 1)th visit to
state j occurs at time n. The random variable Tjs is defined as the time
between the (s − 1)th and sth visit. These are independent, identically
distributed random variables with the same distribution as Tj .
nth trial
↓
{z } 00000000000001
1 |00001 | {z | {z } · · · 000001
} 00000001 | {z } · · ·
1 2 3
Tj Tj Tj T `j
Pn
We conclude that (1/n) k=1 P k → M , where mij = Pi (Tj < ∞)/Ej (Tj ).
Example C-2 (a) The rat. Suppose that a rat wanders aimlessly
through the maze pictured below. If the rat always chooses one of the
available doors at random, regardless of what’s happened in the past, then
Xn = the rat’s position at time n, defines a Markov chain.
1 2
3 4
(b) Random walk. Here is an example from the final exam in 2004.
α 1/2 1/2 α
........ ........ ........ .
.
........................................
.. .........
....................................... ...... ...................................... .........................................
...... ... ..... ..... ..... .......... ... ..... ...... .....
..... ... .... .... ... ..... ...
... ... ...
• • ...
• • ...
• ...
• • ...
2απ0 = π1
π1 − 2απ0 = π2 − π1
πj − πj−1 = πj+1 − πj , for j = 2, . . . , N − 2
πN −1 − 2απN = πN −2 − πN −1
2απN = πN −1 .
1 FINITE MARKOV CHAINS 15
Adding the first two equations shows that π2 = π1 , and then the middle set
of equations implies that π1 = Pπ2 = π3 = · · · = πN −1 . If α > 0, then both
π0 and πN equal π1 /2α. From N j=0 πj = 1, we get the unique solution
1 α
π0 = πN = , πj = , j = 1, . . . , N − 1.
2((N − 1)α + 1) (N − 1)α + 1
(c) Google search engine. One of the primary reasons why Google is
such an effective search engine is the PageRank algorithm developed by
Google’s founders, Larry Page and Sergey Brin, when they were graduate
students at Stanford. An explanation of PageRank is available at
http : //en.wikipedia.org/wiki/PageRank
Imagine surfing the Web, randomly choosing an outgoing link from one page
to get to the next. This can lead to dead ends at pages with no outgoing
links, or cycles around cliques of interconnected pages. So, with small
probability p, the next step is to simply choose a random page anywhere
on the whole Web. This theoretical random walk of the Web is a Markov
chain. The limiting probability that a random surfer visits any particular
page is its PageRank. A page has high rank if it has links to and from
other pages with high rank.
To illustrate, imagine a miniature Web consisting of six pages labelled A
to F , connected as below.
.................. ..................
..... ... ..... ...
... ... ... ...
..... .....
...
.....
D ... ......
.
...............
...
.
. .
E .....
...
.
............... ........................ . . . . . . . .
... .................. .
.. . ..
......... ....... .. . . . .. . ..
... ....... ....... ...
..... ....... .... . ...
... ..... ....... ..... ...
.....
..... ....... .....
...
.....
..... .......
.. .
..
...... ...
...
..... ..... .... ...
... ............ ........ .............. ......... .
..
. ...
... . . ... ....... ........ ............. ...
... ..... ...
... .... ................................... . ..
...
...
....
..
B ...
...
...... .
.
.
. .. .
. .. . .
.. ..
................. ......
C .
....
... ...
...
... . .
.. .
. ..... .. . .. ...
..
.
......... ..... ...
.. ................. ......... ..
......... . .
...... ...
... ...
... . ... ........ ..
. ...
... ....... ..
. ........ .....
.. ...
........ .... ....... ..... .
........ ..... .. .
. . . ..... ... . ....... .
. ...........
.
.. ... ................ ....................
. .
.
. ..... ............ ....... ............ ....
.... ..... ........ ....
.. ..... ... ...
..... .................................................................................................................................................... ...
...
......
A . ....
.
.. ...
...
....... .......
F .. ...
.
................ ........
1 FINITE MARKOV CHAINS 16
A B C D E F
0
A 1 1 0 0 0
B
0 0 1 1 0 0
C0 0 0 1 1 1
G=
D1 0 0 0 0 0
E0 0 0 0 0 1
F 1 0 0 0 0 0
P
The transition probabilities are pij = (1 − p)gij / k gik + p/n. With n = 6
and p = .15, we get
1 18 18 1 1 1
1 1 18 18 1 1
1 1
1 1 37/3 37/3 37/3
P =
40
35 1 1 1 1 1
1 1 1 1 1 35
35 1 1 1 1 1
D Classification of states
Note. Let Rjs be the time of the sth return to state j, so Rj1 = Tj1 = Tj .
We have Pj (Rjs < ∞) = Pj (Tj < ∞)Pj (Rjs−1 < ∞), and by induction we
1 FINITE MARKOV CHAINS 17
prove that Pj (Rjs < ∞) = [Pj (Tj < ∞)]s . Letting s → ∞, we obtain
º
¢ s
£ 0 if j is transient
Pj (visit j infinitely often) = Pj ∩s (Rj < ∞) = .
1 if j is recurrent
The probability of infinitely many visits to state j is either zero or one,
according as the state j is transient or recurrent.
Theorem D-1 If i and j communicate, they are either both null or both
positive.
Proof: If i is null, then mii = 0 and the equation mji = Pj (Ti < ∞) mii
shows that mji = 0 for all j ∈ S. The jth row of the matrix M is invariant
for P , and hence for any power of P , so that
X
0 = mji = mjk pnki ≥ mjj pnji .
k∈S
All states within each communicating class are of the same type, so we will
speak of null or positive classes.
Lemma D-1 If j is recurrent and Pj (Ti < ∞) > 0, then Pi (Tj < ∞) = 1.
In particular, j communicates with i, which means you cannot escape a
recurrent class.
Pj (Ti < ∞) = Pj (Ti < ∞, T < ∞) = Pj (Ti < ∞)Pi (Tj < ∞).
The first equation is true because, starting at j, the process hits j at arbi-
trarily large times. The second equation comes from applying the strong
Markov property at time Ti . If Pj (Ti < ∞) > 0, then we can divide it out
to obtain Pi (Tj < ∞) = 1. u
t
Proof: If j is transient, the equation mjj = Pj (Tj < ∞)mjj shows that
mjj = 0.
Each recurrent class R` forms a little Markov chain with transition matrix
1 FINITE MARKOV CHAINS 19
If i and j are in the same recurrent class R` , then Lemma D-1 shows that
Pi (Tj < ∞) = 1 and so mij = mjj . That is, the rows of M` are identical
and give the unique invariant probability vector for P` .
Example D-1
² ³
0 1
(a) If P = , then there is only the one recurrent class R1 =
1 0
f0, 1g. The invariant probability must be unique and have strictly positive
entries.
² ³
1 0
(b) If P = , then there are two recurrent classes R1 = f0g
0 1
and R2 = f1g. The invariant measures are π = a(1, 0) + (1 − a)(0, 1) for
0 ≤ a ≤ 1. That is, all probability vectors!
The classes are R1 = f0, 1g, R2 = f2, 3g, and T1 = f4g. The invariant
measures are π = a(1/4, 3/4, 0, 0, 0) + (1 − a)(0, 0, 2/5, 3/5, 0) for 0 ≤ a ≤ 1.
None of these puts mass on the transient state.
π = a(1, 0, 0 . . . , 0, 0) + (1 − a)(0, 0, . . . , 0, 1)
= (a, 0, 0 . . . , 0, 1 − a) for 0 ≤ a ≤ 1.
E Hitting times
Partition the state space S into two pieces D and E. We suppose that for
every starting point in D it is possible to reach the set E. We are interested
in the first transition from D to E.
S . . . ...
..........
........
............
...............................................................
..
..
...
........
......
.....
....... ............. .....
......
....
... .
....
.
...
i .
.
.
.
.
.
.. ..
....
...
...
...
. ...
.
...........
.... . . .
....... ..
..•
. ........
. .
.........
.
.
.
.
.
E
...
...
...
..
..
.
....
• .... .
......
.
.
.
......
.....
..... .
.. •
.. .
..............
.............................. .
.. ...
..
..
. . . .
..
.... •
.....
... ....
.
.....
.
..
.... .
. .............................. ...
.
... .....
..... ...
. • ...
.
... ... ..... . ...
..... ... ..... .. ...
... .... ..
...... .... .... ......
... ........ .....
...
...
...
... ...
..
... .....
.....
.....
..... D ......
. .
....................
....
..... .... ........ ...
. .
..... . .. ......
.......... .......
......
.......
.........
..............
• .
.
.........
...........
....
. . ..
...............................................
Let Q be the matrix of transition probabilities from the set D into itself,
and S the matrix of transition probabilities of D into E.
The row sums of (I − Q)−1 give the expected amount of time spent until
the chain hits E.
The matrix (I − Q)−1 S gives the probability distribution of the first state
hit in E.
1 FINITE MARKOV CHAINS 21
Example E-1 (a) The rat. Recall the rat in the maze.
1 2 3 4
1 0 1/3 1/3 1/3
1 2
2 1/2 0 0 1/2
P =
3 1/2 0 0 1/2
3 4
4 1/3 1/3 1/3 0
(b) $100 or bust. Consider a random walk on the graph pictured below.
You keep moving until you hit either $100 or ruin. What is the probability
that you end up ruined?
◦..... ....◦$100
..... ....
..... .. .
........
.◦...
.
. .... ........
.
.. .....
◦..... ...
◦ ruin
start
E consists of the states $100 and ruin, so the Q and S matrices look like:
0 1/3 1/3 1/3 0
Q = 1/4 0 1/4 S = 1/4 1/4 .
1/3 1/3 0 0 1/3
A bit of linear algebra gives
11/8 2/3 5/8 1/3 0 5/8 3/8
−1
(I − Q) S = 1/2 4/3 1/2 1/4 1/4 = 1/2 1/2 .
5/8 2/3 11/8 0 1/3 3/8 5/8
Starting from the bottom left hand corner there is a 5/8 chance of being
ruined before hitting the money. Hey! Did you notice that if we start in
the center, then getting ruined is a 50-50 proposition? Why doesn’t this
surprise me?
(c) The spider and the fly. A spider performs a random walk on the
corners of a cube and eventually will catch and eat the stationary (and
rather stupid!) fly. How long on average does the hunt last?
............................................ spider
......... .
..................................................... ....
... .. .
.. ...
... .. .. ..
... . ....
... .. .. ..
... ...... . . . . ... . .............
...............................................
fly
1 FINITE MARKOV CHAINS 23
To begin with, it helps to squash the cube flat and label the corners to see
what is going on.
1 4
•
...... ......
•
.....................................................................................
..... ...........
......
.. ......
......
...... ...... ...... ......
....... ...... ..... ......
......... ................ ......
...... . ..
........... ......
... ... ......
........ ........ ......
....... ......
... ...
F .......
. ..
...
2 .......
. ..... .
.5
.......
.
...
......
S
......
......
• ..
......
......
• ..
......
......
. .
.
•
..........
...
•
..............................................................................................................................................................................................................................
........
.
...... ......
...... ...... ......
. ......
...... ...... .......... .........
.
...... ........ .....
...... .......... .....
...... ...... ........... ......
...... ...... .....
......
......
3
......
...... ........ .........
......
.6
........ ....
...................................................................................
..
...
• •
(d) Random walk. Take the random walk on S = f0, 1, 2, 3, 4g with ab-
sorbing boundaries.
1−p p
. .......
.............. .........
..................................... ................ .................
...... ..... .......... .. .....
..... .... ... ....
...
• • ....
• ...
• •
0 1 2 3 4
1 FINITE MARKOV CHAINS 24
1 2 3 0 4
10 p 0 1−p 0 1
Q = 2 1 − p 0 p and S = 2 0 0 .
3 0 1−p 0 3 0 p
1 2 3
2
1(1 − p) + p p p2
1
(I − Q)−1 = 2 1−p 1 p .
(1 − p)2 + p2
3 (1 − p)2 1−p 2
p + (1 − p)
0 4
2
(1 − p + p )(1 − p)
1 p3
−1 1
(I − Q) S = 2 2
2 (1 − p)2 p2 .
(1 − p) + p
3 (1 − p)3 2
(1 − p + p )p
4 .....
.....
...................
....... ......
.....
.....
..
...... .....
..
.... .....
.
... .....
.
. .....
....
. ...
2 3 .
.
..
.
.
.. ...
...
....
E(length of game) = , .
.
.
...
.
.
.
... .....
.....
(1 − p)2 + p2 .
.
.
...
.
...
..
.
.
.
... .....
.....
.....
.....
..
. .....
.....
2 .
0 0.5 1
1 FINITE MARKOV CHAINS 25
1 ........................
.........
.......
......
.....
.....
.....
.....
.....
.....
.....
.....
(1 − p)2 0.5 .....
.....
.....
.....
P(ruin) = , .....
.....
(1 − p)2 + p2 .....
.....
.....
......
.......
.........
.......................
0
0 0.5 1
(e) Waiting for patterns. Suppose you start tossing a fair coin and that
you will stop when the pattern HHH appears. How long on average does
this take?
We define a Markov chain where Xn means the number of steps needed to
complete the pattern. The state space is S = f0, 1, 2, 3g and we start in
state 3 and the target is state 0. Define D = f1, 2, 3g and E = f0g.
The state of the chain is determined by the number of Hs at the end of the
sequence. Here · · · T represents any initial sequence of tosses, including the
empty sequence, provided it doesn’t have 3 heads in a row.
· · · T, ∅ State 3
···TH State 2
· · · T HH State 1
· · · T HHH State 0
1 2 3 1 2 3
1 0 0 1/2 2 1 2 4
Q = 2 1/2
0 1/2 , (I − Q)−1 = 2 2
4 6
3 0 1/2 1/2 3 2 4 8
We can apply the same idea to other patterns; let’s take T HT . Now the
states are given as follows:
· · · HH, ∅ State 3
· · · HHT State 2
···TT State 2
···TH State 1
· · · T HT State 0
1 2 3 1 2 3
1 0 0 1/2 1 2 2 2
Q = 2 1/2 1/2
0 , (I − Q)−1 = 2 2
4 2
3 0 1/2 1/2 3 2 4 4
···
1 0 0 0 0 0
1 0 0 0 ··· 0 0
1 1
0 0 ··· 0 0
2 2
P = 1 1 1 .
0 ··· 0 0
3 3 3
.. .. .. .. ... .. ..
. . . . . .
1 1 1 1 1
··· 0
N −1 N −1 N −1 N −1 N −1
We are trying to hit E = f1g and so
0 0 0 ··· 0 0
1
2 0 0 ··· 0 0
1 1
Q=
0 ··· 0 0 .
3 3
. . . . .
...
. . . . .
. . . . .
1 1 1 1
··· 0
N −1 N −1 N −1 N −1
A bit of experimentation with Maple will convince you that
1 0 0 ··· 0 0
1
2 1 0 · · · 0 0
1 1
−1
(I − Q) =
1 · · · 0 0 .
2 3
. . . .. ..
. . . ...
. . . . .
1 1 1 1
··· 1
2 3 4 N −1
Taking row totals shows that Ej (T1 ) = 1 + (1/2) + (1/3) + · · · + (1/(j − 1)).
Even if we begin with the worst element, we have EN (T1 ) = 1 + (1/2) +
(1/3) + · · · + (1/(N − 1)) ≈ log(N ). It takes an average of log(N ) steps to
get the best element. The average case is much faster than the worst case
analysis might lead you to believe.
1 FINITE MARKOV CHAINS 28
F Column vectors
and X
pm+n (x, y) = pm (x, z)pn (z, y).
z∈S
Fix
P∞ a state x and assume X0 = x. Define the random variable R =
n=0 1(Xn =x) which records the total number of visits to state x. There
is, of course, a visit to x at time 0. From the Markov property, if we hit x
after time 0, the process starts over. Thus
E(R)P(R = 1) = 1. (3)
Take x = 0 and assume that X0 = 0. Let’s find p2n (0, 0). In order that
X2n = 0, there must have been n steps ¡ to the left and n steps to the
2n
right. The number of such paths is n and the probability of each path
is pn (1 − p)n so
² ³
2n n (2n)! n
p2n (0, 0) = p (1 − p)n = p (1 − p)n .
n n!n!
√
Stirling’s formula says n! ∼ 2πn(n/e)n , so replacing the factorials gives
us an approximate formula
p
2π(2n)(2n/e)2n n n [4p(1 − p)]n
p2n (0, 0) ∼ p (1 − p) = √ .
2πn(n/e)2n πn
P P √
If p = 1/2, then n p2n (0, 0) ∼ n 1/ πn = ∞ and the P walk is recurrent.
But if p 6= 1/2, then p2n (0, 0) → 0 exponentially fast and n p2n (0, 0) < ∞
so the walk is transient.
.........
......
....
.
....
• • ...
...
...
•
...
...................................................................................................................................................
... .. .. . . ..
... ... ... ... ..... ... ...
... ... ..... .. ... ... .....
... .... ..... .
..
..... ... .
... ...
... ........... ........... ... . ...
... ... .. .... .. ... ... ...
... ... ... ..... ... .... ...
... .... ... ... .
. .
....... ...
... ... ...... .......
.
..
... .....
.
.
..
. .
.. .
• ..
.
. .... .
.
. .
.
.
.. .....
.....
.
.............................................................................................................................................................
.
or as
py [a(y) − a(y + 1)] = qy [a(y − 1) − a(y)].
Provided py > 0, we can divide to get
qy
a(y) − a(y + 1) = [a(y − 1) − a(y)],
py
and plugging this back into (1) and solving for a(w) gives
Pz−1
y=w (rx+1 · · · ry )
a(w) = Pz−1 . (2)
y=x (rx+1 · · · ry )
2 COUNTABLE MARKOV CHAINS 33
Consequences
This function is also harmonic, but satisfies the opposite boundary con-
ditions b(x) = 0 and b(z) = 1. Equation (1) is valid for any harmonic
function, so let’s plug in b and multiply by -1 to get
w−1
X
b(w) = b(w) − b(x) = rx+1 · · · ry [b(x + 1) − b(x)]. (3)
y=x
In particular we see that a(w) + b(w) = 1 for all x ≤ w ≤ z. That is, the
chain must eventually hit one of the boundary points fx, zg, provided all
the py ’s are non-zero.
2. For w ≥ x, define
P∞
On the other hand, if y=x (rx+1 · · · ry ) < ∞, then
P∞
y=w (rx+1 · · · ry )
A(w) = P∞ . (5)
y=x (rx+1 · · · ry )
= (q ∧ p) + (1 − (p + q)) + (p ∧ q)
= 1 − jp − qj.
Therefore k pkjj < ∞ implies k pkii < ∞. Reversing the roles of i and j
P P
gives the result. t
u
D Branching processes
This is a random model for the evolution of a population over several gener-
ations. It has its origins in an 1874 paper by Francis Galton and Reverend
Henry William Watson called “On the probability of the extinction of fam-
ilies”. (see http://galton.org)
2 COUNTABLE MARKOV CHAINS 36
• ........
..... .. .....
..... ... .....
..
....... .... ........
.....
..... .... .....
.... .....
..... .... .....
.....
.. . .
.. .. . .
............
.
............ ...
. • ..
......
• . .
...................
...
. ................
.
. • .....
...
..
.. .
... ...... ........ . ..
..
.. ...... ....... ....
. .
..... .. .
.... .. .... .
..... ..............
....... ......... ...
....... ...
... ... ..... .......
....... ..... ..... .....
..... .......
....... ..... ..... .......
.
...
.
.
.
.
...
.
... .......
. • . .... ..
.............
... ... .......
.
.
. • . • • . • ... .........
.... •
.
...
.
.
.
. ...
... .. ....... ....
..
. ... .. . ...
..
..... ..
....
. .
.....
.
...... ...
..
....
. ..
..... ... .. ...
....
. ....
. .
. ..... ...
. . . . .
• .
..
.....
.
.....
.
• .....
....
• .....
•
.......
.... ........
• ..
... ... .......
... ... .....
... .....
... .... .....
... .....
... .. .....
.
• • .
• .....
.
y 0 1 2 3 ...
p(y) p0 p1 p2 p3 ...
P∞
Let’s find the average size of generation n. Let µ = E(Y ) = j=0 jpj .
Then
E(Xn+1 j Xn = k) = E(Y1 + · · · + Yk ) = kµ,
so that
∞
X
E(Xn+1 ) = E(Xn+1 j Xn = k)P(Xn = k)
k=0
X∞
= kµP(Xn = k)
k=0
= µE(Xn ).
2 COUNTABLE MARKOV CHAINS 37
....
...
• ..
......
......
....
...
.
.....
.......
.. ...... .. ........
... ...
..............
. ... ..
............
.
.. . .......
... .......... ... ..........
......... ..........
... .......... ...
..... ....
... ...... ..... ... .............
... .
....................
.
. ... ..
..
... ....... .... ... ..... ....
..... ..... .... .....
... ....................... ... ..... ....
... ...... .. ..... ... ..... .....
... .
.. ..
................................ . ... .
..
...............
.
.... . .... .. . .
... ....... .... ......... . . ... ..... ....
....... .... .....
... ....... .. ..... .. .. ... ..... .....
... .
...
. .
.
..
. ... .. ... ..... .....
...
.
........................................
....... .. ... ..
..............
... ........ .... ..... . ... ... ... ..... .....
.. ........ ...... ... ..... .....
...
..........
.....
.. .
. .
.... . . ... ..... .....
... .......... .... ......... ... ...........
... .. .
...
. ..
.. .
. ... ..
.
.
. .
.... ... ... ................
.
..... ........... . ......
.... .... ........................ ... ..........
........... ......................................................................................................
.... ..... ..
.
.
.
..
... ...
. .
...
...
• ........
......... ..
.............. .
... ..... . ... . . .
... ....... . ..
.
. .
.... ... ...
.
. .
................... ....
....
. .
. .
. ........ ......
... .......
. ... ....... .......
... .
. . . ... ... ... ........................... . ...
.
... .
..
.
.. .......... .... ........... ...
... ..... . . ... ... ..
...
. .. .
... ..... .. .. ... ........... ... .... .. ..
... .
....... ..
.
.
..
.
. .. .. ..........................................................................................
. .
. .
.
.
....
... ..
..... . . ....
.. ..
....
. . .
... .
..... . . ... ... ... ..... . ... ... ...
... .
..
.
.
... .
.
.
.
.
. . . ... .
..
...... ... . . .
. .
... ..... ... .....
... ..
...... ..
.
.
..
.
.
.. ..
.. .. ... ...
..... ..
.
. .. ....
.
.
..
..
... ..
....
. . .
... ...
.... . . .
... ..
..... .
. .
. ... ... ... ....... .
. .
. .
. ...
... ..
....
. .
. .
. . . ... ..
....
. .
. . ..
. .
... .... ... ....
..... . . .. .. ..... . . .. ..
... ......... .... .... .. .. ... ......... .... .... ... ..
... ....... ... .......
.......... ... ... .. .. .......... ... ... ... ..
................................................................................................................................................................................................................................... ..................................................................................................................................................................................................................................
a0 a1 a2 a3a4 1 a0 a1 a2 a3 a 1
Example D-1
3 Optimal Stopping
0 1 2 ··· N − 1 N 0 1 2 ... N − 1 N
Definition A-2 A stopping time (strategy) is a rule that tells you when
to stop playing. Mathematically, it is a random variable with values in
f0, 1, 2, . . .g ∪ f∞g so that fT = ng ∈ σ(X0 , . . . , Xn ) for all n ≥ 0. Equiva-
lently, a stopping time satisfies fT ≤ ng ∈ σ(X0 , . . . , Xn ) for all n ≥ 0.
Example A-2
Facts about v
v(x) ≥ E(f(XT ∗ ) j X0 = x)
X
= E(f(XT ∗ ) j X1 = y)p(x, y)
y∈S
X
= v(y)p(x, y)
y∈S
= (P v)(x).
B Examples
Example B-3 Zarin case The following excerpt is taken from What is
the Worth of Free Casino Credit? by Michael Orkin and Richard Kakigi,
published in the January 1995 issue of the American Mathematical Monthly.
3 OPTIMAL STOPPING 43
•......
...
...
..
• ....
...
...
...
...
···
... ...
... ...
... ..
• • • •
..............................................................................................................................................................................................................................................................................
Since the state zero is absorbing, we have v(0) = 0. On the other hand,
v(x) > 0 = f(x) for x = 1, . . . , k, so that 1, . . . , k 6∈ E. Starting at k, the
optimal strategy is to keep playing until you hit 0 or N for some N > k
which is to be determined. In fact, N is the smallest element in E greater
than k.
We have to eliminate the possibility that N = ∞, that is, E = f0g. But
the strategy Vf0g gives a value function that is identically zero. As this is
impossible, we know N < ∞.
The optimal strategy is Vf0,N g for some N > k. Using the previous example
we can calculate directly that
1 − (q/p)k
Ek (f(XVf0,Ng )) = (N − k) .
1 − (q/p)N
3 OPTIMAL STOPPING 44
For any choice of p and q, we choose N to maximize the right hand side.
In the Zarin case, we may assume he played the “pass line” bet which gives
the best odds of p = 244/495 and q = 251/495, so that q/p = 251/244. We
also assume that he bets boldly, making the maximum bet of $15,000 each
time. Then three million dollars equals k = 200 free units, and trial and
error gives N = 235 and v(200) = 12.977 = $194, 655.
Solution: You can almost eyeball this one. The state 0 belongs to E because
it’s absorbing, and the state 4 belongs to E because it has the maximum
f value. For a symmetric random walk, a harmonic function is linear, so
the straight line from (0, 0) to (4, 10) gives the average payoff using the
strategy Vf0,4g . Since this line is higher than the f values at 1,2, and 3, we
conclude that these states do not belong to E.
3 OPTIMAL STOPPING 45
..
........
... .........
•
.. .....
... .....
....
.
.
...
. .....
.....
.....
.....
v(x)
.... .....
.....
..
. .....
..
. .....
..
.
...
.
.
.. .....
.....
.....
.....
f(x)
.. .....
...
. .....
...
. .....
.....
.... .....
..
. .....
..
. .....
. .....
...
. .....
... .....
.. .....
.. .....
..
. .....
.
.. .....
.. .....
..
. .....
. .....
.... .....
.....
.
..
.
..
.
..
.
.
•
.....
...
...
.... ...
...
..
. ...
...
. ...
...
. ...
.... ...
...
..
. ...
...
. ...
.
... ...
•j .
... j j j j j j j j j •j ...
.
0 1 2 3 4 5 6 7 8 9 10
On the right hand side of the picture, the state 10 belongs to E because
it’s absorbing. If we were to connect (10, 0) with any of (8, 3), (7, 4), (6, 6),
(5, 0), or (4, 10) using a straight line, we’d see that (9, 3) is above the line.
This shows that, starting at 9, not gambling is the best bet. The state 9
belongs to E.
Finally, connecting (4, 10) and (9, 3) with a straight line beats the f values
at 5,6,7, and 8, which shows that none of these belong to E. To conclude:
the optimal strategy is to play until you visit E = f0, 4, 9, 10g.
Here is the corresponding value function:
x 0 1 2 3 4 5 6 7 8 9 10
v(x) 0 2.5 5.0 7.5 10 8.6 7.2 5.8 4.4 3.0 0
Example B-5 One die game. You roll an ordinary die with outcomes
f . , . . , ... , .. .. , ..... , ...
... g. You can keep the value or roll again. If you roll,
you can keep the new value or roll a third time. After the third roll you
must stop. You win the amount showing on the die. What is the value of
this game?
The variable n tells you how many rolls you have left, and this decreases
by one every time you roll. Note that the states with n = 0 are absorbing.
You can think of the state space as a tree, the chain moves forward along
the tree until it reaches the end.
The payoff function is zero at the start, and otherwise equals the number of
spots on d. At n = 0, we have v(0, d) = d, and we calculate v elsewhere by
working backwards, averaging over the next roll and taking the maximum
of that and the current value. The function v is given below in green, while
f is in red.
n= 2 1 0 d
........
.........
..... 4.25 1 3.5 1 1 1 .
.........
....
......... ....
4.25 2 3.5 2 2 2 .
........
.
......... ................
................................
.
....... ............................ .
.
..
..
.
. . .
..
. .. .. . .
Start ..................................................................................................
..............................
.............. ..............
...... .......
4.25 3 3.5 3 3 3
...... ........ ............................
4.66 0
...... ........ ..............
4.25 4 4 4 4 4 ..
...... ........
...... ........
......
...... ................
..
..
...... ........
..
...
...... .....
......
......
......
......
5 5 5 5 5 5
....
6 6 6 6 6 6 ...
...
Example B-6 Two dice game. The following game is played: you keep
rolling two dice until you get 7 or decide to stop. If you roll a 7, the game
is over and you win nothing. Otherwise, you stop and receive an amount
equal to the sum of the two dice. What are your expected winnings: a) if
you always stop after the first roll; b) if you play to optimize your expected
winnings?
P
a) Stopping at the first roll gives an expected payoff of y6=7 yp(y) = 35/6 =
5.8333.
b) For this kind of Markov chain, the P operation always gives a function
that is constant on all states except possibly 7. That is,
ºP
y6=7 v(y)p(y) x 6= 7
(P v)(x) =
v(7) x=7
That is, if x, z 6= 7, then (P v)(x) = (P v)(z). Now suppose that x 6∈ E so
that (P v)(x) = v(x) > f(x). Then x 6= 7, and if x > z where z 6= 7, then
f(z) = z < x = f(x) < v(x) = (P v)(x) = (P v)(z) ≤ v(z),
so that z also is not in E. This implies that, except for the state 7 (which
belongs to E), the set S \ E is completely to the left of E.
Now the question becomes: where is the boundary point? From the answer
to part a) we see that v(x) ≥ 35/6 > f(x) for x = 2, 3, 4, 5, so that
they don’t belong to E. The remaining possibilities are E = f7g ∪ fz, z +
1, . . . , 12g for z equal to either 6, 7, 8, 9, 10, 11, or 12. Let’s define Tz to be
the stopping time when the Markov chain first hits the set f7g ∪ fz, z +
1, . . . , 12g.
Let’s analyze the strategy T6 with stopping set f6, 7, . . . , 12g. Define A =
f6g and B = f7, . . . , 12g. Then p = 5/36 and q = 21/36 so that, using the
aside, the chance of getting a six before any value greater than or equal to
seven is 5/26. That is, for x 6= 7,
Px (XT6 = 6) = 5/26.
In the same way we also calculate
Px (XT6 = 7) = 6/26, Px (XT6 = 8) = 5/26, Px (XT6 = 9) = 4/26
3 OPTIMAL STOPPING 48
From this we conclude that the optimal strategy is stop rolling as soon as
we get a sum of seven or greater, and the value of this strategy is 6.66666.
Example B-7
A simplified version of the “Wheel of Fortune” has four spaces: $1000,
$3000, $5000, and bankrupt. You can spin as many times as you like and
add to your fortune, but if you hit “bankrupt” you lose all your money and
the game is over. The state space is S = f0, 1, 2, . . .g where we count in
thousands of dollars.
We will find the best strategy for playing this game. We know that 0 ∈ E,
since 0 is absorbing. Next for x 6= 0 we calculate (P f )(x) = [f(x + 1) +
f(x+3)+f(x+5)]/4 = (3x+9)/4 to see that (P f )(x) > f(x) for 1 ≤ x ≤ 8.
Hence 1, 2, . . . , 8 6∈ E.
On the other hand, (P f )(x) ≤ f(x) for x ≥ 9. Normally this doesn’t
prove anything, but this is a special case since, except for jumping to 0,
the Markov chain is increasing. In other words, for any starting position
x ≥ 9, we may consider the state space equal to f0, 9, 10, . . .g. The payoff
function f is superharmonic everywhere on this space, so v = f and you
should never gamble.
3 OPTIMAL STOPPING 49
In terms of the original chain, we conclude that E = f0, 9, 10, . . .g, and you
should keep spinning the wheel until you go bankrupt or reach $9,000 or
more.
Example C-1 How much would you pay for the following financial op-
portunity? You follow a random walk on the graph and there is no payoff
except $100 at state 4, and state 5 is absorbing.
1 •.................. .....
.....
• 4 ($100 bill)
.....
..
.....
..... .
.......
..... ....
..... .....
..... .....
..... .....
....
.....
3
..... .........
.........
....
.
• .
..........
..... .........
.....
...
.
...... .....
.....
.
..... .....
........ .....
.....
..
..... .....
..
....
. .....
...
. .....
2• • 5 (absorbing)
.
..
. ....
In vector form, the payoff function is f = (0, 0, 0, 100, 0). (For ease of
typesetting, we will render these column vectors as row vectors, OK?) The
“P ” operation takes a vector u and gives
³
u(2) + u(3) + u(4) u(1) + u(3) + u(5) u(1) + u(2) + u(4) + u(5) u(1) + u(3) + u(5)
²
Pu = , , , , u(5) .
3 3 4 3
The initial vector is u1 = (100, 100, 100, 100, 0) and P u1 = (100, 200/3, 75, 200/3, 0).
Taking the maximum of this with f puts the fourth coordinate back up to
100, giving u2 = (100, 200/3, 75, 100, 0).
3 OPTIMAL STOPPING 50
Example C-2 What is a fair price for this financial opportunity? (Xn ) is
a random walk on the graph, only the five indicated states have nonzero
payoff, and the center is absorbing.
$10 ...........
.................................... $50
• . .
............
........
..... ...................... • ........
..
...............
....... ..... ......
.. ..
... ... .... .......... ...
........ ..... .... .........
...
.....
..
.
...
... ....
...
...
•.............
.
....
...
...
..... ....
...
...
...
...
...
...
... ... ... ... ... ... ...
.. .. . ....
....
.
... ...........
.. .•
...
.
.
...........
...
... ... ...
....... ... .. .. .......
....... .. .. .. .......
.
•
...... .........
......
......
...
...
.
............. ....... ... .. ......... ...... ....
. . .. .... .
start • ............
... ........
... ......
...... .............
..•
......................................................................................................................................................................
.
.. ..
...... .. .... .......
.
.
....... .... ... ..... ............
.. .
...
....... ...........
..
...... ..
...... ...
• $100
.. ..
• ................
.........
............
...........................
•......
.................
...........
$80 $80
Programming this problem in Maple, and running the algorithm to time
100, we get the vector
(32.42, 25.36, 50.00, 100.00, 80.00, 80.00, 19.26, 25.12, 50.00, 60.00, 53.33, 37.47, 0.00),
and find that the answer is $32.42.
D Two variations
α after one time unit. Start with u1 as above and put un (x) =
max(αP un−1 (x), f(x)). The value function v for the optimal strat-
egy satisfies v(x) = limn un (x).
If you have both costs and discounting you use the formula
..........
..........
• uS, rB, Cu
..........
..
....
...............
.........
..........
..........
..........
..........
C, B, S •...................
..........
..........
..........
..........
..........
..........
..........
..........
..........
• dS, rB, Cd
..........
Time 0 Time 1
Call Option
A call option gives the holder the right (but not the obligation) to buy
stock at a later time for K dollars. The value K is called the strike price.
The value of the option at time 1 is given by
Cu = (uS − K)+ Cd = (dS − K)+
For American options, the price is the maximum of the current payoff and
the formula calculated earlier. For a call option,
² ³
1
C = max (S − K)+ , fpCu + (1 − p)Cd g
r
1
= fpCu + (1 − p)Cd g .
r
A call option is never exercised early, so there is no difference between
American and European call options.
A put option gives the buyer the right (but not the obligation) to sell stock
for K dollars. That is,
Pu = (K − uS)+ Pd = (K − dS)+
and
1
PEuro = fpPu + (1 − p)Pd g
r
² ³
1
PAmer = max (K − S)+ , fpPu + (1 − p)Pd g .
r
Call Option
650
. .................
..........
.......... •
..........
........
650
..
257.14 ..........
..........
..........
..........
..........
..........
..........
.
•...................
.......... ...............
..........
..........
..........
..........
100.33 ................ .......
250 ..........
..........
..........
.......... ..........
50
• •
...... ..........
.
.............. ..................
..
......... ............... ....... .......
....... .... .......... ............
.............
..........
...... .
..............
.
... ............ ........ .....................
50
38.71 ..........
..........
........ ..
.......
50 ...............
..........
..........
17.46 ..........
..........
..........
.........
•. ..........
..........................
..........
..........
..........
.......... ..........
..........
..........
..........
. .......•
..........................
..... ...........
..........
..........
..........
..........
..........
0 ..........
..........
.......... 6.10 ..... ................... 0 ..........
..........
..........
.......... ...... ..........
0
• •
.......... ....
....................... ..........
............
..........
.......... .......... ...
.......... ...........
..........
..........
.......... .................... 0
0 ..........
..........
..........
..........
0
.......... .....................
..........
...........
..........
• ...........
..........
..........
..........
..........
..........
0 ..........
..........
..........
..........
0
•
..........
........
Time 0 1 2 3
This tree explains the price of a call option with terminal time n = 3.
The red number is the payoff if the option is exercised immediately while
the green number is the value of the call option. These are calculated by
starting at the right hand side and working left, using our formula. The
end result is relatively simple, since a call option is never exercised early.
( n ² ³ )
1 X n j
C= n p (1 − p)n−j (uj dn−j S − K)+
r j=0
j
3 OPTIMAL STOPPING 55
0
...
0 ..........
..........
..........
..........
.
..........
..........
..........
..........
.
•
....
...
. ..................
..........
..........
..........
..........
..........
36.38 .
. ...
........ .......
. .
0 ..........
..........
..........
......... ..........
0
• •
........ ..........
...
....
......... ................
.....
....... ................ .................
...... ... .......... ..........
.
..........
..............
. ....
..... .
. ...
..........
............... ......... ................. .......
0
73.02 ..........
..........
.......... 0 ..........
..........
.......... 60.32 ..........
..........
..........
• •
..........
.......................... .......... ...................
.
. .......... .....
.......... ......... ...................
.......... .......... ..........
.......... .......... ..........
.......... .......... ..........
..........
0 ..........
..........
.......... 100 ............... .........
0 ..........
..........
..........
..........
.......... ....................
.... ..........
100
• ..............
..........
..........
..........
..........
.......... ..... ........... .......
..........
........... •
.......... ...
.
.............
100
........
100 ..........
..........
..........
..........
125 ..........
...........
... .........
.......... ....................
• ..........
..........
..........
..........
..........
..........
125 ..........
..........
..........
• 137.50
..........
..........
.......
137.50
Time 0 1 2 3
This tree explains the pricing of an American put option with terminal
time n = 3. The red number is the payoff if the option is exercised imme-
diately while the green number is the current value of the option. These
are calculated by starting at the right hand side and working left, using
our formula, but always taking the maximum with the result of immediate
exercise. There are boxes around the nodes where the option would be
exercised; note that two of them are early exercise.
Define a Markov chain on the tree. At each time, the chain moves forward.
It goes upward (north-east) with probability p and downwards (south-east)
with probability 1 − p. The ends are absorbing.
Let f(x) be the value of the option if exercised immediately at state x. Set
the discount rate to be 1/r.
3 OPTIMAL STOPPING 56
..........
..........
.......... •
.......... y
x • ...
.
...............
.....
..........
..........
..........
(P g)(x) = pg(y) + (1 − p)g(z)
..........
•.......
z
Time = n − 1 n
Continuing this way, we can prove that uj+1 (x) = v(x) for states x at time
n − j.
The algorithm of starting at the far right hand side and working backwards
gives us the value function v, which gives the correct price of the option at
each state. We exercise the option at any state where v(x) = f(x).
4 MARTINGALES 57
4 Martingales
A Conditional Expectation
Example A-1 Your friend throws a die and you have to estimate its value
X. According to the analysis above, your best bet is to guess E(X) = 3.5.
In an even more extreme case, your friend may tell you the exact result X.
In that case your estimate will be X itself.
4 MARTINGALES 58
Example A-2 Suppose you roll two fair dice and let X be the number on
the first die, and Y be the total on both dice. Calculate (a) E(Y j X) and
(b) E(X j Y ).
(a)
X
E(Y j X)(x) = yP(Y = y j X = x)
y
6
X 1
= (x + w) = x + 3.5,
w=1
6
so that E(Y j X) = X + 3.5. The variable w in the sum above stands for
the value on the second die.
(b)
X
E(X j Y )(y) = x P(X = x j Y = y)
x
X P(X = x, Y = y)
= x
x
P(Y = y)
X P(X = x, Y − X = y − x)
= x
x
P(Y = y)
X P(X = x)P(Y − X = y − x)
= x
x
P(Y = y)
4 MARTINGALES 59
Now
1
P(X = x) = , 1 ≤ x ≤ 6,
6
y−1
2≤y≤7
36
P(Y = y) =
13 − y 8 ≤ y ≤ 12
36
and
1
P(Y − X = y − x) = , y − 6 ≤ x ≤ y − 1.
6
For 2 ≤ y ≤ 7 we get
y−1 y−1
X 1/36 1 X 1 (y − 1)y y
E(X j Y )(y) = x = x= = .
x=1
(y − 1)/36 y − 1 x=1 y−1 2 2
For 7 ≤ y ≤ 12 we get
6 6
X 1/36 1 X y
E(X j Y )(y) = x = x= .
x=y−6
(13 − y)/36 13 − y x=y−6 2
Properties:
1. E(E(Y j Fn )) = E(Y )
Example A-5
E(f(Xm+n ) j Fm ) = (P n f)(Xm ).
B Martingales
Proof:
E(Mn+1 − Mn j Fn ) = E(Xn+1 − µ j Fn )
= E(Xn+1 j Fn ) − µ
= µ−µ
= 0.
= Bn+1 E(Xn+1 j Fn )
= Bn+1 E(Xn+1 )
= 0,
Begin with an urn that holds two balls: one red and the other green. Draw
a ball at random, then return it with another of the same colour.
Define Xn to be the number of red balls in the urn after n draws. Then
Xn is a time inhomogeneous Markov chain with
k
P(Xn+1 = k + 1 j Xn = k) =
n+2
k
P(Xn+1 = k j Xn = k) = 1 −
n+2
This gives
² ³ ² ³
k k n+3
E(Xn+1 j Xn = k) = (k + 1) +k 1− =k ,
n+2 n+2 n+2
so that E(Xn+1 j Xn ) = Xn (n + 3)/(n + 2). From the Markov property we
get ² ³
n+3
E(Xn+1 j Fn ) = Xn ,
n+2
and dividing we obtain
² ³
Xn+1 Xn
E j Fn = .
(n + 1) + 2 n+2
If we define Mn = Xn /(n + 2), then (Mn ) is a martingale. Here Mn stands
for the proportion of red balls in the urn after the nth draw.
4 MARTINGALES 65
fσ ≤ k − 1, τ = kg = fσ ≤ k − 1g ∩ fτ ≤ k − 1gc ∈ Fk−1 .
Therefore
¡
E((Xk − Xk−1 )1fσ≤k−1, τ =kg ) = E E(Xk − Xk−1 j Fk−1 )1fσ≤k−1, τ =kg ≤ 0,
1 − (q/p)j 1 − (q/p)j
² ´ µ ³
−1
P(ST = N ) = and E(T ) = (p − q) N −j
1 − (q/p)N 1 − (q/p)N
j(N − j)
E(T ) =
p+q
1.00 ........................................
......... ..............
......... ..
0.75 ......... ......................
......... .........
......... ........
......... ........
...
.......... .....
0.50 ......... ............
......... .
......... ..........
0.25 ......... .....
......... ....
.............
0.00 ......
0 5 10 15 20
Starting point
4 MARTINGALES 68
........................
100
..
.....................................................................
.
..... ....... ..............
75 ..
...... ............ ..... .....
..... .....
..
.. ............ .... ....
.
.
.. ...... .... ....
50 ...
. . . .... ...
... ..... ........
. .
. ... ......
.. . ......
25 .. ....... ......
.....
......... ......
0 .. ....
0 5 10 15 20
Starting point
Example C-1 Waiting for patterns: In tossing a fair coin, how long on
average until you see the pattern HT H?
Imagine a gambler who wants to see HT H and follows the “play until you
lose” strategy: at time 1 he bets one dollar, if it is T he loses and quits,
otherwise he wins one dollar. Now he has two dollars to bet on T , if it is
H he loses and quits, otherwise he wins two more dollars. In that case, he
bets his four dollars on H, if it is T he loses and quits, otherwise he wins
four dollars and stops.
His winnings Wn1 form a martingale with W01 = 0.
Now imagine that at each time j ≥ 1 another gambler begins and bets
on the same coin tosses using the same strategy. These guys winnings are
labelled Wn2 , Wn3 , . . . Note that Wnj = 0 for n < j.
Define Wn = ∞ j
P
j=1 Wn the total winnings at time n and let T be the first
time the pattern is completed. By optional sampling E(WT ) = E(W0 ) = 0.
From the casino’s point of view this means that the average income equals
the average payout.
Income: $1 $1 $1 $1 ··· $1 $1 $1 $1
Coin tosses: H T T H ··· H H T H
Payout: $0 $0 $0 $0 ··· $0 $8 $0 $2
4 MARTINGALES 69
Examining this diagram, we see that the total income is T dollars, while
the total payout is 8 + 2 = 10 dollars, and conclude that E(T ) = 10.
Fortunately, you don’t need to go through the whole analysis every time
you solve one of these problems, just figure out how much the casino has to
pay out. For instance, if the desired pattern is HHH, then the casino pays
out the final three bettors a total of 8 + 4 + 2 = 14 dollars, thus E(T ) = 14.
Example C-3 Guessing Red: A friend turns over the cards of a well
shuffled deck one at a time. You can stop anytime you choose and bet that
the next card is red. What is the best strategy?
Solution: Let Rn be the number of red cards left after n cards have been
turned over. Then
º
Rn with probability 1 − p
Rn+1 = ,
Rn − 1 with probability p
P
Theorem C-2 Let P be an n × n matrix with pij > 0 and j pij = 1 for
all i. Then the eigenvalue 1 is simple.
Proof: Let (Xn ) be the Markov chain with transition matrix P on state
space S = f1, 2, . . . , ng. A function u : S → R is harmonic if and only if the
vector u = (u(1), u(2), . . . , u(n))T satisfies P u = u, i.e., u is a right eigen-
vector for the eigenvalue 1. Clearly the constant functions are harmonic;
we want to show that they are the only ones.
Suppose u is a right eigenvector so that u : S → R is harmonic and u(Xn )
is a (bounded!) martingale. Let x, y ∈ S and Ty := inf(n ≥ 1 : Xn = y) be
the first time the chain hits state y. Since the chain is irreducible, we have
Px (Ty < ∞) = 1 and so
u
t
Theorem D-1 If (Mn ) is a martingale with supn E(jMn j) < ∞, then there
is a random variable M∞ so that Mn → M∞ .
Proof: It suffices to show that for any −∞ < a < b < ∞, the probability
that (Mn ) fluctuates infinitely often between a and b is zero. To see this, we
define a new martingale (Wn ) which is the total “winnings” for a particular
betting strategy.
4 MARTINGALES 71
The strategy is to wait until the process goes below a, then keep betting
until the process goes above b, and repeat. The winnings on the jth bet is
Mj − Mj−1 so that
n
X
W0 = 0, Wn = Bj (Mj − Mj−1 ), n ≥ 1.
j=1
The following diagram explains the relationship between the two martin-
gales.
M process
.
....
◦
◦...............................◦...............................................................................................................................◦.........................................................................................................◦................................................................................................................................................................................................................
.. .
b .... ...
...... ...
◦
...
...
...
•............
..
. ..
.
...
...
...
... ◦ ...
.
...
.
..
◦ ..
.
...
.
.
•.......
... ..
... ... .....
...
...
.
...
.. ◦ .
.
...
..
.•
...........
..... .....
..
...
... ...
..
a ...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
... .. .. ..... ..... .. ... ..
...
... • .......•....
................ ....
• ...
• ......
•
........
. ...
...
...
...
.
... ... .
... ... jM
n − aj
..
... ..
... .. .
... ..
... .
• .
....
W process ... •
... ...
... ... ...
... ....
..
...
... .....
..
..•
..........
..... .........
.....
..
...
.
.... ...
...
...
... ..... ..... .....
..... ...
...
...
...
◦...
.
... ◦ ◦ • .
..
.. .......
• ...
...
...
... ... ...
... ... ...
...
... ... ...
... ... ...
... ... ...
...
...
... ...
..
.
...
..
•
... ...
... ..
.
... ...
... ...
...
...
... ......
......
◦
..
...... ◦ ◦ • ...
...
...
...
•............
...
... ...
... ...
... ..
... .
...
.
... ...
... ...
... ...
◦ ...
...
...
◦ ◦ • ................ ....
•
...........
...
...
..
Example D-1
(a) Polya’s urn. Let Mn be the proportion of red balls in Polya’s urn at
time n. Then (Mn ) is a martingale and 0 ≤ Mn ≤ 1, so supn E(jMn j) ≤ 1.
Therefore Mn → M∞ for some random variable M∞ . It turns out that M∞
has a uniform distribution on (0, 1).
1.00
...................
......... .................... ...................... ........... ........... ..........................................................................................................
....... ......... ............................................... ................................................................
..
...... .........
.
....
...
...
...
0.75 ....
...
..
...
...
....
..
...
0.50 ....
...
...
...
...
...
...
...
...
... ...... ..........................................
...... . ...................................... ..................................... ..................... .........................................
0.25 ... ... ....
... .. .....
....
....... .. .......
... ... ... ...... ................ .... .. ............... ................
......... ..................
.... ....... . ..... ........................
..... .. ...... .. .. ........ .. ............ ............... ................ ... .
.. ..
.. ........................................................................................................
..... ... . .
....... ...... . ......... .. . ..
................. ................. .................................................. ......... .. ... .
..... ....... ...
0.00
0 25 50 75 100
...............................................
0.25
........ ....
.. ...
0.20 .. . ...
... ...
.. ...
0.15 ...
.. ...
.. ...
0.10 .. ...
.. ...
0.05 .. ...
.
. . ....
...
... .......
0.00 ...... .....
−3 −2 −1 0 1 2 3
P∞
Density of j=1 εj /j.
A Poisson process
A typical sample path of this process looks like the broken line graph below.
The dots on the t-axis are the times when events occur.
Xt (ω)
4 →
.....................................
...
..
...
...
...........................................................................................................................................
3 ..
....
..
...
.
................................................................
2 ....
...
...
..
1 .............
....
...
...
..
0 ••
............................................. • • →
t
The Poisson process is our standard model for random movement that
jumps. We get a Poisson process (Xt ) by assuming
(1) Independent increments: for s1 < t1 < s2 < t2 < · · · < sn < tn the
random variables Xt1 − Xs1 , . . . , Xtn − Xsn are independent.
These probability formulas are approximations, but it turns out that they
imply more precise formulas. In fact, Xt has a Poisson distribution with
parameter λt, that is,
(λt)k
P(Xt = k) = e−λt .
k!
To recap, the number of events that occur during [0, t] is a Poisson random
variable with mean λt. The same is true of the number of events that occur
during [s, s + t] for any s ≥ 0. This follows since the process (Xt+s − Xs )t≥0
satisfies conditions (1), (2), and (3) and hence is a Poisson process itself.
(a) Calculate the probability that, over five days, the company receives
exactly five claims.
(b) Calculate the probability that, over five days, the company receives
exactly one claim each day.
Let’s look at the time between events. Define T1 to be the time until the
first event, and for j > 1, let Tj be the time elapsed between the (j − 1)st
event and the jth event. Notice that P(T1 > t) = P(Xt < 1) = e−λt , so
that T1 has an exponential distribution with mean 1/λ. It’s a bit harder
to prove rigorously, but the sequence (Tj )j≥1 are independent, identically
distributed exponential variables.
Example A-2 Suppose that at time s we are still waiting for the first event.
What is the probability that we need to wait for more than t additional
time units?
Let (Yn ) be a Markov chain with finite state space S and transition matrix
P . Let (Nt ) be an independent Poisson process with rate λ, and define the
continuous time process Xt = YNt .
This process has the Markov property
E(f(Xt+s ) j Xr , 0 ≤ r ≤ s) = Pt f(Xs ),
where Pt = etλ(P −I) is the matrix exponential of A := λ(P −I). We have the
equation dtd Pt = APt and P0 = I, and we call the matrix A the infinitesimal
generator of the process (Xt ).
5 CONTINUOUS TIME MARKOV CHAINS 77
The matrix A has every row sum zero, non-negative entries off the diag-
onal and non-positive entries on the diagonal. Every such matrix is the
infinitesimal generator of some continuous time Markov chain.
For x 6= y ∈ S we define α(x, y) to be the (x, y) entry of A. This is the
rate
P at which the process changes from x to y. We also define α(x) =
y6=x α(x, y) the total rate at which the process moves from x.
Theorem B-1 If the chain (Xt ) is irreducible, then limt→∞ Pt (x, y) = π(y)
where π is the unique probability vector that satisfies πA = 0. These are
the steady state probabilities that give the long range fraction of time spent
in each state.
Example B-1 Let (Xt ) be a continuous Markov process with three states,
and transition rates as pictured below.
....................
...... ....
.... ...
... ...
.....
...
γ .
..
... .... ........
..... .. ..................
........................ . ..
....... ..............
.... ....... .......
....... ..............
... .........
... ...
....... 3
....... ..............
.......
... .. ....... ..............
.......
... ... ....... ..............
... ... .......
....... ..............
... ...
... ...
4 .......
....... ............ .........
..................
....
....... . . ...
..... .... ........... ...
.............. ... ...
... ... ..
6 4
... ... ...
... α ..
..
... ... ...
..
..
............. .... .
.....
... .. ....... . . .
...................... .
..
... ... .......
.... .... .......
....... .......
5 ....... .......
... ... ....... .......
... ... ...... ... ..........
.. ..
. ....... .......
......... ....
.......
....... .......
....... .......
....... ..
....... .......
.............. .......
.....
... .. ........ .......
....
. . ..
. ..
.......
5
.........
... ... .. .............
.. ... ...................
..... β . ...
.
... .
... ..
..... ...
..........................
α β γ
α −8 5 3
The infinitesimal generator is A = β 5 −9 4 .
γ 4 6 −10
We easily see that µα = 1/8, µβ = 1/9, and µγ = 1/10. The conditional
5 CONTINUOUS TIME MARKOV CHAINS 78
α β γ
5 3
α 0
8 8
P̃ = β
5 4.
0
9 9
4 6
γ 0
10 10
66 68 47
Solving πA = 0 gives the steady state probabilities π = ( 181 , 181 , 181 ) =
(.3646, .3757, .2597).
To answer these questions, it is not necessary to calculate the matrix ex-
ponential Pt = etA . Maple can do it, but generally the results are not so
nice. For instance, here is one entry in Pt :
66 115 √ 209 √ √
Pt (α, α) = + exp((−27 + 5)t/2) + 5 exp((−27 + 5)t/2)
181 362 1810
209 √ √ 115 √
− 5 exp(−(27 + 5)t/2) + exp(−(27 + 5)t/2).
1810 362
0.0
0.00 0.25 0.50 0.75 1.00
6 BROWNIAN MOTION 79
6 Brownian motion
A Basic properties
(1) Independent increments: for s1 < t1 < s2 < t2 < · · · < sn < tn the
random variables Xt1 − Xs1 , . . . , Xtn − Xsn are independent.
(2) Stationarity: the distribution of Xt − Xs depends only on t − s.
(3) Continuous paths: the sample path t 7→ Xt (ω) is continuous with
probability 1.
Here the random variables Xt take values in the state space Rd for d ≥ 1,
the starting point X0 = x ∈ Rd can be anywhere, and E(Xt ) = µt for some
fixed µ ∈ Rd .
When µ 6= 0 we have Brownian motion with drift, while if d > 1 we call
(Xt ) multi-dimensional Brownian motion. Conditions (1)–(3) imply that
Xt has a (multivariate) normal distribution for t > 0.
From now on, we only consider the standard version of Brownian motion.
Brownian motion is a Markov process with transition kernel
1 2
P(Xt = y j X0 = x) = pt (x, y) = √ e−ky−xk /2t , y ∈ Rd .
( 2πt)d
This kernel satisfies the Chapman-Kolmogorov equation
Z
ps+t (x, y) = ps (x, z)pt (z, y) dz.
6 BROWNIAN MOTION 80
. .
. ........... ..........
•............................................................................................................................................. 10
.... ....... ...
.... ..
..
... . ..... ..
.................................................... .............
.... ............ ...............................................
.. .. .
... ................... . ..............
. ..... ............... ..
............ .......... ................. .................
.. .
............................................. ...............................................................................................
............................ .. ......................... ... .......
.......... .... ...................................
• ... . ...................... .................................................................................................
... ..............
..........
.... ................ .................
............ ................................ ........
.
......... ............................. ...
............. .......................... .... .................
................................. 5 ... . ..•
.....................
............................................
. . ..
...................... ... ..... .... ....
.
... .......... ........ ....
.......... .. ........................
.. .................... ... .....................
....... ..... ............
. . . . ................................
. ................... ............ .... ....
............ ........... ............................. .......................... ................... .. .... ......
....... ...................... .................... ........
..... ............................................. ..... . ..... ..............................................
............................ ... . .
............................................
.......................... ........................... . .. .
........... . . . . .
............................... ....... .................. ........................................................
.................................... ......................................................................... ..............
.......... .. ................................................ .. .................................... ...................
....... . ...... .
...... .. .......................... ..........................................................
. ... ......
................................................... .... ........... . .....
.......................................................... ....... .
........ ...... .. .. . .
.
.................... ................. ........................
-10 -5 . . .
................... ... ................... .....................................
............................. ............ ..
......... .
5 10
. ........................................ ............
... . . . . . . .. .. . .
. . . . ... . . . . .. .. .. . . ...
................................................................... ............................................
... . ........... ..... .... . ... ..
.... .. .... . ..............................
... ..
.....................................
-5
-10
√
so that, on average, d-dimensional Brownian motion is about dt units
from its starting position at time t.
p fact, the average speed of Brownian motion over [0, t] is E(kXt −X0 k)/t ∼
In
d/t. For large t, this is near zero while for small t, it is near ∞.
Proof:
² ³
(ω : Xt0 (ω) exists at t = 0) ⊆ ω : sup kXt (ω) − X0 (ω)k/t < ∞
0<t≤1
² ³
n
⊆ ω : sup 2 kX2−n (ω) − X0 (ω)k < ∞
n
² ³
n/2
⊆ ω : sup 2 kX2−n (ω) − X2−(n−1) (ω)k < ∞
n
∞ ²
[ ³
n/2
= ω : sup 2 kX2−n (ω) − X2−(n−1) (ω)k < k .
n
k=1
¡
Define Ak = ω : supn 2n/2 kX2−n (ω) − X2−(n−1) (ω)k < k . The random vari-
ables Zn := 2n/2 (X2−n − X2−(n−1) ) are i.i.d. multivariate normal, so
X XY
P (ω : Xt0 (ω) exists at t = 0) ≤ P(Ak ) = P(kZn k < k) = 0.
k k n
u
t
By the three ingredients (1)–(3) that define Brownian motion, we see that
for any fixed s ≥ 0, the process (Xt+s − Xs ) is a Brownian motion indepen-
dent of Fs that starts at the origin. In other words, (Xt+s ) is a Brownian
motion, independent of Fs , with random starting point Xs .
An important generalization says that if T is a finite stopping time then
(XT +t ) is independent of FT , with random starting point XT .
Suppose Xt is a standard 1-dimensional Brownian motion starting at x,
and let x < b. We will prove that
P (Xs ≥ b for some 0 ≤ s ≤ t) = 2P(Xt ≥ b).
6 BROWNIAN MOTION 82
This follows from stopping the process at Tb , the first time (Xt ) hits the
point fbg, then using symmetry. The picture below will help you to under-
stand the calculation:
1
P(Xt ≥ b) = P(Xt ≥ b j Tb ≤ t)P(Tb ≤ t) = P(Tb ≤ t),
2
which gives the result.
... ..
....
..
.
Tb t
In particular Xt must return to its starting point. You can extend this
argument to prove
Now let T be the hitting time of the set fa, bg. Since (Xt ) is a martingale,
we have
x = Ex (X0 ) = Ex (XT ) = aPx (XT = a) + bPx (XT = b).
Using the fact that Px (XT = a) + Px (XT = b) = 1, we can conclude that
Px (XT = b) = (x − a)/(b − a).
Just like for the symmetric random walk, (Xt2 − t) is a martingale so
Ex (X02 − 0) = Ex (XT2 − T )
x2 = a2 Px (XT = a) + b2 Px (XT = b) − Ex (T ).
The previous result plus a little algebra shows that
Ex (T ) = (b − x)(x − a).
If we let a → −∞, we find that, although Px (Tb < ∞), we have Ex (Tb ) = ∞.
Let us explore the connection with the heat equation on a bounded region
D of Rd . We fix a temperature distribution g on ∂D (the boundary) for all
time, and begin with an initial temperature distribution f in D at time 0.
The latter distribution will flow and eventually dissipate completely.
The solution to the heat equation for x ∈ D can be expressed as
¡
u(t, x) = Ex f(Xt )1ft<T g + g(XT )1ft≥T g ,
where T is the time when the process first hits the boundary. Letting
t → ∞ we arrive at
v(x) = Ex (g(XT )), (1)
the solution to the Dirichlet problem. That is, v is harmonic (∆v(x) =
0) inside D, and v = g on ∂D. For bounded regions D with smooth
boundaries, formula (1) gives the unique solution to the Dirichlet problem.
Example C-1 Let’s apply this result to a problem we already solved using
martingales. Let (Xt ) be 1-dimensional Brownian motion, D = (a, b), and
put g(a) = 0 and g(b) = 1. For d = 1, “harmonic” means “linear” so we
solve the problem with a straight line segment with the right boundary
conditions. This gives us
x−a
v(x) = Ex (g(XT )) = Px (XT = b) = .
b−a
6 BROWNIAN MOTION 85
....
......... ....
......... ...
.........
.
................ ...
...
..
.........
................
.
...
...
..
............ ...
.............. ...
.............. ...
...
........... ...
. ...
........... . . .
.............................................................................................................................................................................................................................
a x b
...
....
.
...
x. ...
...
...
...
..
. .
.. ..
....................... ...
.... .. .
...... ....... ...
... ..... ....
...
...
... ... . ...
.... ..... R 1 ...
... ...
...
...
...
←... ....................
...
... ..
..
.
...
..
.
.....
.
.
....
.
..
... ... ....... . .
. .
..
.........
...
.......... ..... ...
... ..... ...
...
R ..... ............................
...
...
2 ........... ...
..
.. .
... .... ..
.... ...
...
.
..... ..
.....
..... ......
.....
....
...... ..
...... ......
........ ......
.......... ........
..............................................
So we can write
°P ±1/2
d 2
v(x) = φ(r), where r = i=1 xi .
Two dimensional Brownian motion will hit any ball, no matter how small,
from any starting point. If we pursue this argument, we can divide R2
using a fine grid, and find that 2-d Brownian motion will visit every section
infinitely often.
On the other hand, if we leave R2 alone and let R1 → 0, we get
Two dimensional Brownian motion will never hit any particular point. The
process is neighborhood recurrent but not point recurrent.
It turns out that whether or not d-dimensional Brownian motion will hit
a set depends on its fractional dimension. The process can hit sets of
dimension greater than d − 2, but cannot hit sets of dimension less than
d − 2. In the d − 2 case, it depends on the particular set.
7 STOCHASTIC INTEGRATION 88
7 Stochastic integration
Y0 0 ≤ t < t1
Y t ≤ t < t
1 1 2
Yt = .. ..
. .
Y n tn ≤ t < ∞
We assume E(Yi2 ) < ∞ and Yi ∈ Fti for all i. Then it makes sense to define:
for tj < t ≤ tj+1
Z t j
X
Zt = Ys dWs = Yi−1 [Wti − Wti−1 ] + Yj [Wt − Wtj ].
...
0 i=1
...
..
...
...
...
...
... ...
... ...
... ...
... ...
... ...
... ...
... ...
...
...
··· ...
...
... ...
... ...
... ...
... ...
... ..
....................................................................................................................................................................................................................................................................................................... .
0 t1 t2 t3 ··· tj t tj+1
Here are some facts about the integral we’ve defined
7 STOCHASTIC INTEGRATION 90
k−1
X
E(Zt − Zs j Fs ) = E(Ztj − Zs j Fs ) + E(Zti+1 − Zti j Fs ) + E(Zt − Ztk j Fs )
i=j
k−1
X
= E(Ztj − Zs j Fs ) + E(E(Zti+1 − Zti j Fti ) j Fs )
i=j
+E(E(Zt − Ztk j Ftk ) j Fs )
= 0.
Rt
3. Variance formula: E(Zt2 ) = 0 E(Ys2 ) ds. This follows exactly as for
integration with respect to random walk.
The linearity, martingale property, and variance formula carry over to (Zt ).
Rt
Then Zt is a normal random variable with mean zero and variance 0 f 2 (s) ds.
We can show that Zt has independent increments as well, so that Z is just
a time changed Brownian motion
² ³
t
2
Zt = B ∫ f (s) ds .
0
C Ito’s formula
¡2
The intuition behind Ito’s formula is that you can replace W(j+1)t/n − Wjt/n
by t/n with only a small amount of error. Therefore
n−1
X
f 0 (Wjt/n ) W(j+1)t/n − Wjt/n
¡
f(Wt ) = f(W0 ) +
j=0
7 STOCHASTIC INTEGRATION 92
n−1 n−1
1 X 00 X
+ f (Wjt/n ) (t/n) + o(t/n) + error .
2 j=0 j=0
Z t Z t
0 1
f(Wt ) = f(W0 ) + f (Ws ) dWs + f 00 (Ws ) ds.
0 2 0
Rt
Example C-1 Suppose we want to calculate 0 Ws dWs . The definition
gets us nowhere so we try to apply the usual rules of calculus
Z t Z t
2 2
Ws dWs = Wt − W0 − Ws dWs ,
0 0
Rt
which implies 0 Ws dWs = [Wt2 − W02 ]/2. The only problem is that this
formula is false! Since W0 = 0, we can see that it is fishy by taking expec-
tations on both sides: the left hand side gives zero but the right hand side
is strictly positive.
The moral of this example is that the usual rulesR of calculus do not apply
t
to stochastic integrals. So how do we calculate 0 Ws dWs correctly? Let
f(t) = t2 , so f 0 (t) = 2t and f 00 (t) = 2. From Ito’s formula we find
Z t
1 t
Z Z t
2 2
Wt = W0 + 2Ws dWs + 2 ds = 2 Ws dWs + t,
0 2 0 0
and therefore Z t
1 2 ¡
Ws dWs = Wt − t .
0 2
A more advanced version of Ito’s formula can handle functions that depend
on t as well as x:
Z t Z t Z t
1
f(t, Wt ) = f(0, W0 ) + ∂s f(s, Ws ) ds + ∂x f(s, Ws ) dWs + ∂xx f(s, Ws ) ds.
0 0 2 0
7 STOCHASTIC INTEGRATION 93
How do we solve this equation? Guess! Let Xt = exp(at + bWt ). From Ito’s
formula with f(t, x) = exp(at + bx) we get
t t
1 t 2
Z Z Z
Xt = X0 + aXs ds + bXs dWs + b Xs ds
0 0 2 0
Z t Z t
b2
= X0 + (a + ) Xs ds + b Xs dWs
2 0 0
8 Appendix
We begin with the formula from page 2 for joint probabilities as products
of transition probabilities, both in its unconditional
P(X0 = i0 , X1 = i1 , . . . , Xn = in ) = φ(i0 ) p(i0 , i1 ) · · · p(in−1 , in ), (1)
and conditional form
Pi0 (X1 = i1 , . . . , Xn = in ) = p(i0 , i1 ) p(i1 , i2 ) · · · p(in−1 , in ). (2)
On the right hand side, bring the conditional expectation inside the un-
conditional expectation, and then replace in by Xn :
E(1[X0 =i0 ,...,Xn =in ] g(Xn , . . . , Xn+m )) = E(1[X0 =i0 ,...,Xn =in ] Ein (g(X0 , . . . , Xm )))
Hitting times and visit times. Recall that for a subset E ⊆ S, we define
TE = inf(n ≥ 1 : Xn ∈ E)
VE = inf(n ≥ 0 : Xn ∈ E).
Theorem A-2 If u(x) = Px (VE < ∞), then (P u)(x) = Px (TE < ∞)
The exact formula is not so important, but rather the fact that TE =
1 + f(X1 , X2 , . . .). The strong Markov property, with T ≡ 1 and g = 1(f <∞)
gives us the result. u
t
Proof: We begin with the special case n = N . Since the chain is ir-
reducible, it is possible to go from any state i to any state j. Consider
the shortest non-trivial path between them that has non-zero probability,
say i → s2 → s3 → · · · → sK → j. Because it is the shortest path, there
aren’t any repeats in the set fi, s2 , . . . , sK g, as we could remove unneces-
sary loops to get a shorter path with larger probability. With no repeats
we have K ≤ N , so there are at most N transitions in the path, and hence
Pi (T > N ) = Pi (Xm 6= j, m = 1, . . . , N) = 1 − δi < 1.
Now define δ = inffδi j i ∈ Sg so δ > 0, and
Pi (T > N ) ≤ 1 − δ.
Using the initial distribution of X0 we also get
P(T > N ) ≤ 1 − δ.
Now let’s try the case n = 2N . Define f(x1 , . . . , xN ) = 1[x1 6=j,...,xN 6=j] and
use the Markov property (4) at N to get
P(T > 2N ) = E(f(X1 , . . . , XN )f(XN +1 , . . . , X2N ))
= E[f(X1 , . . . , XN )EXN (f(X1 , . . . , XN ))]
≤ (1 − δ) E[f(X1 , . . . , XN )]
≤ (1 − δ)2 .
In a similar manner, we can show that for every integer q ≥ 0 we have
P(T > qN ) ≤ (1 − δ)q .
For general n we write n = qN + r where 0 ≤ r < N , and note that the
probability on the left of (5) is decreasing in n. Therefore
P(T > n) ≤ (1 − δ)q ≤ (1 − δ)−1 (1 − δ)n/N ,
which gives us the required result with C = (1 − δ)−1 and ρ = (1 − δ)1/N .
It follows that
∞ ∞
X X C
E(T ) = P(T > n) ≤ Cρn = < ∞.
n=0 n=0
1−ρ
8 APPENDIX 98
Proof: Define
n
1X
g(x0 , x1 , . . .) = lim sup 1(x =j)
n n k=1 k
n n
1X 1X
h(x0 , x1 , . . .) = lim sup 1(xk =j) − lim inf 1(x =j) .
n n k=1 n n k=1 k
where (6) holds for functions f that don’t depend on the first few coor-
dinates, and such that f(x0 , x1 , . . .) = 0 when xk 6= j for all k ≥ 0. The
functions g and h defined above satisfy both conditions.
Ej (g(X0 , X1 , . . .)) = 0.
8 APPENDIX 99
Proof:
˰ !
X
Ex (R) = Ex 1(Xn =x)
n=0
˰ !
X
= 1 + Ex 1(Xn =x)
À n=1 ∞
!
X
= 1 + Ex 1(Tx <∞) 1(Xn =x)
n=1
À ∞
!
X
= 1 + Ex 1(Tx <∞) 1(Xn =x)
n=Tx
À ∞
!
X
= 1 + Ex 1(Tx <∞) EXTx ( 1(Xn =x) )
À n=0
∞
!
X
= 1 + Px (Tx < ∞) Ex 1(Xn =x)
n=0
= 1 + Px (R > 1) Ex (R).
u
t
B Matrix magic
X
Pijn = pik1 pk1 k2 · · · pkn−1 j = Pi (Xn = j).
k1 ,...,kn−1 ∈S
The left hand side is the (i, j)th entry of the matrix P n , while the middle
adds the probabilities of all paths of length n from state i to state j. The
right hand side explains in terms of probability.
8 APPENDIX 100
Divide the sample space S into disjoint pieces D and E, and define Q as
the submatrix of P of transition probabilities from D into itself.
Formula 1: For i, j ∈ D, we have
X
Qnij = pik1 pk1 k2 · · · pkn−1 j .
k1 ,...,kn−1 ∈D
The sum is over all paths of length n from state i to state j that stay
inside D. So in probability terms
= Ei (TE ).
which gives
X
(Qn S)ij = Pi (Xn = k, TE > n)P(Xn+1 = j j Xn = k, TE > n, X0 = i)
k∈D
8 APPENDIX 101
X
= Pi (Xn+1 = j, Xn = k, TE > n)
k∈D
= Pi (Xn+1 = j, TE > n)
= Pi (XTE = j, TE = n + 1)
Define the function u1 (x) = supy : x→y f(y), where the supremum is taken
over all states y that can be reached from x.
We first show that u1 is superharmonic. Suppose x, z ∈ S and that you
can reach x from z. Then any state y that can be reached from x, can also
be reached from z and therefore u1 (x) ≤ u1 (z). Thus
X X X
(P u1 )(z) = u1 (x)p(z, x) = u1 (x)p(z, x) ≤ u1 (z)p(z, x) ≤ u1 (z).
x∈S x∈S,z→x x∈S,z→x
In fact, in any recurrent class in S, the state z with the maximum f value
satisfies f(z) = u1 (z) and hence f(z) = u∞ (z). Since the Markov chain
must eventually visit all states of some recurrent class, we see that Px (T <
∞) = 1.
104
INDEX 105
payoff function, 39
Poisson process, 74
Polya’s urn, 72
positive, 16
positive class, 17
positive recurrent, 35
stochastic integral, 90
stopping time, 3, 11, 39, 65
strategy, 39