Markov Chains
Markov Chains
◮ We can write it as
π0 (x) = P r[X0 = x]
0
1
1-q
1-p
q
P r[X0 = 1, X1 = 1, X2 = 1]
P r[X1 = 1, X2 = 1|X0 = 1] =
P r[X0 = 1]
π(1)P (1, 1)P (1, 1)
=
π(1)
◮ We may want to know about limn→∞ P r[Xn = 1]
p p p p ...
...
i-1 i i+1
i-1 i i+1
0 N
1 i-1 i i+1
0 N
P r[Xm+n+r ∈ Br , r = 0, · · · , s | Xm = x, Xm−k ∈ Ak , k = 1, · · · , m]
= P r[Xm+n+r ∈ Br , r = 0, · · · , s | Xm = x]
◮ In particular
X
πn+1 (y) = P r[Xn+1 = y|Xn = x] P r[Xn = x]
x
X
= πn (x)P (x, y)
x
Ty = min{n > 0 : Xn = y}
G(x, y) , Ex [Ny ]
"∞ #
X
= Ex Iy (Xn )
n=1
∞
X
= Ex [Iy (Xn )]
n=1
X∞
= P n (x, y)
n=1
0 if ρxy = 0
Px [Ny = ∞] = ρxy , and G(x, y) =
∞ if ρxy > 0
X
G(x, y) = Ex [N (y)] = mPx [N (y) = m]
m
X
m−1
= m ρxy ρyy (1 − ρyy )
m
∞
X
m−1
= ρxy m ρyy (1 − ρyy )
m=1
1
= ρxy < ∞, because ρyy < 1
1 − ρyy
⇒ Px [N (y) < ∞] = 1
Py [N (y) ≥ m] = ρm
yy = 1, ∀m
⇒ Py [N (y) = ∞] = lim Py [N (y) ≥ m] = 1
m→∞
⇒ G(y, y) = Ey [N (y)] = ∞
m−1
Px [N (y) ≥ m] = ρxy ρyy = ρxy , ∀m
Hence Px [N (y) = ∞] = ρxy
We know G(x, x) = ∞ m
P
m=1 P (x, x) = ∞
◮
∞
X ∞
X ∞
X
m m
P (y, y) ≥ P (y, y) = P n1 +n+n0 (y, y)
m=1 m=n0 +n1 +1 n=1
X∞
≥ P (y, x)P n (x, x)P n0 (x, y)
n1
n=1
= ∞, because x is recurrent
⇒ y is recurrent
◮ Let A = { mn
| m, n are integers}
◮ Define relation R by
m p
, ∈ R if mq = np
n q
◮ This is the usual equality of fractions
◮ Easy to check it is an equivalence relation.
A = C1 + C2 + · · ·
Where Ci satisfy
◮ x, y ∈ Ci ⇒ (x, y) ∈ R, ∀i
◮ x ∈ Ci , y ∈ Cj , i 6= j ⇒ (x, y) ∈
/R
◮ In our example, each equivalence class corresponds to a
rational number.
◮ Here, Ci contains all fractions that are equal to that
rational number
SR = C 1 + C 2 + · · ·
0 1 2 3 4 5
0 + − − − − −
1 + + + − − −
2 − + + + − +
3 − − − + + −
4 − − − − + +
5 − − − + − +
0.4
0.5 0.2
◮ Suppose S is finite.
Then π can be represented by a column vector.
◮ The π is stationary if
πT = πT P or P T π = π
◮ Hence, if π0 = π then π1 = π
and hence πn = π, ∀n
◮ Hence the name, stationary distribution.
◮ It is also called the invariant distribution or the invariant
measure
P T π = π or PT − I π = 0
0.25
0.75
0.25
0.75
0.25
0.75
1
0.75π(0) + 0.5π(1) = π(0) ⇒ π(1) = π(0)
2
1
0.25π(0) + 0.75π(2) = π(1) ⇒ π(2) = π(0)
3
0.5π(1) + 0.25π(2) = π(2)
1 1
π(0) + π(1) + π(2) = 1 ⇒ π(0) 1 + + =1
2 3
1.0 0.5
0 1 0.5 2
1.0
X
π(y) = π(x)P (x, y), ∀y ∈ S
x∈S
= Py [Wy1 = k2 ]
⇒ identically distributed
k
Tyk 1X r
lim = lim Wy = my , (w.p.1)
k→∞ k k→∞ k
r=1
◮ Now we have
N (y) N (y)+1
Ty n n Ty n
≤ <
Nn (y) Nn (y) Nn (y)
◮ We know that
◮ As n → ∞, Nn (y) → ∞, w.p.1
Tn
◮ As n → ∞, ny → my , w.p.1
◮ Hence we get
n
lim = my , w.p.1
n→∞ Nn (y)
or
Nn (y) 1
lim = , w.p.1
n→∞ n my
P S Sastry, IISc, E1 222, Lecture 19 2020 72/136
◮ All this is true if the chain started in y.
◮ That means it is true if the chain visits y once.
◮ So, we get
◮ Note that
n
1 Gn (y, y) 1X m
= lim = lim P (y, y)
my n→∞ n n→∞ n
m=1
Nn (y) 1
lim = =0
n→∞ n my
◮ Thus the limiting fraction of time spent by the chain in
transient and null recurrent states is zero.
n
1 X n1 +m+n0 1
⇒ lim P (y, y) =
n→∞ n my
m=1
1 1
⇒ ≥ P n1 (y, x) P n0 (x, y) > 0
my mx
which implies y is positive recurrent
P S Sastry, IISc, E1 222, Lecture 19 2020 78/136
◮ Thus, in a closed irreducible set of recurrent states, if one
state is positive recurrent then all are positive recurrent.
◮ Hence, in the partition: SR = C1 + C2 + · · · , each Ci is
either wholly positive recurrent or wholly null recurrent.
◮ We next show that a finite chain cannot have any null
recurrent states.
P m (x, y) = 1, ∀m, ∀x ∈ C.
P
◮ Since C is closed, y∈C
◮ Thus we get
n n
1 XX m X1X
1= P (x, y) = P m (x, y), ∀n
n m=1 y∈C y∈C
n m=1
X1X n n
m
X 1X m
⇒ 1 = lim P (x, y) = lim P (x, y) = 0
n→∞
y∈C
n m=1 y∈C
n→∞ n
m=1
q(2)
0 1 2 3 4 ...
q(1)
q(3)
q(2)
0 1 2 3 4 ...
q(1)
q(3)
We have
P0 [T0 = j + 1] = q(j), j = 1, 2, · · ·
(Note that P0 [T0 = 1] = 0)
X∞ X∞
P0 [T0 < ∞] = P0 [T0 = j] = q(j) = 1
j=2 j=1
q(2)
0 1 2 3 4 ...
q(1)
q(3)
◮
∞
X ∞
X ∞
X
m0 = j Po [T0 = j] = j q(j − 1) = (j + 1)q(j)
j=2 j=2 j=1
Then
X X X
lim a(x) bn (x) = a(x) lim bn (x) = a(x) b(x)
n→∞ n→∞
x∈S x∈S x∈S
0 0 1 0
0 1 2 3
1 2/3 1/3
0 1 0 0 1/3 0 2/3 0
1/3 0 2/3 0 2 0 7/9 0 2/9
0 2/3 0 1/3 , P = 2/9 0 7/9 0
P =
0 0 1 0 0 2/3 0 1/3
0 1 2 3 4
ri
ri
X
π(y) = π(x)P (x, y)
x
q
x-1
x
...
x-1
...
x+1 p
p p x+1
x-1 x
rx-1 rx rx+1
◮ We get
q
x-1
x
...
x-1
...
x+1 p
p p x+1
x-1 x
rx-1 rx rx+1
q
x-1
x
...
x-1
...
x+1 p
p p x+1
x-1 x
rx-1 rx rx+1
qy qy−1 · · · qa+1
Let γy = , a < y < b, γa = 1
py py−1 · · · pa+1
Now we get
γx
U (x + 1) − U (x) = [U (a + 1) − U (a)]
γa
q
x-1
x
...
x-1
...
x+1 p
p p x+1
x-1 x
rx-1 rx rx+1
1 i-1 i i+1
0 N
x
q
◮ Then, γx = p
◮ Hence, for a Gambler’s ruin chain we get, e.g.,
i
q
Pi−1
γ p
−1
x
Pi [TN < T0 ] = PNx=0
−1
= N
x=0 γx
q
p
−1
ri
∞
X
P1 [T0 < ∞] = 1 ⇒ γx = ∞
x=0
P∞
◮ Suppose x=0 γx = ∞ ⇒ P1 [T0 < ∞] = 1
∞ x
X q
Transient if <∞ ⇔ q<p
x=0
p
∞ x
X q
Recurrent if =∞ ⇔ q≥p
x=0
p
◮ Intuitively clear
◮ This chain with q < p is an example of an irreducible
chain that is wholly transient
◮ Let px = p, qx = q
∞ ∞ j
X X p
ηj = <∞ ⇔ p<q
j=0 j=0
q
1-p
0 +1
... ...
-1 p p p
1-p
0 +1
... ...
-1 p p p
√
◮ We use Stirling approximation: n! ∼ nn+0.5 e−n 2π.
(2n)! n
P 2n (0, 0) ∼ 2n
Cn pn (1 − p)n = p (1 − p)n
√ n!n!
(2n)2n+0.5 e−2n 2π
= (p(1 − p))n
nn+0.5 nn+0.5 e−n e−n (2π)
√
22n 2n
= √ (p(1 − p))n
n 2π
(4p(1 − p))n
= √
πn
1-p
0 +1
... ...
-1 p p p
n
1X X Nn (j) X
⇒ lim r(Xm ) = r(j) lim = r(j)π(j)
n→∞ n n→∞ n
m=1 j∈S j∈S
◮ Choose
π(j)q(j, i) b(j)q(j, i)
α(i, j) = min ,1 = min ,1
π(i)q(i, j) b(i)q(i, j)
◮ Note that one of α(i, j), α(j, i) is 1
π(j)q(j, i)
suppose α(i, j) = < 1
π(i)q(i, j)
⇒ π(i) q(i, j) α(i, j) = π(j) q(j, i)
= π(j) q(j, i) α(j, i)