Skip to content
AI.info

Mathematical foundations

Markov Chains, Stationarity, and Stochastic Processes

Learn transition matrices, stationary distributions, irreducibility, mixing, detailed balance, and the role of state design in Markov models.

By the end you can

Comparison

Irreducible, aperiodic, recurrent, and stationary

These properties answer different questions about long-run behavior, and only one of them carries a number. Irreducibility and aperiodicity decide whether a chain converges at all. The modulus of the second eigenvalue decides how fast. For the best-known chain in the world, that modulus has been computed exactly.

The Google matrix is A = [cP + (1-c)E]^T. Haveliwala and Kamvar proved in 2003 that its second eigenvalue satisfies |lambda2| <= c, and that it equals c exactly whenever P has at least two irreducible closed subsets. The web hyperlink matrix has them. Their paper states the consequence: “For PageRank, the typical value of c has been given as 0.85; for this value of c, Theorem 2 thus implies that the convergence rate of the power method |λ2/λ1| for any web link matrix A is 0.85.”

The rate is 0.85 however large the web grows. Adding pages does not slow the arithmetic down.

Bryan and Leise reproduced the bound independently in 2006, in the form |lambda2| <= 1 - m, and watched it happen on a five-page example web. The error ratio ||M^k x0 - q||/||M^(k-1) x0 - q|| settles at 0.85 by iteration 5. It is still 0.85 at iterations 10 and 50.

Irreducible and aperiodic tell you the chain arrives. Only 0.85 tells you when.

FigureComparison · 4 columns

Irreducible

Every state can reach every other state.

  • One communicating class
  • Rules out isolated recurrent groups
  • Does not imply rapid mixing
  • Depends on positive-probability paths

Aperiodic

Returns are not locked to a fixed cycle.

  • Avoids deterministic oscillation
  • Often needed for convergence in distribution
  • Can be created by self-loops
  • Separate from irreducibility

Stationary

A distribution unchanged by one transition.

  • May exist without convergence from every start
  • Can be non-unique in reducible chains
  • Describes distribution, not a fixed state
  • Used as MCMC target

Mixing

Approach toward stationary behavior.

  • Has a rate
  • Can be extremely slow
  • Depends on bottlenecks
  • Determines effective independence

A stochastic process models uncertainty across an index such as time

A random variable describes one uncertain quantity. A stochastic process describes a collection of random variables indexed by time, space, or another ordered set. A Markov chain assumes that the next-state distribution depends on the present state rather than the entire observed past. The assumption belongs to the chosen state representation. If relevant history is omitted, the process may appear non-Markov even when a richer state would make the dependence local.

That is a claim about information, and it can be measured. The first person to measure it counted letters in a poem.

The Markov property is a statement about the state, not a universal fact about the world.

Case

Twenty thousand letters of Eugene Onegin, counted for a lecture in 1913

Markov built the idea out of a poem, and he built it out of counting. Lecturing to the Imperial Academy of Sciences in St Petersburg on 23 January 1913, he reported going through the first 20,000 letters of Pushkin's Eugene Onegin — the whole of chapter one and sixteen stanzas of chapter two, with the hard and soft signs excluded. Of those letters, 8,638 were vowels and 11,362 consonants. A letter drawn at random was a vowel with probability p = 0.432.

Then he counted pairs, and the picture changed. Only 1,104 of the sequences in that stretch of text placed one vowel directly after another, so the probability of a vowel given that the preceding letter was a vowel was p1 = 1104/8638 = 0.128. After a consonant, a vowel was overwhelmingly likely: p0 = 7534/11361 = 0.663. The difference is delta = -0.535. Independence would have made p1 and p0 both equal to the unconditional 0.432. His empirical dispersion coefficient came out at 0.208, against the 1.0 that independent letters would give.

He put the finding in one sentence: “As we can see, the probability of a letter being a vowel changes considerably depending upon which letter – vowel or consonant – precedes it.”

Brian Hayes recounted the whole exercise for American Scientist in 2013, and every number holds: the same lecture date, the same 20,000 letters, the same 8,638 vowels and 11,362 consonants, the same 1,104 vowel-vowel pairs. Everything that follows in this lesson — transition rows, stationary distributions, mixing rates — is machinery for handling the gap between 0.432 and 0.128.

Figure

The count that started Markov chains: a vowel is far rarer straight after a vowel than independence would allow.

Detailed balance is sufficient for stationarity, not necessary

A chain satisfies detailed balance with π when πᵢPᵢⱼ = πⱼPⱼᵢ for every pair. The probability flow between each pair is then balanced, and summing those equalities shows that π is stationary. Some stationary chains, however, have circulating probability flows and do not satisfy detailed balance.

The man who generalised the sampler said as much in print. Hastings built his transition matrix in 1970 by imposing the reversibility condition, and noted that doing so “ensures” pi is a stationary distribution of P. That is a construction device, not a law. He wrote it down plainly: “For simplicity we have considered reversible Markov chains only.” He then pointed the reader to Handscomb for an irreversible P.

Thirty years later the point was made empirically rather than parenthetically. Diaconis and two co-authors analysed a deliberately nonreversible sampler in 2000, and found that it converges better than the reversible alternative. Reversible MCMC methods use detailed balance because it simplifies design, not because every valid chain must be reversible. Giving it up can buy speed.

Example

A two-state weather chain

The Dry/Wet chain is not a teaching toy. It is the ancestor of daily-rainfall modelling. In 1962 Gabriel and Neumann fitted a two-state, first-order wet/dry Markov chain to Tel Aviv data, and the field still dates itself from that paper. A 2026 paper on long dry spells opens by saying so: “Early developments in this line of research employed two-state first-order Markov chains to represent rainfall occurrences [Gabriel and Neumann, 1962].” The whole model is two numbers, p01 and p11.

  • One-step prediction: The current state selects the appropriate transition row — after a dry day the wet probability is p01, after a wet day it is p11.
  • Multi-step prediction: Multiplying by P repeatedly propagates the state distribution forward from whichever state today happens to be in.
  • Stationary solution: Solving πP = π has a closed form here. The long-run wet-day frequency is pi = p01/(1 + p01 - p11) and the lag-1 autocorrelation is r1 = p11 - p01, as Wilks and Wilby set out in their 1999 review of stochastic weather models.
  • Interpretation: Stationarity describes long-run proportions under the model, not a claim that weather stops changing; individual days keep flipping while pi stays put.
  • Model check: A fixed-order chain makes wet and dry spell lengths geometrically distributed, so spell durations decay exponentially and such chains systematically underestimate the frequency of extreme dry spells — the documented failure mode, on top of seasonal shifts that violate a time-homogeneous transition assumption.

Analogy

The current square, and nothing before it, sets the next move

On a board game, the current square determines the probabilities of the next square. The transition matrix is the rulebook, and repeated moves propagate a distribution across the board. A stationary distribution describes the long-run fraction of visits under unchanged rules. A narrow bridge between board regions creates slow mixing, because crossing is rare. The narrowness of that bridge is exactly what the second eigenvalue measures — the quantity Haveliwala and Kamvar pinned at 0.85 for the damped web chain.

When real decisions depend on hidden history or on changing policies, the board state or the rulebook has to grow to match.

Long-run behavior is conditional on stable transitions and an adequate state.

Case

PageRank, 1998: a ranking that was a stationary distribution

Google's first ranking was a stationary distribution, and its authors said so in the vocabulary of probability rather than of search. Brin and Page's 1998 paper describes a “random surfer” who follows links and “eventually gets bored and starts on another random page”. It then says what the ranks are: “Note that the PageRanks form a probability distribution over Web pages, so the sum of all Web pages’ PageRanks will be one.” The rank vector is the principal eigenvector of the normalised link matrix — the π of a chain over the web.

The numbers are in the same paper. The boredom parameter is fixed by a sentence: “We usually set d to 0.85”. The prototype ran on a crawl of at least 24 million pages — “In our current crawl of 24 million pages” — with link maps containing as many as 518 million hyperlinks.

The construction is also on the public record as a patent. US Patent 6,285,999 B1 names Lawrence Page as inventor, was filed on 9 January 1998, and was granted on 4 September 2001. Bryan and Leise worked through the linear algebra of it in 2006.

Key idea

Memory can be hidden in the state definition

Suppose future demand depends on the last seven days, but the state stores only today's demand. The observed process may violate a first-order Markov assumption. Expanding the state to include a seven-day history can restore the property — at a cost that a professional society has written down as formal guidance.

That guidance is the ISPOR-SMDM Task Force-3 report on state-transition modelling, published in 2012. It names the Markov assumption as the primary disadvantage of cohort state-transition models, and it names the price of repairing it: “A Markov model can handle memory by creating states that include history, but this can greatly increase the number of states, resulting in very large models that are difficult to manage (i.e., “state explosion”).” Its Table 1 puts the trade-off in two rows. For cohort models, “Markov assumption, memoryless: Yes” and “Danger of explosion in number of states: Yes”; for individual-level models, “No” and “No”.

Because unlimited memory is unaffordable, the field buys a bounded amount of it. The standard device is the tunnel state, defined by Sonnenberg and Beck in 1993 as an array of temporary states visitable only in a fixed sequence. A Markov model is therefore evaluated jointly with its state representation and temporal scale.

A failed Markov assumption may reveal a poor state summary rather than long memory in the underlying mechanism.

Steps

Audit a Markov model

Use these checks before interpreting long-run or multi-step conclusions. Steps 4 and 5 are listed separately because the first MCMC calculation ever run kept them separate.

That calculation was published in June 1953 by Metropolis and four co-authors. Convergence to the Boltzmann distribution rested on two facts, argued one at a time: a symmetric proposal, P_rs = P_sr, balancing the flow between states, and irreducibility, which they called ergodicity. Then they join the two: “We have seen already that the method is ergodic; i.e., that any state can be reached from any other, albeit in several moves. These two facts mean that our ensemble must approach the canonical distribution.” They also conceded what the argument does not deliver. It “does not, of course, specify how rapidly the canonical distribution is approached”.

Rate was not an academic worry for them. The run used N = 224 rigid spheres in two dimensions on the Los Alamos MANIAC, at about three minutes per cycle. Fewer than sixteen cycles were discarded for burn-in and about forty-eight to sixty-four were kept. That bought one point on the pressure curve every four to five hours. Communication and mixing are different audits because they were different arguments from the beginning.

FigureProcess · 6 steps
  1. 1. Define the index

    State whether steps represent time, events, or algorithm iterations.

  2. 2. Define the state

    Include enough history to make local dependence plausible.

  3. 3. Validate transitions

    Check row normalization, support, and time variation.

  4. 4. Inspect communication

    Find absorbing states, disconnected classes, and cycles.

  5. 5. Study mixing

    Estimate autocorrelation, hitting times, or spectral gaps where relevant.

  6. 6. Test nonstationarity

    Look for seasonal, policy, or population changes.

Visual

Anatomy of a finite Markov chain

A finite chain is specified by states, transitions, and an initial distribution — and both cases in this lesson fill the same five slots at very different scales. Markov's state space had two members, vowel and consonant, and his counts filled a transition row directly: 0.128 for a vowel after a vowel, 0.663 for a vowel after a consonant. The random surfer's state space held 24 million pages. Its transition matrix was built from as many as 518 million hyperlinks with d = 0.85, and its stationary distribution π was the product — a probability distribution over Web pages summing to one, sold to the world as a ranking. The n-step matrix Pⁿ carries an initial distribution μ₀ towards π. The second eigenvalue says how many steps that takes.

FigureProcess · 5 steps
  1. 1

    State space

    The possible summaries of the system at one step.

  2. 2

    Transition matrix P

    Rows describe distributions over the next state.

  3. 3

    Initial distribution μ₀

    Specifies uncertainty about the starting state.

  4. 4

    n-step transition Pⁿ

    Describes how distributions propagate over multiple steps.

  5. 5

    Stationary distribution π

    Satisfies πP = π when it exists.

Key takeaways