Regular Markov Chains MATH 107: Finite Mathematics University of - - PDF document

regular markov chains math 107 finite mathematics
SMART_READER_LITE
LIVE PREVIEW

Regular Markov Chains MATH 107: Finite Mathematics University of - - PDF document

Regular Markov Chains MATH 107: Finite Mathematics University of Louisville April 9, 2014 Long-Term Explorations 2 / 12 Long-term behaviors 1 / 4 1 / 4 2 / 4 P = 1 / 5 1 / 5 3 / 5 ; S 0 = [ 1 0 ]


slide-1
SLIDE 1

Regular Markov Chains MATH 107: Finite Mathematics University of Louisville April 9, 2014

Long-Term Explorations 2 / 12

Long-term behaviors

P = ⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ 1/4 1/4 2/4 1/5 1/5 3/5 2/6 3/6 1/6 ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ ;S0 = [1 0] Remember this maze from the last lesson; we can use computers to find long-term behavior: S2 = SP2 ≈ [0.27917 0.36250 0.35833] S5 = SP5 ≈ [0.26586 0.33140 0.40274] S10 = SP10 ≈ [0.26668 0.33335 0.39997] S20 = SP20 ≈ [0.26667 0.33333 0.40000] S21 = SP21 ≈ [0.26667 0.33333 0.40000] We might conjecture that this system is approaching a stationary state looking a lot like [ 4

15 1 3 2 5]

MATH 107 (UofL) Notes April 9, 2014

slide-2
SLIDE 2

Long-Term Explorations 3 / 12

More long-term behavior

⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ 1 0.3 0.0 0.7 1 ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ ;S0 = [0.2 0.3 0.5] Alas, not every transition matrix reaches a stationary state! S1 = SP = [0.09 0.70 0.21] S2 = SP2 = [0.21 0.30 0.49] S3 = SP3 = [0.09 0.70 0.21] and the system oscillates between these two states forever!

Key questions

▸ When does a system have a unique stationary state? ▸ What is that stationary state?

MATH 107 (UofL) Notes April 9, 2014 Regular Markov Chains 4 / 12

Stationary states

Some matrices, like ⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ 1 0.3 0.0 0.7 1 ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ , have no stationary state. Some, like ⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ 1 0.5 0.5 0.3 0.7 ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ have many stationary states. We want to know which transition matrices have exactly one stationary state.

MATH 107 (UofL) Notes April 9, 2014

slide-3
SLIDE 3

Regular Markov Chains 5 / 12

The regularity criterion

Definition

A matrix P is regular if there is some number n such that every entry of Pn is nonzero. A Markov chain is regular if its transition matrix is regular. So, for instance, our maze example ⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ 1/4 1/4 2/4 1/5 1/5 3/5 2/6 3/6 1/6 ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ is regular, and the matrices ⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ 1 0.3 0.0 0.7 1 ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ and ⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ 1 0.5 0.5 0.3 0.7 ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ are not.

Theorem

A Markov chain has a unique stationary state if and only if it is regular. We won’t prove that here; details are in MATH 325.

MATH 107 (UofL) Notes April 9, 2014 Regular Markov Chains 6 / 12

Testing regularity

To determine whether a matrix is regular, we look at powers of it until either we have all nonzero entries or we repeat entries. Fortunately, in doing this test, we only need consider whether entries are zero or nonzero, not their arithmetic values.

Example

Is P = ⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ 0.3 0.7 0.5 0.5 1 ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ regular? P = ⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ ∼ ∼ ∼ ∼ ∼ ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ ; P2 = ⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ ∼ ∼ ∼ ∼ ∼ ∼ ∼ ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ ; P3 = ⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ ∼ ∼ ∼ ∼ ∼ ∼ ∼ ∼ ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ ; P4 = ⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ ∼ ∼ ∼ ∼ ∼ ∼ ∼ ∼ ∼ ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ , so P is regular!

MATH 107 (UofL) Notes April 9, 2014

slide-4
SLIDE 4

Stationary states 7 / 12

Finding stationary vectors

Having determined when a matrix has a stationary state, we now want to find that state. What we want is a vector S such that SP = S. Also, since S describes a probability or proportion, we need its entries to add up to 1. SP = S ⇒ SP = SIn ⇒ SP −SIn = 0 ⇒ S(P −In) = 0 and in addition the entries of S add up to 1. If we name the entries of S, we can thus solve the associated system.

MATH 107 (UofL) Notes April 9, 2014 Stationary states 8 / 12

Case study: mouse in a maze

P = ⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ 1/4 1/4 2/4 1/5 1/5 3/5 2/6 3/6 1/6 ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ This is our “mouse-in-a-maze” transition matrix. Let’s find a stationary S = [s1 s2 s3]. S(P −I3) = 0 and s1 +s2 +s3 = 1 [s1 s2 s3] ⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ −3/4 1/4 1/2 1/5 −4/5 3/5 1/3 1/2 −5/6 ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ = [0 0] s1 +s2 +s3 = 1 ⇒ ⎧ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎩ −3

4s1 + 1 5s2 + 1 3s3 = 0 1 4s1 − 4 5s2 + 1 2s3 = 0 1 2s1 + 3 5s2 − 5 6s3 = 0

s1 + s2 + s3 = 1

MATH 107 (UofL) Notes April 9, 2014

slide-5
SLIDE 5

Stationary states 9 / 12

Case study: mouse in a maze (cont’d)

⎧ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎩ −3

4s1 + 1 5s2 + 1 3s3 = 0 1 4s1 − 4 5s2 + 1 2s3 = 0 1 2s1 + 3 5s2 − 5 6s3 = 0

s1 + s2 + s3 = 1

⎧ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎩ 45s1 −12s2 −20s3 = 0 5s1 −16s2 +10s3 = 0 15s1 +18s2 −25s3 = 0 s1 + s2 + s3 = 1 which we can solve by reducing ⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ 45 −12 −20 5 −16 10 15 18 −25 1 1 1 1 ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ . ⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ 45 −12 −20 5 −16 10 15 18 −25 1 1 1 1 ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ ∼ ⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ 1

4 15

1

1 3

1

2 5

⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ which is the result we expected way back when!

MATH 107 (UofL) Notes April 9, 2014 Stationary states 10 / 12

Case study: ineffective vaccine

P = ⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ 0.95 0.05 0.3 0.5 0.2 0.5 0.5 ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ This is our vaccination transition matrix from the last lecture. Let’s find a stationary S = [s1 s2 s3]. [s1 s2 s3] ⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ −0.05 0.05 0.3 −0.5 0.2 0.5 −0.5 ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ = [0 0] s1 +s2 +s3 = 1 ⎧ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎩ −0.05s1 +0.3s2 = 0 s1 −0.5s2 +0.5s3 = 0 0.05s1 +0.2s2 −0.5s3 = 0 s1 + s2 + s3 = 1

MATH 107 (UofL) Notes April 9, 2014

slide-6
SLIDE 6

Stationary states 11 / 12

Case study: ineffective vaccine (cont’d)

⎧ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎩ −0.05s1 +0.3s2 = 0 −0.5s2 +0.5s3 = 0 0.05s1 +0.2s2 −0.5s3 = 0 s1 + s2 + s3 = 1

⎧ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎩ 5s1 −30s2 = 0 s2 − s3 = 0 5s1 +20s2 −50s3 = 0 s1 + s2 + s3 = 1 which we can solve by reducing ⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ 5 −30 1 −1 5 20 −50 1 1 1 1 ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ . ⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ 5 −30 1 −1 5 20 −50 1 1 1 1 ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ ∼ ⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ 1

3 4

1

1 8

1

1 8

⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ so 75% of the population will end up vaccinated long-term, while the remaining 25% are evenly split between being well and ill.

MATH 107 (UofL) Notes April 9, 2014 Stationary states 12 / 12

A more typical example: 2-state systems

Mercifully, you will usually be spared 3-state systems. More usually you will be given a 2-state system.

Commuter preferences

Every month, 20% of rapid transit users switch to driving, while 30% of car drivers switch to rapid transit. What is the long-term proportion of drivers to transit users? Here, P = [0.8 0.2 0.3 0.7]← RT ← Car. And we want a solution to [s1 s2][−0.2 0.2 0.3 −0.3] = [0 0] with s1 +s2 = 1. Thus, we have the system ⎧ ⎪ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎪ ⎩ −0.2s1 +0.3s2 = 0 0.2s1 −0.3s2 = 0 s1 + s2 = 1

MATH 107 (UofL) Notes April 9, 2014

slide-7
SLIDE 7

Stationary states 13 / 12

2-state systems (cont’d)

⎧ ⎪ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎪ ⎩ −0.2s1 +0.3s2 = 0 0.2s1 −0.3s2 = 0 s1 + s2 = 1 ⇒ { 2s1 −3s2 = 0 s1 + s2 = 1 We could use, for instance, substitution to solve this: s1 = 3

2s2, so:

3 2s2 +s2 = 1 ⇒ 5 2s2 = 1 ⇒ s2 = 2 5 and then s1 = 3

2 × 2 5 = 3 5.

Thus 60% of the population would use rapid transit and 40% cars.

MATH 107 (UofL) Notes April 9, 2014