Math 20, Fall 2017 Edgar Costa Week 9 Dartmouth College Edgar - - PowerPoint PPT Presentation

math 20 fall 2017
SMART_READER_LITE
LIVE PREVIEW

Math 20, Fall 2017 Edgar Costa Week 9 Dartmouth College Edgar - - PowerPoint PPT Presentation

Math 20, Fall 2017 Edgar Costa Week 9 Dartmouth College Edgar Costa Math 20, Fall 2017 Week 9 1 / 23 Absorbing Markov Chains Markov chain is absorbing if it has at least one absorbing state, and if from every state it is possible to go


slide-1
SLIDE 1

Math 20, Fall 2017

Edgar Costa Week 9

Dartmouth College

Edgar Costa Math 20, Fall 2017 Week 9 1 / 23

slide-2
SLIDE 2

Absorbing Markov Chains

  • A state si of a Markov chain is called absorbing if it is impossible to leave it

(i.e., pii = 1).

  • Markov chain is absorbing if it has at least one absorbing state, and if from

every state it is possible to go to an absorbing state (not necessarily in one step).

  • In an absorbing Markov chain, a state which is not absorbing is called

transient.

Edgar Costa Math 20, Fall 2017 Week 9 2 / 23

slide-3
SLIDE 3

Absorbing Markov Chains

  • A state si of a Markov chain is called absorbing if it is impossible to leave it

(i.e., pii = 1).

  • Markov chain is absorbing if it has at least one absorbing state, and if from

every state it is possible to go to an absorbing state (not necessarily in one step).

  • In an absorbing Markov chain, a state which is not absorbing is called

transient.

Edgar Costa Math 20, Fall 2017 Week 9 2 / 23

slide-4
SLIDE 4

Absorbing Markov Chains

  • A state si of a Markov chain is called absorbing if it is impossible to leave it

(i.e., pii = 1).

  • Markov chain is absorbing if it has at least one absorbing state, and if from

every state it is possible to go to an absorbing state (not necessarily in one step).

  • In an absorbing Markov chain, a state which is not absorbing is called

transient.

Edgar Costa Math 20, Fall 2017 Week 9 2 / 23

slide-5
SLIDE 5

Example - Drunkard’s Walk

A man walks along a four-block stretch of Park Avenue. If he is at corner 1, 2 or 3, he walks to the left or right with equal probability. He continues like this, until he reaches corner 4, which is a bar, or corner 0, which is his home. If he reaches either home or the bar, he stays there.

Edgar Costa Math 20, Fall 2017 Week 9 3 / 23

slide-6
SLIDE 6

Example - Drunkard’s Walk

A man walks along a four-block stretch of Park Avenue. If he is at corner 1, 2 or 3, he walks to the left or right with equal probability. He continues like this, until he reaches corner 4, which is a bar, or corner 0, which is his home. If he reaches either home or the bar, he stays there.

Edgar Costa Math 20, Fall 2017 Week 9 3 / 23

slide-7
SLIDE 7

The Transition Matrix - Drunkard’s Walk

P = 1 2 3 4               1 2 3 4

Edgar Costa Math 20, Fall 2017 Week 9 4 / 23

slide-8
SLIDE 8

The Transition Matrix - Drunkard Walk

P = 1 2 3 4               1 1 1/2 1/2 2 1/2 1/2 3 1/2 1/2 4 1

Edgar Costa Math 20, Fall 2017 Week 9 5 / 23

slide-9
SLIDE 9

Absorbing Markov Chain

Canonical Form

  • For an absorbing Markov chain, renumber the states so that the transient

states come first.

  • If there are r absorbing states and t transient states, the transition matrix

will have the following canonical form P Trans Absorb Trans Q R Absorb I

  • The first t states are transient and the last r states are absorbing.
  • I is an r

r identity matrix, 0 is an r t zero matrix, R is a nonzero t r matrix, and Q is an t t matrix.

Edgar Costa Math 20, Fall 2017 Week 9 6 / 23

slide-10
SLIDE 10

Absorbing Markov Chain

Canonical Form

  • For an absorbing Markov chain, renumber the states so that the transient

states come first.

  • If there are r absorbing states and t transient states, the transition matrix

will have the following canonical form P Trans Absorb Trans Q R Absorb I

  • The first t states are transient and the last r states are absorbing.
  • I is an r

r identity matrix, 0 is an r t zero matrix, R is a nonzero t r matrix, and Q is an t t matrix.

Edgar Costa Math 20, Fall 2017 Week 9 6 / 23

slide-11
SLIDE 11

Absorbing Markov Chain

Canonical Form

  • For an absorbing Markov chain, renumber the states so that the transient

states come first.

  • If there are r absorbing states and t transient states, the transition matrix

will have the following canonical form P Trans Absorb Trans Q R Absorb I

  • The first t states are transient and the last r states are absorbing.
  • I is an r

r identity matrix, 0 is an r t zero matrix, R is a nonzero t r matrix, and Q is an t t matrix.

Edgar Costa Math 20, Fall 2017 Week 9 6 / 23

slide-12
SLIDE 12

Absorbing Markov Chain

Canonical Form

  • For an absorbing Markov chain, renumber the states so that the transient

states come first.

  • If there are r absorbing states and t transient states, the transition matrix

will have the following canonical form P = Trans Absorb. ( ) Trans Q R Absorb. I

  • The first t states are transient and the last r states are absorbing.
  • I is an r

r identity matrix, 0 is an r t zero matrix, R is a nonzero t r matrix, and Q is an t t matrix.

Edgar Costa Math 20, Fall 2017 Week 9 6 / 23

slide-13
SLIDE 13

Absorbing Markov Chain

Canonical Form

  • For an absorbing Markov chain, renumber the states so that the transient

states come first.

  • If there are r absorbing states and t transient states, the transition matrix

will have the following canonical form P = Trans Absorb. ( ) Trans Q R Absorb. I

  • The first t states are transient and the last r states are absorbing.
  • I is an r

r identity matrix, 0 is an r t zero matrix, R is a nonzero t r matrix, and Q is an t t matrix.

Edgar Costa Math 20, Fall 2017 Week 9 6 / 23

slide-14
SLIDE 14

Absorbing Markov Chain

Canonical Form

  • For an absorbing Markov chain, renumber the states so that the transient

states come first.

  • If there are r absorbing states and t transient states, the transition matrix

will have the following canonical form P = Trans Absorb. ( ) Trans Q R Absorb. I

  • The first t states are transient and the last r states are absorbing.
  • I is an r × r identity matrix, 0 is an r × t zero matrix, R is a nonzero t × r

matrix, and Q is an t × t matrix.

Edgar Costa Math 20, Fall 2017 Week 9 6 / 23

slide-15
SLIDE 15

Canonical Form

  • Recall that the entry p(n)

ij

  • f the matrix Pn is the probability of being in the

state sj after n steps, when the chain is started in state si.

  • where

Pn = Trans Absorb. ( ) Trans Qn ? Absorb. I

  • What is the probability that the process will be absorbed?

Edgar Costa Math 20, Fall 2017 Week 9 7 / 23

slide-16
SLIDE 16

Canonical Form

  • Recall that the entry p(n)

ij

  • f the matrix Pn is the probability of being in the

state sj after n steps, when the chain is started in state si.

  • where

Pn = Trans Absorb. ( ) Trans Qn ? Absorb. I

  • What is the probability that the process will be absorbed?

Edgar Costa Math 20, Fall 2017 Week 9 7 / 23

slide-17
SLIDE 17

Probability of Absorption

Theorem In an absorbing Markov chain, the probability that the process will be absorbed is 1. In other words, lim

n

Qn Pn Trans Absorb Trans Qn Absorb I

Edgar Costa Math 20, Fall 2017 Week 9 8 / 23

slide-18
SLIDE 18

Probability of Absorption

Theorem In an absorbing Markov chain, the probability that the process will be absorbed is 1. In other words, lim

n→+∞ Qn = 0.

Pn Trans Absorb Trans Qn Absorb I

Edgar Costa Math 20, Fall 2017 Week 9 8 / 23

slide-19
SLIDE 19

Probability of Absorption

Theorem In an absorbing Markov chain, the probability that the process will be absorbed is 1. In other words, lim

n→+∞ Qn = 0.

Pn = Trans Absorb. ( ) Trans Qn ? Absorb. I

Edgar Costa Math 20, Fall 2017 Week 9 8 / 23

slide-20
SLIDE 20

How many steps until the process gets absorbed?

Write Pn = Trans Absorb. ( ) Trans Qn Bn Absorb. I , then (I + Q + Q2 + · · · + Qn−1)R B Equivalently, I Q Q2 Qn

1

Edgar Costa Math 20, Fall 2017 Week 9 9 / 23

slide-21
SLIDE 21

How many steps until the process gets absorbed?

Write Pn = Trans Absorb. ( ) Trans Qn Bn Absorb. I , then (I + Q + Q2 + · · · + Qn−1)R − → B =? Equivalently, I + Q + Q2 + · · · + Qn−1 − →?

Edgar Costa Math 20, Fall 2017 Week 9 9 / 23

slide-22
SLIDE 22

The Fundamental Matrix

Theorem For an absorbing Markov chain the matrix I − Q is invertible and (I − Q)−1 = N = I + Q + Q2 + · · · For an absorbing Markov chain the matrix N = (I − Q)−1 is called the fundamental matrix for P. Pn = ( Qn (I + Q + Q2 + · · · + Qn−1)R I ) − → ( N · R I ) (as n → +∞) Can you interpret the entries of B = N · R and N? Bi,j = probability of being absorbed by the state sj, given that it started in si. Ni,j = number of expected times that the process is in the transient state sj, given that it started in si.

Edgar Costa Math 20, Fall 2017 Week 9 10 / 23

slide-23
SLIDE 23

Absorption Probabilities Time to Absorption

Theorem Write N = (I − Q)−1 = I + Q + Q2 + · · · + Qn + · · · and B = N · R.

  • Ni,j = number of expected times that the process is in the transient state sj,

given that it started in si.

  • Bi,j = probability of being absorbed by the state sj, given that it started in si.

Proof idea: How did you compute the expected value of the geometric distribution?

Edgar Costa Math 20, Fall 2017 Week 9 11 / 23

slide-24
SLIDE 24

Absorption Probabilities Time to Absorption

Theorem Write N = (I − Q)−1 = I + Q + Q2 + · · · + Qn + · · · and B = N · R.

  • Ni,j = number of expected times that the process is in the transient state sj,

given that it started in si.

  • Bi,j = probability of being absorbed by the state sj, given that it started in si.

Proof idea: How did you compute the expected value of the geometric distribution?

Edgar Costa Math 20, Fall 2017 Week 9 11 / 23

slide-25
SLIDE 25

Drunkard’s Walk example

P = 1 2 3 4               1 1/2 1/2 2 1/2 1/2 3 1/2 1/2 1 4 1 Identify Q and I − Q and N = (I − Q)−1

Edgar Costa Math 20, Fall 2017 Week 9 12 / 23

slide-26
SLIDE 26

Drunkard’s Walk example

N = 1 2 3     1 3/2 1 1/2 2 1 2 1 3 1/2 1 3/2 and B = NR = 4 1 3 4 1 4 2 1 2 1 2 3 1 4 3 4

Edgar Costa Math 20, Fall 2017 Week 9 13 / 23

slide-27
SLIDE 27

Drunkard’s Walk example

N = 1 2 3     1 3/2 1 1/2 2 1 2 1 3 1/2 1 3/2 and B = NR = 4     1 3/4 1/4 2 1/2 1/2 3 1/4 3/4

Edgar Costa Math 20, Fall 2017 Week 9 13 / 23

slide-28
SLIDE 28

Time to Absorption

Theorem Let ti be the expected number of steps before the chain is absorbed, given that the chain starts in state si, and let t be the column vector whose ith entry is ti. Then t = Nc, where c is a column vector all of whose entries are 1.

Edgar Costa Math 20, Fall 2017 Week 9 14 / 23

slide-29
SLIDE 29

Summary: Absorbing Markov Chains

  • P =

Trans Absorb. ( ) Trans Q R Absorb. I

  • The probability of the process being absorbed is 1.
  • limn→+∞ Pn = limn→+∞

( Qn (I + Q + Q2 + · · · + Qn−1)R I ) = ( N · R I )

  • N tells us about the expected number steps in a certain state until

absorption or the total time to absorption

  • N · R tells us the probability by which state the process will be absorved

Edgar Costa Math 20, Fall 2017 Week 9 15 / 23

slide-30
SLIDE 30

Ergodic Markov Chains

  • A Markov chain is called an ergodic chain if it is possible to go from every

state to every state (not necessarily in one move).

  • A Markov chain is called a regular chain if some power of the transition

matrix has only positive elements. In other words, for some n, it is possible to go from any state to any state in exactly n steps.

  • Every regular chain is ergodic. On the other hand, an ergodic chain is not

necessarily regular. Example?

Edgar Costa Math 20, Fall 2017 Week 9 16 / 23

slide-31
SLIDE 31

Ergodic Markov Chains

  • A Markov chain is called an ergodic chain if it is possible to go from every

state to every state (not necessarily in one move).

  • A Markov chain is called a regular chain if some power of the transition

matrix has only positive elements. In other words, for some n, it is possible to go from any state to any state in exactly n steps.

  • Every regular chain is ergodic. On the other hand, an ergodic chain is not

necessarily regular. Example?

Edgar Costa Math 20, Fall 2017 Week 9 16 / 23

slide-32
SLIDE 32

Ergodic Markov Chains

  • A Markov chain is called an ergodic chain if it is possible to go from every

state to every state (not necessarily in one move).

  • A Markov chain is called a regular chain if some power of the transition

matrix has only positive elements. In other words, for some n, it is possible to go from any state to any state in exactly n steps.

  • Every regular chain is ergodic. On the other hand, an ergodic chain is not

necessarily regular. Example?

Edgar Costa Math 20, Fall 2017 Week 9 16 / 23

slide-33
SLIDE 33

Examples

  • P =

( 1 1 ) is ergodic but not regular!

  • an absorbing chain cannot be regular!
  • P =

  

1 2 1 4 1 4 1 2 1 2 1 4 1 4 1 2

   is regular , as P2

7 16 3 16 3 8 3 8 1 4 3 8 3 8 3 16 7 16

Edgar Costa Math 20, Fall 2017 Week 9 17 / 23

slide-34
SLIDE 34

Examples

  • P =

( 1 1 ) is ergodic but not regular!

  • an absorbing chain cannot be regular!
  • P =

  

1 2 1 4 1 4 1 2 1 2 1 4 1 4 1 2

   is regular, as P2 =   

7 16 3 16 3 8 3 8 1 4 3 8 3 8 3 16 7 16

  

Edgar Costa Math 20, Fall 2017 Week 9 17 / 23

slide-35
SLIDE 35

Fundamental Limit Theorem for Regular Chains

Theorem (hard) If P is the transition matrix for a regular Markov chain, then limn→+∞ Pn exists. Let W := lim

n→+∞ Pn,

then W is a matrix where all rows are the same vector w. The vector w is a strictly positive probability vector (i.e., the components are all positive and they sum to one). Theorem (easy)

  • wP

w;

  • any row vector v such that vP

v is a constant multiple of w;

  • w is the unique probability vector such that wP

w.

Edgar Costa Math 20, Fall 2017 Week 9 18 / 23

slide-36
SLIDE 36

Fundamental Limit Theorem for Regular Chains

Theorem (hard) If P is the transition matrix for a regular Markov chain, then limn→+∞ Pn exists. Let W := lim

n→+∞ Pn,

then W is a matrix where all rows are the same vector w. The vector w is a strictly positive probability vector (i.e., the components are all positive and they sum to one). Theorem (easy)

  • wP = w;
  • any row vector v such that vP = v is a constant multiple of w;
  • w is the unique probability vector such that wP = w.

Edgar Costa Math 20, Fall 2017 Week 9 18 / 23

slide-37
SLIDE 37

Land of Oz

Back to the Land of Oz. Recall, P =   

1 2 1 4 1 4 1 2 1 2 1 4 1 4 1 2

   . Find limn→+∞ Pn.

  • Find a vector v such that v

vP.

  • To make your life easier, assume v1

1.

  • Rescale, to get the probability vector.

w 2 5 1 5 2 5

Edgar Costa Math 20, Fall 2017 Week 9 19 / 23

slide-38
SLIDE 38

Land of Oz

Back to the Land of Oz. Recall, P =   

1 2 1 4 1 4 1 2 1 2 1 4 1 4 1 2

   . Find limn→+∞ Pn.

  • Find a vector v such that v = vP.
  • To make your life easier, assume v1

1.

  • Rescale, to get the probability vector.

w 2 5 1 5 2 5

Edgar Costa Math 20, Fall 2017 Week 9 19 / 23

slide-39
SLIDE 39

Land of Oz

Back to the Land of Oz. Recall, P =   

1 2 1 4 1 4 1 2 1 2 1 4 1 4 1 2

   . Find limn→+∞ Pn.

  • Find a vector v such that v = vP.
  • To make your life easier, assume v1 = 1.
  • Rescale, to get the probability vector.

w 2 5 1 5 2 5

Edgar Costa Math 20, Fall 2017 Week 9 19 / 23

slide-40
SLIDE 40

Land of Oz

Back to the Land of Oz. Recall, P =   

1 2 1 4 1 4 1 2 1 2 1 4 1 4 1 2

   . Find limn→+∞ Pn.

  • Find a vector v such that v = vP.
  • To make your life easier, assume v1 = 1.
  • Rescale, to get the probability vector.

w = (2/5, 1/5, 2/5)

Edgar Costa Math 20, Fall 2017 Week 9 19 / 23

slide-41
SLIDE 41

Equilibrium starting state

We might also reinterpret w as the equilibrium state as for all n we have wPn = w. If we start with a probability distributio given by w, then the probability of being in the various states after n steps is still given by w. Theorem For Markov chain,

  • there is a unique probability vector w such that wP

w and w is strictly positive.

  • Any row vector such that vP

v is a multiple of w. Proof? Examples?

Edgar Costa Math 20, Fall 2017 Week 9 20 / 23

slide-42
SLIDE 42

Equilibrium starting state

We might also reinterpret w as the equilibrium state as for all n we have wPn = w. If we start with a probability distributio given by w, then the probability of being in the various states after n steps is still given by w. Theorem For a regular Markov chain,

  • there is a unique probability vector w such that wP = w and w is strictly

positive.

  • Any row vector such that vP = v is a multiple of w.

Proof? Examples?

Edgar Costa Math 20, Fall 2017 Week 9 20 / 23

slide-43
SLIDE 43

Equilibrium starting state

We might also reinterpret w as the equilibrium state as for all n we have wPn = w. If we start with a probability distributio given by w, then the probability of being in the various states after n steps is still given by w. Theorem For a regular an ergodic Markov chain,

  • there is a unique probability vector w such that wP = w and w is strictly

positive.

  • Any row vector such that vP = v is a multiple of w.

Proof? Examples?

Edgar Costa Math 20, Fall 2017 Week 9 20 / 23

slide-44
SLIDE 44

Equilibrium starting state

We might also reinterpret w as the equilibrium state as for all n we have wPn = w. If we start with a probability distributio given by w, then the probability of being in the various states after n steps is still given by w. Theorem For a regular an ergodic Markov chain,

  • there is a unique probability vector w such that wP = w and w is strictly

positive.

  • Any row vector such that vP = v is a multiple of w.

Proof? Examples?

Edgar Costa Math 20, Fall 2017 Week 9 20 / 23

slide-45
SLIDE 45

Equilibrium starting state

We might also reinterpret w as the equilibrium state as for all n we have wPn = w. If we start with a probability distributio given by w, then the probability of being in the various states after n steps is still given by w. Theorem For a regular an ergodic Markov chain,

  • there is a unique probability vector w such that wP = w and w is strictly

positive.

  • Any row vector such that vP = v is a multiple of w.

Proof? Examples?

Edgar Costa Math 20, Fall 2017 Week 9 20 / 23

slide-46
SLIDE 46

Law of Large Numbers for Ergodic Markov Chains

Theorem Let P be the transition matrix for an ergodic chain. Let An = I + P + P2 + · · · + Pn−1 n . Then lim

n→+∞ An = W,

where W is a matrix all of whose rows are equal to the unique fixed probability vector w for P. How to interpret An?

Edgar Costa Math 20, Fall 2017 Week 9 21 / 23

slide-47
SLIDE 47

Law of Large Numbers for Ergodic Markov Chains

Theorem Let P be the transition matrix for an ergodic chain. Let An = I + P + P2 + · · · + Pn−1 n . Then lim

n→+∞ An = W,

where W is a matrix all of whose rows are equal to the unique fixed probability vector w for P. How to interpret An?

Edgar Costa Math 20, Fall 2017 Week 9 21 / 23

slide-48
SLIDE 48

Law of Large Numbers for Ergodic Markov Chains

Theorem Let H(n)

j

be the proportion of times in n steps that an ergodic chain is in state sj. Then for any ϵ > 0, P ( |H(n)

j

− wj| > ϵ ) → 0 , independent of the starting state si. “idea”: Let X m be the random variable that is 1 if the mth step is to state sj and 0

  • therwise, given that we started in state si. E X m

1 p m

ij

1 p m

ij

H n X 0 X 1 X 2 X n n 1 E H n 1 pij p n

ij

n 1 wj

Edgar Costa Math 20, Fall 2017 Week 9 22 / 23

slide-49
SLIDE 49

Law of Large Numbers for Ergodic Markov Chains

Theorem Let H(n)

j

be the proportion of times in n steps that an ergodic chain is in state sj. Then for any ϵ > 0, P ( |H(n)

j

− wj| > ϵ ) → 0 , independent of the starting state si. “idea”: Let X(m) be the random variable that is 1 if the mth step is to state sj and 0

  • therwise, given that we started in state si. E[X(m)] = 1 · p(m)

ij

+ 0 · (1 − p(m)

ij

) H(n) = X(0) + X(1) + X(2) + · · · + X(n) n + 1 E[H(n)] = 1 + pij + · · · p(n)

ij

n + 1 − → wj

Edgar Costa Math 20, Fall 2017 Week 9 22 / 23

slide-50
SLIDE 50

Exercise

Consider the Markov chain with general 2 × 2 transition matrix P = ( 1 − a a b 1 − b ) .

  • 1. Under what conditions is P absorbing?
  • 2. Under what conditions is P ergodic but not regular?
  • 3. Under what conditions is P regular?
  • 4. Find the fixed probability vector w for the cases that this makes sense.
  • 5. With a = b = 1, show that Pn does not converge to W, but An = I+P+P2+···+Pn−1

n

does.

Edgar Costa Math 20, Fall 2017 Week 9 23 / 23