A machine moves between two modes, A and B, by a fixed transition matrix, and its mode keeps changing. Even so, it makes sense to ask for the probability that it is in mode A on day 100, and whether that probability settles down as the day number grows. This lesson finds the distributions that one transition leaves unchanged, called stationary distributions, proves that in one two-state chain every starting distribution approaches such a distribution, and uses two small chains to show that neither convergence nor uniqueness comes automatically.
Key terms
Stationary distribution
Definition Let be a time-homogeneous Markov chain on a finite state space with transition matrix , so that whenever . The entries of are nonnegative and its rows each sum to . Write the distribution of as a row vector with entries . By the law of total probability , so . A row vector is a stationary distribution of the chain if
If , then , and by induction for every .
In plain words A stationary distribution is a fixed point of the update . The chain itself may keep moving between states. What stays the same, when the chain starts from , is the probability of each state at each fixed time. The definition says nothing about what happens from other starting distributions.
Example Take states A and B with
where the first row and the first column belong to A. The vector has nonnegative entries that add to , and
so and is stationary. If is A with probability and B with probability , then at every step , although the chain still moves back and forth between A and B.
Balance equations
Definition Written out entry by entry, the equation is the system of balance equations, one for each state ,
The right side is the probability of being in one step after a start from . The equations are linear and homogeneous, so the zero vector and every multiple of a solution solve them as well. A stationary distribution is a solution that also has nonnegative entries and satisfies the normalization . Because every row of sums to , the sum of all the balance equations reduces to . So any one of the equations follows from the others, and the normalization takes its place.
In plain words For each state, the probability of being there one step later must equal the probability of being there now. The balance equations never fix the overall scale, since doubling a solution gives another solution, and the normalization chooses the scale at which the entries add to .
Example For the matrix above, write , which builds in the normalization. The balance equation for A is
so and . The equation for B, , simplifies to the same condition , as the redundancy predicts. Without the normalization, every vector solves both equations. The same steps for a two-state chain that leaves A with probability and leaves B with probability , where , give the unique stationary distribution
and here and .
Probability flow
Definition When the chain has distribution at time , the probability flow from state to a different state is . It equals , the probability that the step from time to time goes from to . Subtracting from both sides of the balance equation for and using gives the equivalent form
So a probability vector is stationary exactly when, at every state, the total flow out to other states equals the total flow in from other states. This is a balance of totals. The stronger pairwise condition for every pair of states, called detailed balance, also makes stationary, but a stationary distribution need not satisfy it.
In plain words Think of as an amount of probability sitting on state . In one step the share of it moves to . Stationarity means that at every state the arrivals exactly replace the departures, even though probability may keep moving. With two states the only flow out of A goes to B and the only flow into A comes from B, so the totals reduce to one pairwise equation. With three or more states, probability can circulate around a cycle.
Example For in the two-state chain, the flow from A to B is and the flow from B to A is . Now take states 1, 2 and 3 with
so each state either stays or moves one place forward around the cycle 1, 2, 3, 1. Every column also sums to , so the uniform vector satisfies for every and is stationary. Its flow from 1 to 2 is , while its flow from 2 to 1 is , so detailed balance fails. Each state still sends out and receives , so the totals balance.
Convergence of the state distribution
Definition The state distribution converges to a distribution if as for every state . Whether this happens, and what the limit is, can depend on the initial distribution , so a convergence statement has to say which starting distributions it covers. On a finite state space every such limit is stationary, because letting in gives . A stationary distribution, on the other hand, need not be the limit from other starts. For the two-state matrix above and every initial distribution, the probability satisfies
so and from every start.
In plain words Convergence is about probabilities at a fixed late time, not about a single path. The path keeps moving, but in this chain the chance of finding it in A at time tends to whatever the start. The proof below uses the entries of this particular matrix. Knowing that is stationary would not by itself give convergence.
Example By the law of total probability,
The stationary value satisfies the same equation, . Subtracting the two gives , so each step halves the distance to , and repeating the step gives the formula above. Starting in A, the probabilities of A at times to are , , , and . Starting in B they are , , , and , approaching from below. For a general two-state chain with switching probabilities and , the same subtraction multiplies the difference by at each step when , and when the chain never moves. So every start leads to the same limit exactly when .
Periodic chain
Definition Suppose the chain can return to state , meaning for some . The period of is the greatest common divisor of all such . The state is periodic if its period is at least and aperiodic if its period is . A chain whose states all have the same period is called periodic, and in it a return to any state can happen only after a multiple of steps. Started from a single state, such a chain can cycle through its states in a fixed rhythm, so its state distribution need not converge, even when the state space is finite and a stationary distribution exists.
In plain words A periodic chain keeps a beat. From a known start, the probabilities can keep cycling with that beat instead of settling. A stationary distribution is still preserved when the chain starts from it. What can fail is the approach to it from other starts.
Example The flip chain with
switches state at every step. Returns to A happen exactly after the even numbers of steps, so A has period , and so does B. The balance equation gives the unique stationary distribution , and a chain started from it has at every step. Started in A, the path is A, B, A, B and so on with certainty, so
which never settles. Along that path, the fraction of the times spent in A is for even and for odd , which tends to . The fraction of time spent in A converges while the probability of A at a fixed time does not, so the two are different quantities.
Nonunique stationary distribution
Definition A chain has a nonunique stationary distribution when the balance equations together with nonnegativity and normalization have more than one solution. Every chain with finitely many states has at least one stationary distribution. If and are two different ones, then every mixture with is stationary as well, so there are infinitely many. For a two-state chain the stationary distribution is unique unless is the identity matrix, as the general two-state solution above shows.
In plain words A chain can have parts that it never moves between, and each part can hold its own share of stationary probability. Then the long-run behavior can depend on where the chain starts, and no single distribution describes it for every start. Uniqueness has to be checked for the matrix at hand, for example by solving the equations.
Example Under the identity matrix on states A and B, each state stays put with probability . Every vector with satisfies , so every distribution on the two states is stationary. The distribution never changes, so for every , and the limit is whatever the start was. A less trivial case has states L, M and R with
where L and R keep the chain forever and M sends it to L or R with equal probability. No state leads into M, so the balance equation for M reads , and every vector with is stationary.
Check yourself
- Find the stationary distribution of the chain on A and B with the transition matrix below, and check that the probability flows between A and B balance.
Show the answer
Write . The balance equation for A is
so and . The stationary distribution is , and it is the only one because this equation has a single solution. The flow from A to B is , and the flow from B to A is . They are equal, as they must be for a stationary distribution of a two-state chain.
- For the same chain started in B, write a recurrence for , find and , and find the first with .
Show the answer
By the law of total probability,
The stationary value satisfies , and subtracting gives
With this gives , so and . As a check, the two-step paths from B that end in A are B, A, A with probability and B, B, A with probability , which add to . The distance to is , which is for and for , so the first such is . The same formula shows that the state distribution converges to from every initial distribution.
- The flip chain on A and B switches state at every step and starts in A. A classmate says that because is stationary, is close to . Find , and the fraction of the times that the path spends in A. Under which initial distribution would the classmate’s value be right?
Show the answer
Started in A, the flip chain is in A exactly at the even times, with certainty. So and , far from . The path is in A at the even times among , so the fraction of time in A is . The classmate has confused stationarity with convergence. A stationary distribution is preserved when the chain starts from it, so if were A or B with probability each, then for every , including . Since for this chain, this is the only initial distribution that gives exactly . From the start in A, the value appears only as a long-run fraction of time along the path, not as a probability at a fixed time.