← Posts

Technical notes ·

Steady state probabilities of Markov chains

Notes on recurrence, stationary distributions and limiting behaviour of Markov chains.

Markov Chains

A definition from Probability - An Introduction by Geoffrey Grimmett and Dominic Welsh.

Defintion 12.1 A sequence XX of random variables is called a Markov chain if it satisfies the Markov property ∀n≤0∧i0,i1,...,in+1∈S∙P(Xn+1=in+1∣X0=i0,X1=i1,...,Xn=in)=P(Xn+1=in+1∣Xn=in)\begin{align*} & \forall n \leq 0 \land i_0, i_1, ..., i_{n+1} \in S \bullet \\ & \qquad \mathbb{P}\left(X_{n+1}=i_{n+1} | X_0 = i_0, X_1 = i_1, ..., X_n=i_n\right) \\ & \qquad = \mathbb{P}\left(X_{n+1}=i_{n+1} | X_n=i_n\right) \end{align*} where SS is a countable set called the state space.

Provided VV is an initial distribution vector, satisfying ∀i∈S∙V(i)≥0∧Σi∈SV(i)=1\forall i \in S \bullet V(i) \geq 0 \land \Sigma_{i \in S} V(i) = 1, and PP is a stochastic transition matrix, a random sequence Xˉ=⟨X(n)∣n≥0⟩\bar{X} = \langle X(n) | n \geq 0 \rangle is a Markov chain with VV and PP if ∀n≥0∧i0,…in∈S\forall n \geq 0 \land i_0, \dots i_n \in S, then P(X0=i0,...,Xn=in)=V(i0)∗P(i0,i1)∗P(i1,i2)∗⋯∗P(in−1,in)\begin{align*} & \mathbb{P}\left(X_0=i_0,...,X_n=i_n\right) \\ = & V(i_0) * P(i_0, i_1) * P(i_1, i_2) * \dots * P(i_{n-1}, i_n) \end{align*}

Notations

Classification of states

Considering a chain starting at state ii,

Recurrence time

Invariant distribution or stationary or equilibrium, or steady-state distribution

A vector π=[π(s0),…π(sn)]\pi = [\pi(s_0), \dots \pi(s_n)] is called an invariant distribution under the passage of time if

Below is from Emma J. McCoy’s lecture note:

An example with more than one solutions

From here P=[100131313001]P = \begin{bmatrix} 1 & 0 & 0\\ \frac{1}{3} & \frac{1}{3} & \frac{1}{3}\\ 0 & 0 & 1 \end{bmatrix} π1=(34014)\pi_1 = \begin{pmatrix} \frac{3}{4} & 0 & \frac{1}{4} \end{pmatrix} π2=(13023)\pi_2 = \begin{pmatrix} \frac{1}{3} & 0 & \frac{2}{3} \end{pmatrix}

Both π1\pi_1 and π2\pi_2 satisfy π1P=π1\pi_1 P = \pi_1 and π2P=π2\pi_2 P = \pi_2

P2=[100491919001]P3=[10013271271327001]…P12=[10012012001]P^2 = \begin{bmatrix} 1 & 0 & 0\\ \frac{4}{9} & \frac{1}{9} & \frac{1}{9}\\ 0 & 0 & 1 \end{bmatrix} P^3 = \begin{bmatrix} 1 & 0 & 0\\ \frac{13}{27} & \frac{1}{27} & \frac{13}{27}\\ 0 & 0 & 1 \end{bmatrix} \dots P^{12} = \begin{bmatrix} 1 & 0 & 0\\ \frac{1}{2} & 0 & \frac{1}{2}\\ 0 & 0 & 1 \end{bmatrix}

When n→∞n \to \infty, Pn=[10012012001]P^n = \begin{bmatrix} 1 & 0 & 0\\ \frac{1}{2} & 0 & \frac{1}{2}\\ 0 & 0 & 1 \end{bmatrix} , there is no limiting distribution.

Limiting distribution

Interpretation 1: the proportion of time it spends in state jj after running for a long time

∀j∈S∙πj=lim⁡n→∞1n∑m=1npij(m)\forall j \in S \bullet \pi_j = \lim_{n \to \infty} \frac{1}{n}\sum_{m=1}^{n} p_{ij}^{(m)} here πj\pi_j may depend on the initial distribution ii.

Recall that pij(m)p_{ij}^{(m)} is the probability of a Markov chain at state jj after exact mm steps when it starts from state ii, then ∑m=1npij(m)\sum_{m=1}^{n} p_{ij}^{(m)} is the probability of a chain at state jj in nn steps when it starts from state ii. It can also be interpreted as the expected value of the number of visits to jj in first nn steps (see Expected value of the number of visits). And so 1n∑m=1npij(m)\frac{1}{n}\sum_{m=1}^{n} p_{ij}^{(m)} is the proportion of time the chain spends at state jj in nn steps.

Definition of the limiting distribution

If for all state jj, πj\pi_j, calculated as above, exists and is independent of the initial state ii, and ∑j∈Sπj=1\sum_{j\in S} \pi_j = 1, then the probability distribution π\pi is a limiting distribution.

Expected value of the number of visits

Let VjnV_j^n be the number of visits the chain to state jj after exact nn steps. Vjn={1if Xn=j,0if Xn≠j.\begin{align*} V_j^n & = \begin{cases} 1 & \text{if } X_n = j,\\ 0 & \text{if } X_n \neq j. \end{cases} \end{align*}

Then ∑n=1NVjn\sum_{n=1}^{N} V_j^n means the number of visits to state jj in NN steps. E((∑n=1NVjn)∣X0=i)=∑n=1NE(Vjn∣X0=i)=∑n=1N(1×P(Vjn=1∣X0=i)+0×P(Vjn=0∣X0=i))=∑n=1NP(Vjn=1∣X0=i)=(Definition of Vjn)∑n=1NP(Xn=j∣X0=i)=∑n=1Npij(n)\begin{align*} & \mathbb{E}\left(\left(\sum_{n=1}^{N} V_j^n\right) | X_0 = i\right) \\ & = \sum_{n=1}^{N} \mathbb{E}\left(V_j^n | X_0 = i\right) \\ & = \sum_{n=1}^{N} \left(1 \times \mathbb{P}\left(V_j^n=1 | X_0 = i\right) + 0 \times \mathbb{P}\left(V_j^n=0 | X_0 = i\right)\right) \\ & = \sum_{n=1}^{N} \mathbb{P}\left(V_j^n=1 | X_0 = i\right) \\ & = \mbox{(Definition of $V_j^n$)}\\ & \qquad \sum_{n=1}^{N} \mathbb{P}\left(X_n = j | X_0 = i\right)\\ & = \sum_{n=1}^{N} p_{ij}^{(n)} \end{align*}

An example

P=[1412141302312012]P = \begin{bmatrix} \frac{1}{4} & \frac{1}{2} & \frac{1}{4}\\ \frac{1}{3} & 0 & \frac{2}{3}\\ \frac{1}{2} & 0 & \frac{1}{2} \end{bmatrix} ∀n≥11∙Pn=[383167163831671638316716]\forall n \geq 11 \bullet P^n = \begin{bmatrix} \frac{3}{8} & \frac{3}{16} & \frac{7}{16}\\ \frac{3}{8} & \frac{3}{16} & \frac{7}{16}\\ \frac{3}{8} & \frac{3}{16} & \frac{7}{16} \end{bmatrix} lim⁡n→∞1n∑m=1nP(m)=[383167163831671638316716]\lim_{n \to \infty} \frac{1}{n}\sum_{m=1}^{n} P^{(m)}=\begin{bmatrix} \frac{3}{8} & \frac{3}{16} & \frac{7}{16}\\ \frac{3}{8} & \frac{3}{16} & \frac{7}{16}\\ \frac{3}{8} & \frac{3}{16} & \frac{7}{16} \end{bmatrix} In this case, P(n)P^{(n)} converges to a matrix whose each row is the same. Actually, each row corresponds to pi(n)p_i^{(n)} which is related to the initial distribution. So eventually, the pij(n)p_{ij}^{(n)} is independent of ii because each row is the same.

Interpretation 2: the probability that the process will be in state jj after running for a long time

A distribution π=[π0,π1,…,πn]\pi = [\pi_0, \pi_1, \ldots , \pi_n] is called a limiting distribution of XnX_n if ∀i,j∈S∙πj=lim⁡n→∞P(Xn=j∣X0=i)\forall i, j \in S \bullet \pi_j = \lim_{n \to \infty} \mathbb{P}(X_n = j | X_0 = i)

Also we can write it as ∀i,j∈S∙πj=lim⁡n→∞pij(n)\forall i, j \in S \bullet \pi_j = \lim_{n \to \infty} p_{ij}^{(n)}

By this definition, if a limiting distribution exists, it is independent of its initial states. ∀j∈S∙πj=lim⁡n→∞P(Xn=j)\forall j \in S \bullet \pi_j = \lim_{n \to \infty} \mathbb{P}(X_n = j)

Note:

An example

P=[1−aab1−b]P = \begin{bmatrix} 1-a & a\\ b & 1-b \end{bmatrix} Pn=1a+b[baba]+(1−a−b)na+b[a−a−bb]P^n = \frac{1}{a+b} \begin{bmatrix} b & a\\ b & a \end{bmatrix} + \frac{(1-a-b)^n}{a+b} \begin{bmatrix} a & -a\\ -b & b \end{bmatrix} π=1a+b[baba]\pi = \frac{1}{a+b} \begin{bmatrix} b & a\\ b & a \end{bmatrix}

Another example (a stationary distribution is not necessary a limiting distribution)

P=[0110]P = \begin{bmatrix} 0 & 1\\ 1 & 0 \end{bmatrix} π=(1212)\pi = \begin{pmatrix} \frac{1}{2} & \frac{1}{2} \end{pmatrix}

This π\pi satisfies the three conditions of a stationary distribution: πP=π\pi P = \pi, but there is no limiting distributions.

P1=[0110]P^1 = \begin{bmatrix} 0 & 1\\ 1 & 0 \end{bmatrix} P2=[1001]P^2 = \begin{bmatrix} 1 & 0\\ 0 & 1 \end{bmatrix} P3=[0110]=PP^3 = \begin{bmatrix} 0 & 1\\ 1 & 0 \end{bmatrix} = P

Finally, the limit P(n)P^{(n)} doesn’t converge.

Two-states chain
Two-states chain

Particularly, this chain has a period 2.

Summarise in a diagram

Summary
Summary