• Tidak ada hasil yang ditemukan

PDF Lecture 2.2 Finite State Markov Chains - econdse.org

N/A
N/A
Protected

Academic year: 2024

Membagikan "PDF Lecture 2.2 Finite State Markov Chains - econdse.org"

Copied!
26
0
0

Teks penuh

(1)

Stochastic Dynamics A. Banerji

Markov Chains

Introduction Marginal Distributions Other Identities

Stability of Finite State MCs

Stationary Distributions Dobrushin Coefficient

Lecture 2.2 Finite State Markov Chains

A. Banerji

Department of Economics

February 24, 2014

(2)

Stochastic Dynamics A. Banerji

Markov Chains

Introduction Marginal Distributions Other Identities

Stability of Finite State MCs

Stationary Distributions Dobrushin Coefficient

Outline

Markov Chains Introduction

Marginal Distributions Identities

Stability of Finite State MCs Stationary Distributions Dobrushin Coefficient

(3)

Stochastic Dynamics A. Banerji

Markov Chains

Introduction Marginal Distributions Other Identities

Stability of Finite State MCs

Stationary Distributions Dobrushin Coefficient

Stochastic Kernels

Finite State SpaceS={x1,x2, ...,xN}

Distribution onS. A functionφ:S→ <s.t. φ(x)≥0, for allx ∈SandP

x∈Sφ(x) =1.

The set of all distributions onS,P(S), is the N-1 dimensional unit simplex in<N.

Definition

A stochastic kernel onSis a functionp:S×S→[0,1]

s.t.P

y∈Sp(x,y) =1, for allx ∈S.

For eachx ∈S, we call the corresponding distribution on S,p(x,dy). For a finite state spaceS, we can write down theNdistributions in anN×N matrix.

(4)

Stochastic Dynamics A. Banerji

Markov Chains

Introduction Marginal Distributions Other Identities

Stability of Finite State MCs

Stationary Distributions Dobrushin Coefficient

Markov Chains

M = (p(x,dy))x∈S

=

p(x1,x1) . . . p(x1,xN) ... ... ... p(xN,x1) . . . p(xN,xN)

Definition

The Markov Chain onSgenerated by stochastic kernelp and initial conditionψ∈ P(S)is the sequence(Xt)t=0of random variables defined by

(i)X0∼ψ

(ii)Fort =0,1,2, ...,Xt+1∼p(Xt,dy)

So ifXt =x,P(Xt+1=y|Xt =x) =p(x,y). Called Markov -(p, ψ)chain. Discuss Hamilton(2005), Quah(1993).

(5)

Stochastic Dynamics A. Banerji

Markov Chains

Introduction Marginal Distributions Other Identities

Stability of Finite State MCs

Stationary Distributions Dobrushin Coefficient

Marginal Distribution - Approximation

Let(Xt)t=0be a Markov Chain onSgenerated by a stochastic kernelpand initial conditionψ. The marginal distributionψt(y)≡P(Xt =y), for ally ∈S.

Approximatingψt(y)by Monte-Carlo. DrawXt a large number of times and compute the relative frequency ofy. Specifically:

DrawX0fromψa largennumber of times. Each of these times:

Fork =1, ...,t, drawXk fromp(xk−1,dy).

Fory ∈S,ψt(y)' n1Pn i=11{Xi

t=y}

Now do JS exercises 4.2.1, 4.2.2.

(6)

Stochastic Dynamics A. Banerji

Markov Chains

Introduction Marginal Distributions Other Identities

Stability of Finite State MCs

Stationary Distributions Dobrushin Coefficient

Marginal Distribution - Recursion

By the Law of Total Probability, P{Xt+1=y}=P

x∈SP{Xt+1=y|Xt =x}P{Xt =x} (The above just integrates outXt from the joint(Xt+1,Xt)).

That is, ψt+1(y) =P

x∈Sp(x,y)ψt(x) = (ψt(x))x∈S.(p(x,y))x∈S

Stacking these for ally ∈Sin one row, ψt+1= (ψt+1(y))y∈StM

Bytrecursions, we get

ψt+1=ψMt+1

The probabilities of the states att+1 is a weighted average of the transitionsp(x,dy)(rows ofM) weighted by the probabilities of the states att.

Example

Quah - Starting in extreme poverty (State 1), what is the marginal distribution after 10, 60 and 160 periods.

(7)

Stochastic Dynamics A. Banerji

Markov Chains

Introduction Marginal Distributions Other Identities

Stability of Finite State MCs

Stationary Distributions Dobrushin Coefficient

Powers of M

Let(pk(x,y))N×N ≡Mk Lemma

pk(x,y) =P{Xt+k =y|Xt =x}

Proof.

Letδx ∈ P(S)be the degenerate distribution that givesx with probability 1.

SoP{Xt+k =y|Xt =x}=P{Xt+k =y|Xt ∼δx}

This is just the marginal distributionψt+k(y)with initial conditionXt ∼δx. By recursion†,

ψt+kxMk =pk(x,dy).

(8)

Stochastic Dynamics A. Banerji

Markov Chains

Introduction Marginal Distributions Other Identities

Stability of Finite State MCs

Stationary Distributions Dobrushin Coefficient

Expectation

SupposeXt ∼ψ∈ P(S). So the marginal distribution of Xt+kt+k =ψMk. So ifh:S→ <, the expectation E[h(Xt+k)|Xt ∼ψ] =P

y∈SψMk(y)h(y) =ψMkh whereh≡(h(y))y∈S (we’ve taken an inner product).

Example

Ifψ=δx, we have E[h(Xt+K)|Xt =x] =P

y∈Spk(x,y)h(y) =δxMkh. This is just thexthrow of the matrixMk multiplied by the vectorh.

For Hamilton(2005), leth= (1000,0,−1000)be profits of a firm in the 3 states. What is expected profit 5 periods from now, if we are currently in severe recession (state 1)? Do JS 4.2.4-5.

(9)

Stochastic Dynamics A. Banerji

Markov Chains

Introduction Marginal Distributions Other Identities

Stability of Finite State MCs

Stationary Distributions Dobrushin Coefficient

Chapman-Kolmogorov Equation

The Equation:

pk+j(x,y) =X

z∈S

pk(x,z)pj(z,y)

Proof.

Mk+j =MkMj. So the(x,y)thelement ofMk+j is the inner product of thexthrow ofMk andythcolumn of Mj.

To go from statex to statey ink +j steps, we must go to statez ∈Sink steps, then from there toy injsteps. For fixedz, multiply the 2 probabilities; then add over all (mutually exclusive)z’s. In other standard notation, P{Xk+j =y|X0=x}=P

z∈SP{Xk+j =y|Xk =z}P{Xk = z|X0=x}

(10)

Stochastic Dynamics A. Banerji

Markov Chains

Introduction Marginal Distributions Other Identities

Stability of Finite State MCs

Stationary Distributions Dobrushin Coefficient

Exercise

JS 4.2.6. In terms of sums, pk(x,y) =P

z1∈Sp(x,z1)P

z2∈Sp(z1,z2). . . P

zk−1∈Sp(zk−2,zk−1)p(zk−1,y) Proof.

pk(x,y)is the sum of probabilities of all mutually

exclusive outcome paths of type{xz1z2. . .zk−1y}, which equals

P

all{xz1z2...zk−1y}p(x,z1)p(z1,z2). . .p(zk−1,y)

=P

all{xz1z2...zk−2}p(x,z1). . . p(zk−3,zk−2)P

zk−1∈Sp(zk−2,zk−1)p(zk−1,y)

where we’ve fixed{xz1. . .zk−2}and summed across the last stretch of the paths ending aty. Working backwards all the way we get

P

z1∈Sp(x,z1)P

z2∈Sp(z1,z2)P

z3∈S. . . P

zk−1∈Sp(zk−2,zk−1)p(zk−1,y)

(11)

Stochastic Dynamics A. Banerji

Markov Chains

Introduction Marginal Distributions Other Identities

Stability of Finite State MCs

Stationary Distributions Dobrushin Coefficient

Introduction

I Investigate the sequence(ψt)of marginal distributions for Quah, astgrows large.

It)settles at someψ, regardless of where we start

I Global asymptotic stability of Markov Chains refers to the settling down of the marginal distribution to a unique distribution, regardless of initial condition

I Known asergodicity

(12)

Stochastic Dynamics A. Banerji

Markov Chains

Introduction Marginal Distributions Other Identities

Stability of Finite State MCs

Stationary Distributions Dobrushin Coefficient

Dynamical System Corresponding to FSMC

I The marginal distributions of the Markov Process (Xt)with matrixM are(ψt) = (ψMt), if

X0∼ψ∈ P(S).

I Notice thatM:P(S)→ P(S)(JS 4.3.1.). Indeed, for anyψ∈ P(S),ψM =P

x∈Sψ(x)p(x,dy). So, for all y ∈S, theythcoordinate ofψM,

ψM(y) =P

x∈Sψ(x)p(x,y)>0. Also,P

y∈SψM(y)

=P

y∈S

P

x∈Sψ(x)p(x,y)

=P

x∈Sψ(x)P

y∈Sp(x,y) =P

x∈Sψ(x) =1. So, ψM ∈ P(S).

Basically,ψM is a convex combination of points from P(S)and therefore belongs toP(S).

I Impose the norm|| ||1and the corresponding metric d1onP(S). Then(P(S),M)is a dynamical system, withψt+1tM,t=0,1,2, . . ..

(13)

Stochastic Dynamics A. Banerji

Markov Chains

Introduction Marginal Distributions Other Identities

Stability of Finite State MCs

Stationary Distributions Dobrushin Coefficient

Stationary Distributions

Definition

A distributionψ∈ P(S)isstationaryor invariant forMif ψM=ψ. That is,ψ is a fixed point of the dynamical system(P(S),M).

Theorem

Every Markov chain on a finite state space has at least one stationary distribution.

Proof.

P(S)is compact and convex (it’s just the (N-1) dimensional unit simplex), andM is linear and hence continuous. So by Brouwer’s fixed point theorem,M has a fixed point onP(S).

Note: There could be many fixed points. e.g. JS 4.3.4.

For the Markov matrixIN (theN×Nidentity matrix), everyψ∈ P(S)is stationary.

(14)

Stochastic Dynamics A. Banerji

Markov Chains

Introduction Marginal Distributions Other Identities

Stability of Finite State MCs

Stationary Distributions Dobrushin Coefficient

Some Implications

Lemma

M is d1-nonexpansive onP(S). That is, for all ψ, ψ0 ∈ P(S), d1(ψM, ψ0M)≤d1(ψ, ψ0).

Proof.

||ψM−ψ0M||1=X

y∈S

|ψM(y)−ψ0M(y)|

=P

y∈S|P

x∈S(ψ(x)−ψ0(x))p(x,y)|

≤P

y∈S

P

x∈S|(ψ(x)−ψ0(x))p(x,y)|

= P

x∈S|ψ(x)−ψ0(x)|P

y∈Sp(x,y) =P

x∈S|ψ(x)−ψ0(x)|

=||ψ−ψ0||1.The inequality follows from the triangle inequality.

(15)

Stochastic Dynamics A. Banerji

Markov Chains

Introduction Marginal Distributions Other Identities

Stability of Finite State MCs

Stationary Distributions Dobrushin Coefficient

Computing Stationary Distributions

ψ∈ P(S)is stationary or a fixed point iffψ(IN−M) =0 i.e.(IN−M)TψT =0. We can solve the system of equations, and normalizeψT by dividing by its norm, so that it lies inP(S). Alternatively: JS 4.3.5. Let

1N ≡(1,1, . . . ,1)and1N×N anN×Nmatrix of ones. Ifψ is a fixed point ofM andψ∈ P(S), we have

1N =ψ(IN−M+1N×N). Indeed, sinceψ∈ P(S), so ψ1N×N =1N. So,ψ(IN−M) =0, orψis a fixed point of M. However, ifψ /∈ P(S), then it is not necessarily true that1N =ψ(IN−M+1N×N).

So solving(IN−M+1N×N)TψT =1TN works. (do JS 4.3.6-7)

(16)

Stochastic Dynamics A. Banerji

Markov Chains

Introduction Marginal Distributions Other Identities

Stability of Finite State MCs

Stationary Distributions Dobrushin Coefficient

Stability

Definition

The dynamical system(P(S),M)is globally stable if it has a unique stationary distribution (fixed point) ψ∈ P(S), and for allψ∈ P(S),

d1(ψMt, ψ)≡ ||ψMt−ψ||1→0, ast → ∞.

Need more than nonexpansiveness ofMfor stability.

Stability fails forM =IN. Succeeds ‘best’ ifp(x,dy)is identical for allx ∈S(we then jump to the unique fixed point in a single step, from anyψ∈ P(S)).

Example

M =

0 1 1 0

ψ= (1/2,1/2)is the unique fixed point; for every other ψ= (ψ1,1−ψ1)6=ψM= (1−ψ1, ψ1). This also shows that(ψMt)oscillates witht, so the system is not globally stable.

(17)

Stochastic Dynamics A. Banerji

Markov Chains

Introduction Marginal Distributions Other Identities

Stability of Finite State MCs

Stationary Distributions Dobrushin Coefficient

Dobrushin Coefficient

Definition

TheDobrushin Coefficientof a stochastic kernelpis

α(p)≡ min

(x,x0)∈S×S

X

y∈S

p(x,y)∧p(x0,y)

wherea∧b≡min{a,b}

Remarks.1.Hamilton and Quah. α(p)equals 0.029 for MH and 0 forMQ (see 1st and 5th rows ofMQ). 2.

α(p)∈[0,1], for allp. It equals 1 iffp(x,dy)is identical for allx ∈S. It equals 0 forIN and the periodic kernel on the previous slide. 3. α(p)>0 iff for every pair

(x,x0)∈S×S,p(x,dy)andp(x0,dy)overlap(assign positive probability to at least one common statey). From any 2 states then, there is positive probability that the chains will meet next period.

(18)

Stochastic Dynamics A. Banerji

Markov Chains

Introduction Marginal Distributions Other Identities

Stability of Finite State MCs

Stationary Distributions Dobrushin Coefficient

Dobrushin Coefficient and Stability

Theorem

Let p be a stochastic kernel with Markov matrix M. Then for everyφ, ψ∈ P(S),

||φM−ψM||1≤(1−α(p))||φ−ψ||1 Moreover this bound is tight; forλ <(1−α(p)), there exists a pairφ, ψwhich violates the≤inequality.

The proof consists of 3 steps/lemmas.

Lemma

JS C.2.1. Letφ, ψ∈ P(S)and h:S→ <+. Then

|X

x∈S

h(x)φ(x)−X

x∈S

h(x)ψ(x)| ≤ 1 2sup

x,x0

|h(x)−h(x0)|.||φ−ψ||1

(19)

Stochastic Dynamics A. Banerji

Markov Chains

Introduction Marginal Distributions Other Identities

Stability of Finite State MCs

Stationary Distributions Dobrushin Coefficient

Stability 2

JS C.2.1. provides an upper bound for the (absolute) difference of expectationhunderφandψ. See proof in Stachurski (appendix).

Lemma C.2.2.

||φM−ψM||112supx,x0||p(x,dy)−p(x0,dy)||1.||φ−ψ||1 Proof.

See Stachurski (appendix). The inequality looks similar to C.2.1. Exercise 4.3.2. implies

||φM−ψM||1=2 supA⊂S|φM(A)−ψM(A)|. We introduce the functionhused in C.2.1. by noting that

|φM(A)−ψM(A)|=

|P

x∈SP(x,A)φ(x)−P

x∈SP(x,A)ψ(x)|, where P(x,A) =P

y∈Ap(x,y).

(20)

Stochastic Dynamics A. Banerji

Markov Chains

Introduction Marginal Distributions Other Identities

Stability of Finite State MCs

Stationary Distributions Dobrushin Coefficient

Stability 3

To prove the first claim of the theorem, we now show that 1

2sup

x,x0

||p(x,dy)−p(x0,dy)||1=1−inf

x,x0

X

y∈S

p(x,y)∧p(x0,y)

It suffices to show that for everyx,x0, 1

2||p(x,dy)−p(x0,dy)||1=1−X

y∈S

p(x,y)∧p(x0,y)

This is true for any pair of distributions, as below.

Lemma

C.2.3. For every pairµ, ν ∈ P(S)we have

1

2||µ−ν||=1−X

y∈S

µ(y)∧ν(y)

(21)

Stochastic Dynamics A. Banerji

Markov Chains

Introduction Marginal Distributions Other Identities

Stability of Finite State MCs

Stationary Distributions Dobrushin Coefficient

Stability 4

To show that the bound is tight, note that 1−α(p)

= 12supx,x0||p(x,dy)−p(x0,dy)||1

=sup{x 6=x0}||p(x,dy)−p(x0,dy)||1

||δx−δ

x0||1 ≤supµ6=ν |µM−νM|||µ−ν|| 1

1

The second equality holds since||δx−δx0||1=2. The final inequality holds because the set of degenerate distributions likeδx, δx0 is a subset of the set of all distributions. More simply, just putM =IN (soα(p) =0).

Now for the main theorem.

Theorem

Let p be a stochastic kernel on a finite set S, and M the corresponding Markov matrix. The dynamical system (P(S),M)is globally stable iff there exists a t ∈Ns.t.

α(pt)>0.

(22)

Stochastic Dynamics A. Banerji

Markov Chains

Introduction Marginal Distributions Other Identities

Stability of Finite State MCs

Stationary Distributions Dobrushin Coefficient

Stability 5

Proof.

M is nonexpansive. From the earlier theorem, we know that sinceα(pt)>0,(P(S),Mt)is globally stable. So by lemma 4.1.1.,(P(S),M)is globally stable.

Conversely, suppose(P(S),M)is globally stable. So there is a unique stationary distributionψ, and ψMt →ψ for allψ∈ P(S). In particular,

δxMt =pt(x,dy)→ψ, for everyx ∈S. So for allx ∈S, pt(x,y)→ψ(y), for ally ∈S. Sinceψ is a distribution, there is at least oney ∈S s.t.ψ(y)>0. So for thisy, we have from the convergence that fortlarge enough, pt(x,y)>0, for allx ∈S. Thus there existstsuch that all rowspt(x,dy)ofMt overlap at thisy; thus the Dobrushin coefficientα(pt)>0.

(23)

Stochastic Dynamics A. Banerji

Markov Chains

Introduction Marginal Distributions Other Identities

Stability of Finite State MCs

Stationary Distributions Dobrushin Coefficient

Exercises

Theorem shows:for every pair(x,x0)of states,pt(x,dy) andpt(x0,dy)overlap. Starting at any 2 different points today, the chains meet with positive probabilitytperiods later. Extreme form: pt(x,dy)same for allx or

convergence int periods.

I α(p)>0 for Hamilton’s matrix but zero for Quah’s matrix. However, for the 23rd iterateMQ23 reported by Quah,α(p23)>0. So(P(S),MQ)is globally stable.

I JS 4.3.20. Code to calculateα(pt),t=1,2, . . . ,T for a given Markov matrixM, stopping at the firstt s.t.

α(pt)>0. Show that thist =2 for Quah’s matrix.

I (s,S)(or(q,Q)) inventory dynamics. A firm with inventoryXt at the start of periodt, has the option of ordering inventory up to its maximum storing

capacityQ. At the end of periodt, demandDt+1is observed (all non-negative integers). The firm meets demand up to its current stock level; remaining inventory is carried over to next period.

(24)

Stochastic Dynamics A. Banerji

Markov Chains

Introduction Marginal Distributions Other Identities

Stability of Finite State MCs

Stationary Distributions Dobrushin Coefficient

Inventory Dynamics exercise

(Dt)t≥1is an iid sequence of random variables taking nonnegative integer values according to distribution b(d)≡P{Dt =d}= (1/2)d+1.

The firm follows a stationary policy: IfXt ≤q, order inventory to top up to equalQ; otherwise, order no inventory (the choice ofqis the firm’s predecided policy choice).

So,

Xt+1=

max{Q−Dt+1,0} ifXt ≤q max{Xt −Dt+1,0} ifXt >q LetS={0,1, ...,Q}. What is the stochastic kernel Mq= (p(x,y))corresponding to restocking policyq?

(25)

Stochastic Dynamics A. Banerji

Markov Chains

Introduction Marginal Distributions Other Identities

Stability of Finite State MCs

Stationary Distributions Dobrushin Coefficient

(q,Q) Dynamics

Letx ≤q. Then

Xt+1=

Q−i with Pr(1/2)i+1, i =0,1, ...,Q−1

0 with Pr(1/2)Q

Letx >q. Then

Xt+1=

x−i with Pr(1/2)i+1, i =0,1, ...,x−1

0 with Pr(1/2)x

Mq=

(1/2)Q (1/2)Q (1/2)Q−1 . . . (1/2) . . . . (1/2)Q (1/2)Q (1/2)Q−1 . . . (1/2)

. . . .

(1/2)x (1/2)x (1/2)x−1 . . . (1/2) 0

. . . .

(1/2)Q (1/2)Q (1/2)Q−1 . . . (1/2)

(26)

Stochastic Dynamics A. Banerji

Markov Chains

Introduction Marginal Distributions Other Identities

Stability of Finite State MCs

Stationary Distributions Dobrushin Coefficient

(q,Q) Dynamics cont

Staring atMq, we see that regardless ofq(andQ), α(p)>0. So(P(S),Mq)is globally stable.

JS 4.3.23. Compute the stationary distribution when (q,Q) = (2,5).

JS 4.3.24. SupposeQ=20, and the fixed cost of

ordering inventory in any period is 0.1. The firm buys the product at zero cost per unit and sells at USD 1 per unit.

For eachq∈ {0,1,2, ...,20}, evaluate the stationary distributionψq, and evaluate the firm’s expected per period profit at this stationary distribution (i.e. compute the firm’s long run average profits with restocking policy q). Show that this profit is maximized atq=7.

Referensi

Dokumen terkait