Each year, people move between three towns by fixed shares. Watch the populations settle, then try any other start.
The steady state
Each year people move between three towns by fixed shares.
Year 0: the shares start at (1, 0, 0). The dotted lines mark the steady state, (0.45, 0.35, 0.2).
Describe this picture
Two panels. On the left, small grey bars for the starting shares of towns 1, 2 and 3. On the right, a large bar for each town’s share of all the people, with a dotted line at its steady share, and curved arrows between the towns whose thickness shows how many people move that way each year: solid arcs for moves to the right, dashed for moves to the left. Under each town, the share that leaves it each year and the share that arrives. Each year 80 % of town 1 stays, 10 % moves to town 2 and 10 % to town 3; town 2 keeps 70 % and sends 20 % to town 1 and 10 % to town 3; town 3 keeps 60 % and sends 10 % to town 1 and 30 % to town 2. Over 12 s everyone starts in town 1, and the bars step year by year through , , and on, settling on the dotted lines at . At the end each town still sends people out and takes people in, the two in balance. Readouts give the year and the shares. One control after the clip: drag the starting bars, or move them with the arrow keys in steps of 0.05; the other two are rescaled so the three add up to 1, and the bars land on the same steady state.
Shares that move
Write the yearly moves as a matrix. Column says where the people of town go, and entry is the share moving from town to town :
Let hold the shares of the population in each town after years. Town next year collects of each town , which is row of times . So one year is one matrix step, and years are a power:
From , everyone in town 1, the first steps are , then , then .
Why the columns add up to 1
Each column lists where one town’s people go, so it adds up to 1: nobody is created and nobody is lost. Then the total population never changes, because the total of is
A Markov matrix is a square matrix with no negative entries whose columns each add up to 1. Many books write the transpose instead, with rows adding up to 1 and the vector on the left; this course keeps columns, so that acts on as every other matrix does.
The steady state
Where do the populations end up? At a vector that one more year leaves unchanged:
That is an eigenvector with eigenvalue 1. Every Markov matrix has one. The columns of add up to 1, so : 1 is an eigenvalue of . And and have the same eigenvalues, because a matrix and its transpose have the same determinant, so .
To find , solve as in The null space:
Its null space is the line of ; check row 2: . Scale it to add up to 1: .
Watch out
“Settled” does not mean nobody moves. At the steady state people still move every year, but each town gains as many as it loses. Town 1 loses and gains . The arrows in the picture keep flowing; only the bars stand still.
How fast it settles
The other two eigenvalues decide the speed. The trace of is 2.1 and its determinant 0.3. With one eigenvalue 1, the other two add up to 1.1 and multiply to 0.3, so they are 0.6 and 0.5. Their eigenvectors are , since , and , since . Their entries add up to 0: they move people around without changing the total.
Split the start along the three eigenvectors:
Then, by Diagonalisation and matrix powers, each year multiplies each piece by its eigenvalue:
The steady part stays, and the other two pieces fade. The slower one shrinks by 0.6 each year, so the distance to shrinks by about that factor. After 10 years the shares are , within 0.005 of .
Pieces
Each share is the steady share plus two pieces that shrink every year.
One row per town, one bar per year. Each bar is the steady share plus two pieces.
Describe this picture
Three rows of bars, one row per town, and in each row one bar for each year to 10, appearing from left to right. Every bar starts with a grey part as tall as the town’s steady share, , also marked by a dotted line across the row. On top of it sit two coloured pieces, and , drawn upward when positive and downward when negative, and a short line marks the total. The pieces shrink from year to year until they can’t be seen and only the steady part is left. There is no control.
When it does not settle
Two things can go wrong.
- It swings forever. swaps two towns every year. Its eigenvalues are 1 and , and the piece never fades: from the population jumps to and back, forever.
- It never mixes. For the identity matrix nobody moves, every vector is steady, and the end state is wherever you start.
When every entry of is positive, as for the three towns, neither can happen. Then every other eigenvalue is smaller than 1 in size, and every start whose shares add to 1 ends at the same . Drag the starting bars in the first picture to see it.
Worked example
1. Three towns. Trace 2.1 and determinant , so the eigenvalues are 1, 0.6 and 0.5. Steady state . By the formula, year 3 is , the same as multiplying three times.
2. Two brands. Each month 90 % of brand 1’s buyers stay and 10 % switch; 80 % of brand 2’s stay and 20 % switch: . The steady state is , the other eigenvalue is , and from
For this gives , as one step should.
3. A swap. has eigenvalues 1 and , and alternates forever.
Try these before you read the answers.
- In this course, do the columns or the rows of a Markov matrix add up to 1? The columns.
- Is 1 always an eigenvalue of a Markov matrix? Yes: is an eigenvector of its transpose.
- The eigenvalues are 1, 0.6 and 0.5. By what factor does the distance to the steady state shrink each step? About 0.6.
- Start everyone in town 3 instead. Does the end state change? No: it is still .
Where you’ll meet this
Market shares and populations. Any model where fixed shares move between a few states each period, such as customers between brands or animals between habitats, is a Markov matrix, and its steady state is the long-run split.
Ranking web pages. One way to rank pages imagines a reader clicking links at random. The chance of being on each page is a vector, one click is a huge Markov matrix, and the steady state is the ranking. It is found by multiplying by the matrix again and again until the vector stops changing.
Where this leads · Markov chains
Markov chains, in the probability and statistics course, reads the same matrices as chances: the weather tomorrow given the weather today. It uses the same column convention, and its -step chances are the matrix powers of this page.
Reference card
| Quantity | Formula | Notes |
|---|---|---|
| Markov matrix | , | : share from to ; columns add to 1 |
| One step | the total stays the same | |
| steps | a matrix power | |
| Steady state | , | the eigenvector for |
| Always there | is an eigenvector of | |
| Speed | error shrinks like | : the next largest in size |
| Positive entries | every start reaches the same | the other eigenvalues are smaller than 1 in size |