Tutorials › Stochastic Processes › Solving Finite-State Stationary Equations

Stationary Distributions and Limit Theorems for CTMCs · Tutorial 538 of 994

Solving Finite-State Stationary Equations

Set up and solve finite-state continuous-time stationary equations, then check when the resulting normalized vector identifies the stationary distribution.

Advanced 10 min read

What You'll Learn

  • Write the generator from transition rates and verify that its rows sum to zero.
  • Form the stationary equations using a row vector and the equation \(\pi Q=0\).
  • Solve and normalize the equations for two-state and three-state chains.
  • Recognize why one stationary equation is redundant.
  • Check a proposed distribution by substitution and avoid confusing left and right nullvectors.

From Transition Rates to Stationary Equations

For a finite-state continuous-time Markov chain, finding a stationary distribution is a finite-dimensional linear algebra problem. The transition rates determine a generator matrix \(Q\); a stationary distribution, written as a row vector, must satisfy \(\pi Q=0\) and have entries summing to one. The main work is setting up the equations with the correct orientation, solving them, and checking the result.

Throughout, let \((X_t)_{t\ge0}\) be a continuous-time Markov chain on a finite state space \(S\), defined on a probability space \((\Omega,\mathcal{F},\mathbb{P})\). When conditioning on the past, use the natural filtration \(\mathcal{F}_t=\sigma(X_s:0\le s\le t)\). Its generator is \(Q=(q_{ij})\): for distinct states \(i,j\), \(q_{ij}\ge0\) is the rate of a jump from \(i\) to \(j\), and \(q_{ii}=-\sum_{j\ne i}q_{ij}\). Thus each row sums to zero. The transition semigroup is \(P(t)=e^{tQ}\), and distributions are row vectors: an initial distribution \(\mu\) evolves as \(\mu P(t)\).

Definition: A probability row vector \(\pi\) is stationary if \(\pi P(t)=\pi\) for every \(t\ge0\). For a finite-state CTMC, stationarity implies the generator equations \(\pi Q=0\), together with \(\pi_i\ge0\) and \(\sum_{i\in S}\pi_i=1\). These equations are necessary; whether a solution of them is stationary is a separate implication addressed in the next part of the course.

For the examples below, all chains are finite and irreducible: every state can be reached from every other state by a path of positive-rate transitions. The standard finite-state CTMC result established in the earlier material on stationary distributions says that such a chain has a unique stationary distribution. Consequently, if the normalized generator equations have a unique solution, that solution must be the stationary distribution: a stationary distribution exists, it satisfies the equations, and uniqueness of the normalized solution identifies it. We use this result to identify answers without proving the converse implication \(\pi Q=0\Rightarrow\pi P(t)=\pi\).

Why the Equations Have a Redundancy

For a row vector \(\pi\), the \(j\)th component of \(\pi Q\) is \(\sum_i\pi_iq_{ij}\). The equation for state \(j\) says that the total stationary rate of flow into \(j\), including the diagonal term, balances to zero. In a finite generator, the sum of all components of \(\pi Q\) is zero for every row vector \(\pi\), because

$$ \sum_j(\pi Q)_j=\sum_i\pi_i\sum_jq_{ij}=0. $$

Therefore, once all but one of the component equations hold, the final one holds as well. In practice, solve a convenient subset of the equations and use \(\sum_i\pi_i=1\) to set the scale. For a two-state chain this leaves one balance equation; for three states, it usually leaves two.

Theorem (Two-state stationary equations): Suppose \(S=\{1,2\}\), with rate \(\alpha>0\) from state \(1\) to state \(2\), and rate \(\beta>0\) from state \(2\) to state \(1\). Then the unique normalized solution of \(\pi Q=0\) is \(\pi=(\frac{\beta}{\alpha+\beta},\frac{\alpha}{\alpha+\beta})\). For the corresponding finite irreducible CTMC, this is its stationary distribution.

Proof. The generator is \(Q=\begin{bmatrix}-\alpha&\alpha\\ \beta&-\beta\end{bmatrix}\). Write \(\pi=(x,y)\), where \(x,y\ge0\) and \(x+y=1\). The first component of \(\pi Q=0\) gives \(-\alpha x+\beta y=0\), so \(\beta y=\alpha x\). Substituting \(y=1-x\) gives \(\beta(1-x)=\alpha x\), hence \((\alpha+\beta)x=\beta\) and \(x=\frac{\beta}{\alpha+\beta}\). Then \(y=1-x=\frac{\alpha}{\alpha+\beta}\). Since \(\alpha+\beta>0\), these values are uniquely determined, nonnegative, and sum to one. The finite irreducible CTMC result stated above identifies this unique solution with the stationary distribution. \(\square\)

Worked Example: Two States with Unequal Rates

Let \(S=\{1,2\}\). On a probability space \((\Omega,\mathcal{F},\mathbb{P})\), consider the continuous-time chain that jumps from \(1\) to \(2\) at rate \(2\), and from \(2\) to \(1\) at rate \(3\). Both rates are positive, so the chain is irreducible. Find its stationary distribution.

The generator is

$$ Q=\begin{bmatrix}-2&2\\3&-3\end{bmatrix}. $$

Its first row sums to \(-2+2=0\), and its second row sums to \(3-3=0\), as required. Write \(\pi=(x,y)\). The first component equation is \(-2x+3y=0\), or \(2x=3y\). Along with \(x+y=1\), this gives \(x=\frac32y\), so \(\frac52y=1\), \(y=\frac25\), and \(x=\frac35\). Thus \(\pi=(\frac35,\frac25)\).

Check: \((\frac35,\frac25)Q=( -\frac65+\frac65,\frac65-\frac65)=(0,0)\), and \(\frac35+\frac25=1\). The chain is finite and irreducible, so the unique normalized solution is its stationary distribution.

Solving a Three-State System

For three states, write one equation for each column of \(Q\), rather than reading rows as equations. If \(\pi=(x,y,z)\), then the equations are the components of \((x,y,z)Q\). Since their sum is automatically zero, only two of the three are independent. A reliable procedure is to write the generator, check its row sums, solve two component equations together with normalization, and substitute into all three components to verify the result.

Result (Finite linear-system method): For a finite irreducible CTMC, suppose the system \(\pi Q=0\), \(\sum_i\pi_i=1\) has exactly one solution. Then that solution is the stationary distribution. This method identifies the stationary distribution; it does not by itself establish the converse statement that every normalized solution of \(\pi Q=0\) is stationary for an arbitrary CTMC.

Proof. By the finite irreducible CTMC result stated above, a stationary distribution \(\widehat{\pi}\) exists. It is normalized and satisfies \(\widehat{\pi}Q=0\), so it solves the displayed system. If that system has exactly one solution, the solution computed from it must equal \(\widehat{\pi}\). Therefore the unique solution is the stationary distribution. \(\square\)

Worked Example: A Three-State Chain with Transitions in Both Directions

Let \(S=\{1,2,3\}\), and consider a continuous-time chain on a probability space \((\Omega,\mathcal{F},\mathbb{P})\). Its positive transition rates are \(1\to2\) at rate \(2\), \(2\to1\) at rate \(3\), \(2\to3\) at rate \(4\), and \(3\to2\) at rate \(5\). Find the stationary distribution.

Each state can reach every other state, so the chain is irreducible. The total rates out of states \(1,2,3\) are respectively \(2,3+4=7,5\). Therefore

$$ Q=\begin{bmatrix}-2&2&0\\3&-7&4\\0&5&-5\end{bmatrix}. $$

The row sums are \(-2+2+0=0\), \(3-7+4=0\), and \(0+5-5=0\). Set \(\pi=(x,y,z)\). The first component of \(\pi Q=0\) is \(-2x+3y=0\), giving \(x=\frac32y\). The third component is \(4y-5z=0\), giving \(z=\frac45y\). Normalize:

$$ x+y+z=\left(\frac32+1+\frac45\right)y =\frac{15+10+8}{10}y =\frac{33}{10}y=1. $$

Hence \(y=\frac{10}{33}\), \(x=\frac32\cdot\frac{10}{33}=\frac{15}{33}=\frac5{11}\), and \(z=\frac45\cdot\frac{10}{33}=\frac8{33}\). The candidate is \(\pi=(\frac{15}{33},\frac{10}{33},\frac8{33})\).

Check: The first component is \(-2\cdot\frac{15}{33}+3\cdot\frac{10}{33}=0\). The second is \(2\cdot\frac{15}{33}-7\cdot\frac{10}{33}+5\cdot\frac8{33}=\frac{30-70+40}{33}=0\). The third is \(4\cdot\frac{10}{33}-5\cdot\frac8{33}=\frac{40-40}{33}=0\). Also \((15+10+8)/33=1\), and every entry is nonnegative. The solution is unique from the equations and normalization, so it is the stationary distribution.

Worked Example: A Three-State Chain with a Directed Cycle and Extra Transitions

Let \(S=\{1,2,3\}\), with a continuous-time chain on \((\Omega,\mathcal{F},\mathbb{P})\). The positive rates are \(1\to2\) at rate \(2\), \(1\to3\) at rate \(1\), \(2\to1\) at rate \(1\), \(2\to3\) at rate \(3\), \(3\to1\) at rate \(2\), and \(3\to2\) at rate \(1\). Find the stationary distribution.

All states communicate. The rates out of states \(1,2,3\) are \(3,4,3\), respectively, so

$$ Q=\begin{bmatrix}-3&2&1\\1&-4&3\\2&1&-3\end{bmatrix}. $$

The row sums are \(-3+2+1=0\), \(1-4+3=0\), and \(2+1-3=0\). Let \(\pi=(x,y,z)\). The first component equation is \(-3x+y+2z=0\); the second is \(2x-4y+z=0\). From the second, \(z=4y-2x\). Substitution into the first gives \(-3x+y+2(4y-2x)=0\), so \(-7x+9y=0\), or \(y=\frac79x\). Then \(z=4\cdot\frac79x-2x=\frac{28}{9}x-\frac{18}{9}x=\frac{10}{9}x\). Normalization gives \(x+\frac79x+\frac{10}{9}x=\frac{26}{9}x=1\). Thus \(x=\frac9{26}\), \(y=\frac7{26}\), and \(z=\frac{10}{26}=\frac5{13}\).

Check: The first component is \(-3\cdot\frac9{26}+\frac7{26}+2\cdot\frac{10}{26}=\frac{-27+7+20}{26}=0\). The second is \(2\cdot\frac9{26}-4\cdot\frac7{26}+\frac{10}{26}=\frac{18-28+10}{26}=0\). The third is \(\frac9{26}+3\cdot\frac7{26}-3\cdot\frac{10}{26}=\frac{9+21-30}{26}=0\). The entries sum to \((9+7+10)/26=1\), and are nonnegative. Hence this is the unique normalized solution and the stationary distribution.

Common Pitfall: Multiplying on the Wrong Side

Because distributions are row vectors in this course, the stationary equations are \(\pi Q=0\), not \(Q\pi=0\). These are different systems. For the two-state example, the incorrect right-nullvector calculation \(Qv=0\) gives \(-2v_1+2v_2=0\), so \(v_1=v_2\); after normalization it suggests \((\frac12,\frac12)\). But this is not stationary: \((\frac12,\frac12)Q=(\frac12,-\frac12)\ne(0,0)\). The correct left-vector calculation gives \((\frac35,\frac25)Q=(0,0)\). Always check the product in the same orientation as the distribution convention.

A second useful check is to distinguish generator entries from transition probabilities. Off-diagonal entries of \(Q\) are rates and need not sum to one; the diagonal entry is the negative total rate out of that state, making the whole row sum to zero. A generator is not a transition matrix. Finally, satisfying the equations is not the same algebraic operation as normalizing: verify both \(\pi Q=0\) and \(\sum_i\pi_i=1\), and check that all entries are nonnegative.

Check Your Understanding

Use row-vector equations throughout, and check each proposed distribution by substitution.

  1. A two-state chain jumps from state \(1\) to state \(2\) at rate \(4\), and from state \(2\) to state \(1\) at rate \(6\). Write \(Q\) and find the normalized stationary solution.
  2. For a three-state chain with rates \(1\to2\) equal to \(1\), \(2\to1\) equal to \(2\), \(2\to3\) equal to \(3\), and \(3\to2\) equal to \(4\), write the generator and solve for \(\pi\).
  3. Explain why the three component equations of \(\pi Q=0\) cannot be independent when \(Q\) is a finite-state generator.
  4. For \(Q=\begin{bmatrix}-3&2&1\\1&-4&3\\2&1&-3\end{bmatrix}\), test whether \((\frac9{26},\frac7{26},\frac{10}{26})\) satisfies the generator equations and normalization.
  5. In one sentence, explain why solving \(Qv=0\) is not the same as solving the stationary equations under the row-vector convention.