Math Core

Lesson 5.5 · Eigenvalues and Eigenvectors

Markov chains

A Markov chain models a system that hops between a fixed list of states (sunny or rainy, brand A or brand B, city or suburb) with fixed probabilities for each hop. The state of the whole system after kk steps is PkP^k times the starting state, and the question "what happens in the long run?" turns out to be an eigenvector question: the long-run distribution is an eigenvector of PP for the eigenvalue 11.

Probability vectors and stochastic matrices

Definition

Probability vector and stochastic matrix

A probability vector is a vector with nonnegative entries that add up to 11.

A stochastic matrix is a square matrix whose columns are all probability vectors.

Think of entry pijp_{ij} of a stochastic matrix PP as the probability of moving to state ii from state jj in one step. Column jj lists where state jj goes, so it must add up to 11.

For example, suppose each year 90%90\% of city residents stay in the city and 10%10\% move to the suburbs, while 20%20\% of suburban residents move to the city and 80%80\% stay. With state 1 = city and state 2 = suburbs,

P=[0.90.20.10.8].P = \begin{bmatrix} 0.9 & 0.2 \\ 0.1 & 0.8 \end{bmatrix}.

The chain

A Markov chain is a sequence of probability vectors x0,x1,x2,…\mathbf{x}_0, \mathbf{x}_1, \mathbf{x}_2, \dots together with a stochastic matrix PP such that

xk+1=Pxk(k=0,1,2,… ).\mathbf{x}_{k+1} = P\mathbf{x}_k \qquad (k = 0, 1, 2, \dots).

The vector xk\mathbf{x}_k is the state vector after kk steps: its entries are the fractions of the population (or the probabilities) in each state. Unrolling the recursion gives xk=Pkx0\mathbf{x}_k = P^k\mathbf{x}_0. Multiplying a probability vector by a stochastic matrix always gives another probability vector, so every xk\mathbf{x}_k is a probability vector.

Worked example: Following the chain

In the city–suburb model, everyone starts in the city: x0=(1,0)\mathbf{x}_0 = (1, 0). Find x1\mathbf{x}_1 and x2\mathbf{x}_2.

x1=[0.90.20.10.8][10]=[0.90.1],x2=[0.90.20.10.8][0.90.1]=[0.830.17].\mathbf{x}_1 = \begin{bmatrix} 0.9 & 0.2 \\ 0.1 & 0.8 \end{bmatrix}\begin{bmatrix} 1 \\ 0 \end{bmatrix} = \begin{bmatrix} 0.9 \\ 0.1 \end{bmatrix}, \qquad \mathbf{x}_2 = \begin{bmatrix} 0.9 & 0.2 \\ 0.1 & 0.8 \end{bmatrix}\begin{bmatrix} 0.9 \\ 0.1 \end{bmatrix} = \begin{bmatrix} 0.83 \\ 0.17 \end{bmatrix}.

After two years, 83%83\% live in the city and 17%17\% in the suburbs. Keep going and you get x3≈(0.781,0.219)\mathbf{x}_3 \approx (0.781, 0.219), x4≈(0.747,0.253)\mathbf{x}_4 \approx (0.747, 0.253), and the numbers settle down toward (2/3,1/3)(2/3, 1/3).

Steady-state vectors

If the chain settles down to some vector q\mathbf{q}, then applying PP must leave q\mathbf{q} unchanged.

Definition

Steady-state vector

A steady-state vector (or equilibrium vector) for a stochastic matrix PP is a probability vector q\mathbf{q} with

Pq=q.P\mathbf{q} = \mathbf{q}.

In the language of this unit, q\mathbf{q} is an eigenvector of PP with eigenvalue 11, scaled so its entries add up to 11. Every stochastic matrix has 11 as an eigenvalue: the rows of PTP^T add up to 11, so PT(1,1,…,1)=(1,1,…,1)P^T(1, 1, \dots, 1) = (1, 1, \dots, 1), and PP and PTP^T have the same eigenvalues.

To find q\mathbf{q}:

  1. Solve (P−I)x=0(P - I)\mathbf{x} = \mathbf{0} and pick any nonzero solution.
  2. Divide it by the sum of its entries.

Worked example: A 2 × 2 steady state

Find the steady-state vector of P=[0.90.20.10.8]P = \begin{bmatrix} 0.9 & 0.2 \\ 0.1 & 0.8 \end{bmatrix}.

P−I=[−0.10.20.1−0.2]P - I = \begin{bmatrix} -0.1 & 0.2 \\ 0.1 & -0.2 \end{bmatrix}. Both rows say x1=2x2x_1 = 2x_2, so (2,1)(2, 1) is a solution. Its entries add up to 33, so

q=[2/31/3].\mathbf{q} = \begin{bmatrix} 2/3 \\ 1/3 \end{bmatrix}.

Check: 0.9⋅23+0.2⋅13=1.8+0.23=230.9 \cdot \tfrac{2}{3} + 0.2 \cdot \tfrac{1}{3} = \tfrac{1.8 + 0.2}{3} = \tfrac{2}{3}. In the long run, two thirds of the population lives in the city.

Worked example: A 3 × 3 steady state

Find the steady-state vector of P=[0.50.20.30.30.80.30.200.4]P = \begin{bmatrix} 0.5 & 0.2 & 0.3 \\ 0.3 & 0.8 & 0.3 \\ 0.2 & 0 & 0.4 \end{bmatrix}.

First check that each column adds up to 11: 0.5+0.3+0.20.5 + 0.3 + 0.2, 0.2+0.8+00.2 + 0.8 + 0, 0.3+0.3+0.40.3 + 0.3 + 0.4. Now solve (P−I)x=0(P - I)\mathbf{x} = \mathbf{0}:

−0.5x1+0.2x2+0.3x3=00.3x1−0.2x2+0.3x3=00.2x1+0x2−0.6x3=0\begin{aligned} -0.5x_1 + 0.2x_2 + 0.3x_3 &= 0 \\ 0.3x_1 - 0.2x_2 + 0.3x_3 &= 0 \\ 0.2x_1 + 0x_2 - 0.6x_3 &= 0 \end{aligned}

The third equation gives x1=3x3x_1 = 3x_3. Substituting into the first: −1.5x3+0.2x2+0.3x3=0-1.5x_3 + 0.2x_2 + 0.3x_3 = 0, so x2=6x3x_2 = 6x_3. (The second equation checks: 0.9x3−1.2x3+0.3x3=00.9x_3 - 1.2x_3 + 0.3x_3 = 0.) Taking x3=1x_3 = 1 gives (3,6,1)(3, 6, 1), whose entries add up to 1010:

q=[0.30.60.1].\mathbf{q} = \begin{bmatrix} 0.3 \\ 0.6 \\ 0.1 \end{bmatrix}.

Why the chain converges

Definition

Regular stochastic matrix

A stochastic matrix PP is regular if some power PkP^k has all entries strictly positive.

The matrix in the 3×33 \times 3 example has a zero entry, but P2P^2 does not (its (3,2)(3, 2) entry is 0.2⋅0.2+0⋅0.8+0.4⋅0=0.040.2 \cdot 0.2 + 0 \cdot 0.8 + 0.4 \cdot 0 = 0.04), so it is regular.

Convergence theorem

If PP is a regular stochastic matrix, then PP has a unique steady-state vector q\mathbf{q}, and for every starting probability vector x0\mathbf{x}_0, the chain xk=Pkx0\mathbf{x}_k = P^k\mathbf{x}_0 converges to q\mathbf{q}.

Eigenvectors show why. For the city–suburb matrix, the trace is 1.71.7, so the eigenvalues are 11 and 0.70.7. An eigenvector for 0.70.7 is (1,−1)(1, -1). Write the starting vector in the eigenvector basis:

x0=[10]=[2/31/3]+13[1−1]⟹xk=[2/31/3]+13(0.7)k[1−1].\mathbf{x}_0 = \begin{bmatrix} 1 \\ 0 \end{bmatrix} = \begin{bmatrix} 2/3 \\ 1/3 \end{bmatrix} + \frac{1}{3}\begin{bmatrix} 1 \\ -1 \end{bmatrix} \quad\Longrightarrow\quad \mathbf{x}_k = \begin{bmatrix} 2/3 \\ 1/3 \end{bmatrix} + \frac{1}{3}(0.7)^k\begin{bmatrix} 1 \\ -1 \end{bmatrix}.

The eigenvalue-11 part never changes, and the other part shrinks by a factor of 0.70.7 every step, so xk→q\mathbf{x}_k \to \mathbf{q}. The graph shows the city fraction 23+13(0.7)k\tfrac{2}{3} + \tfrac{1}{3}(0.7)^k approaching 23\tfrac{2}{3}.

The fraction of people in the city after k years. The gap to the steady state 2/3 shrinks by the second eigenvalue, 0.7, each year.Open in grapher →

Tip

For a 2×22 \times 2 stochastic matrix [1−aba1−b]\begin{bmatrix} 1 - a & b \\ a & 1 - b \end{bmatrix}, the eigenvalues are 11 and 1−a−b1 - a - b (from the trace), and the steady state is q=1a+b[ba]\mathbf{q} = \dfrac{1}{a + b}\begin{bmatrix} b \\ a \end{bmatrix}. The closer the second eigenvalue is to 00, the faster the chain converges.

Common mistake

Without regularity, the chain need not settle down. For P=[0110]P = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}, the steady state is (0.5,0.5)(0.5, 0.5), but starting from (1,0)(1, 0) the chain jumps back and forth between (1,0)(1, 0) and (0,1)(0, 1) forever. Every power of PP has zeros, so PP is not regular. (Its other eigenvalue is −1-1, which never shrinks.) Also remember that in this course the columns of PP add up to 11; some books use rows instead and multiply on the other side.

Practice

Practice 1

Which matrix is stochastic?

Practice 2

Let P=[0.60.30.40.7]P = \begin{bmatrix} 0.6 & 0.3 \\ 0.4 & 0.7 \end{bmatrix} and x0=(0.5,0.5)\mathbf{x}_0 = (0.5, 0.5). Find x1=Px0\mathbf{x}_1 = P\mathbf{x}_0.

Enter a point like (2, -3)

Practice 3

Find the steady-state vector of P=[0.60.30.40.7]P = \begin{bmatrix} 0.6 & 0.3 \\ 0.4 & 0.7 \end{bmatrix}.

Enter a point like (2, -3)

Practice 4

The matrix P=[0.60.30.40.7]P = \begin{bmatrix} 0.6 & 0.3 \\ 0.4 & 0.7 \end{bmatrix} has 11 as an eigenvalue. Find its other eigenvalue.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 5

In a town, if a day is sunny, the next day is sunny with probability 0.80.8. If a day is rainy, the next day is sunny with probability 0.40.4. Today is sunny. What is the probability that the day after tomorrow is sunny?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 6

In the weather model of the previous problem, what fraction of days are sunny in the long run?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 7

Find the steady-state vector of P=[0.70.10.20.20.80.20.10.10.6]P = \begin{bmatrix} 0.7 & 0.1 & 0.2 \\ 0.2 & 0.8 & 0.2 \\ 0.1 & 0.1 & 0.6 \end{bmatrix}.

Enter a point like (2, -3)

Practice 8

Which stochastic matrix is not regular?