Source: Lecture PDF · Lecture index
Markov property and transition matrix
A stochastic process is a collection of random variables indexed by time. In a Markov chain, the current state contains the information needed to predict the next state:
For the time-homogeneous chains here, transition probabilities do not change with .
Lecture convention: column probability vectors. Define
Columns are current states; rows are next states. If is the distribution at time ,
Starting at state , use ; the probability of state after steps is . Do not mix this with the row-vector convention .
PageRank: repair the random walk
Following each outgoing link with equal probability defines . Three problems matter:
| Problem | Consequence | Repair |
|---|---|---|
| Dead end: no outgoing links | A zero column loses probability mass; the raw matrix is not stochastic | Replace that column by the uniform distribution |
| Spider trap: a closed group of pages | A walk cannot leave after entering | Allow teleportation outside the group |
| Periodicity: returns occur only at multiples of | State probabilities can oscillate instead of converging | Teleportation introduces positive self-transition probabilities |
For pages, let , and let for a dead-end column, otherwise . First repair dead ends, then add teleportation:
With probability , follow the repaired link transition; otherwise jump uniformly to any page. Each column of sums to one and every entry is positive. Consequently the finite chain is irreducible and aperiodic, with a unique stationary distribution reached from any initial distribution. PageRank scores are this distribution, not the distribution after one step.
Stationary, limiting and long-run distributions
| Quantity | Definition | Key distinction |
|---|---|---|
| Stationary distribution | , , | Starting at keeps the distribution unchanged |
| Limiting distribution | , when it exists | Describes convergence of the distribution at a particular late time |
| Long-run occupation proportions | Describes fractions of time along a sample path |
For a finite irreducible chain (every state can reach every other), is unique and occupation proportions converge to almost surely. Aperiodicity is additionally sufficient for from every starting distribution.
Essential counterexample: a deterministic two-state alternation has and spends half its time in each state, but its distribution oscillates when started at a single state. Stationarity does not by itself imply convergence. Reducible chains can have multiple stationary distributions and starting-state-dependent behaviour.
Computing and simulating
Three ways to obtain :
- Solve: together with .
- Iterate: repeatedly apply , when convergence conditions hold.
- Simulate: run a long path and count the fraction of visits to each state, when the occupation result applies.
To simulate from current state , draw and select the next state using cumulative probabilities in column . A seed makes the path reproducible; finite simulation frequencies remain estimates. The threshold construction is formalised in L9.
Hidden Markov models
In an HMM, the state follows a Markov chain but is hidden; observations arise through emission probabilities . The lecture’s example uses hidden mood and observed shopping behaviour. Transition probabilities describe changes in mood; emissions describe shopping conditional on mood. Viterbi finds a most probable hidden-state sequence given the observations and model; it does not observe the true states directly.
Connections
- L9: design a chain whose stationary distribution is a distribution we want to sample.
- L10: an MDP adds actions and rewards; a fixed stationary policy induces a Markov chain.
- L7: simulation there reproduces treatment assignment; here it reproduces state transitions.
For lecture examples: matrix, pp. 3–7 · PageRank repairs, pp. 9–18 · simulation, pp. 19–25 · HMM, pp. 26–28.