You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lectures/eigen_II.md
+19-41Lines changed: 19 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,8 +11,6 @@ kernelspec:
11
11
name: python3
12
12
---
13
13
14
-
15
-
16
14
# Spectral Theory
17
15
18
16
```{index} single: Spectral Theory
@@ -63,11 +61,11 @@ We denote this as $A \geq 0$.
63
61
(irreducible)=
64
62
### Irreducible matrices
65
63
66
-
We have (informally) introduced irreducible matrices in the [Markov chain lecture](markov_chains_II.md).
64
+
We introduced irreducible matrices in the [Markov chain lecture](mc_irreducible).
67
65
68
-
Here we will introduce this concept formally.
66
+
Here we generalize this concept:
69
67
70
-
$A$ is called **irreducible** if for *each* $(i,j)$ there is an integer $k \geq 0$ such that $a^{k}_{ij} > 0$.
68
+
An $n \times n$ matrix $A$ is called irreducible if, for each $i,j$ with $1 \leq i, j \leq n$, there exists a $k \geq 0$ such that $a^{k}_{ij} > 0$.
71
69
72
70
A matrix $A$ that is not irreducible is called reducible.
73
71
@@ -84,29 +82,25 @@ Here are some examples to illustrate this further.
84
82
85
83
Let $A$ be a square nonnegative matrix and let $A^k$ be the $k^{th}$ power of $A$.
86
84
87
-
A matrix is considered**primitive** if there exists a $k \in \mathbb{N}$ such that $A^k$ is everywhere positive.
85
+
A matrix is called**primitive** if there exists a $k \in \mathbb{N}$ such that $A^k$ is everywhere positive.
88
86
89
87
It means that $A$ is called primitive if there is an integer $k \geq 0$ such that $a^{k}_{ij} > 0$ for *all* $(i,j)$.
90
88
91
89
We can see that if a matrix is primitive, then it implies the matrix is irreducible.
92
90
93
-
This is because if there exists an $A^k$ such that $a^{k}_{ij} > 0$ for all $(i,j)$, then it guarantees the same property for ${k+1}^th, {k+2}^th ... {k+n}^th$ iterations.
94
-
95
-
In other words, a primitive matrix is both irreducible and aperiodic as aperiodicity requires a state to be visited with a guarantee of returning to itself after a certain amount of iterations.
96
-
97
91
### Left eigenvectors
98
92
99
-
We have previously discussed right (ordinary) eigenvectors $Av = \lambda v$.
93
+
We previously discussed right (ordinary) eigenvectors $Av = \lambda v$.
100
94
101
95
Here we introduce left eigenvectors.
102
96
103
97
Left eigenvectors will play important roles in what follows, including that of stochastic steady states for dynamic models under a Markov assumption.
104
98
105
99
We will talk more about this later, but for now, let's define left eigenvectors.
106
100
107
-
A vector $w$ is called a left eigenvector of $A$ if $w$ is an eigenvector of $A^T$.
101
+
A vector $w$ is called a left eigenvector of $A$ if $w$ is an eigenvector of $A^\top$.
108
102
109
-
In other words, if $w$ is a left eigenvector of matrix A, then $A^T w = \lambda w$, where $\lambda$ is the eigenvalue associated with the left eigenvector $v$.
103
+
In other words, if $w$ is a left eigenvector of matrix $A$, then $A^\top w = \lambda w$, where $\lambda$ is the eigenvalue associated with the left eigenvector $v$.
110
104
111
105
This hints at how to compute left eigenvectors
112
106
@@ -147,17 +141,17 @@ print(w)
147
141
148
142
Note that the eigenvalues for both left and right eigenvectors are the same, but the eigenvectors themselves are different.
149
143
150
-
We can then take transpose to obtain $A^T w = \lambda w$ and obtain $w^T A= \lambda w^T$.
144
+
We can then take transpose to obtain $A^\top w = \lambda w$ and obtain $w^\top A= \lambda w^\top$.
151
145
152
146
This is a more common expression and where the name left eigenvectors originates.
153
147
154
148
(perron-frobe)=
155
149
### The Perron-Frobenius Theorem
156
150
157
-
For a nonnegative matrix $A$ the behavior of $A^k$ as $k \to \infty$ is controlled by the eigenvalue with the largest
151
+
For a square nonnegative matrix $A$, the behavior of $A^k$ as $k \to \infty$ is controlled by the eigenvalue with the largest
158
152
absolute value, often called the **dominant eigenvalue**.
159
153
160
-
For a matrix nonnegative square matrix $A$, the Perron-Frobenius Theorem characterizes certain
154
+
For any such matrix $A$, the Perron-Frobenius Theorem characterizes certain
161
155
properties of the dominant eigenvalue and its corresponding eigenvector.
162
156
163
157
```{prf:Theorem} Perron-Frobenius Theorem
@@ -178,9 +172,7 @@ If $A$ is primitive then,
178
172
179
173
6. the inequality $|\lambda| \leq r(A)$ is **strict** for all eigenvalues $\lambda$ of $A$ distinct from $r(A)$, and
180
174
7. with $v$ and $w$ normalized so that the inner product of $w$ and $v = 1$, we have
181
-
$ r(A)^{-m} A^m$ converges to $v w^{\top}$ when $m \rightarrow \infty$.
182
-
\
183
-
the matrix $v w^{\top}$ is called the **Perron projection** of $A$.
175
+
$ r(A)^{-m} A^m$ converges to $v w^{\top}$ when $m \rightarrow \infty$. The matrix $v w^{\top}$ is called the **Perron projection** of $A$
184
176
```
185
177
186
178
(This is a relatively simple version of the theorem --- for more details see
@@ -194,7 +186,7 @@ Now let's consider examples for each case.
194
186
195
187
#### Example 1: irreducible matrix
196
188
197
-
Consider the following irreducible matrix A:
189
+
Consider the following irreducible matrix $A$:
198
190
199
191
```{code-cell} ipython3
200
192
A = np.array([[0, 1, 0],
@@ -208,7 +200,7 @@ We can compute the dominant eigenvalue and the corresponding eigenvector
208
200
eig(A)
209
201
```
210
202
211
-
Now we can go through our checklist to verify the claims of the Perron-Frobenius Theorem for the irreducible matrix A:
203
+
Now we can go through our checklist to verify the claims of the Perron-Frobenius Theorem for the irreducible matrix $A$:
212
204
213
205
1. The dominant eigenvalue is real-valued and non-negative.
214
206
2. All other eigenvalues have absolute values less than or equal to the dominant eigenvalue.
@@ -218,7 +210,7 @@ Now we can go through our checklist to verify the claims of the Perron-Frobenius
218
210
219
211
#### Example 2: primitive matrix
220
212
221
-
Consider the following primitive matrix B:
213
+
Consider the following primitive matrix $B$:
222
214
223
215
```{code-cell} ipython3
224
216
B = np.array([[0, 1, 1],
@@ -228,27 +220,13 @@ B = np.array([[0, 1, 1],
228
220
np.linalg.matrix_power(B, 2)
229
221
```
230
222
231
-
We can compute the dominant eigenvalue and the corresponding eigenvector using the power iteration method as discussed {ref}`earlier<eig1_ex1>`:
232
-
233
-
```{code-cell} ipython3
234
-
num_iters = 20
235
-
b = np.random.rand(B.shape[1])
236
-
237
-
for i in range(num_iters):
238
-
b = B @ b
239
-
b = b / np.linalg.norm(b)
240
-
241
-
dominant_eigenvalue = np.dot(B @ b, b) / np.dot(b, b)
242
-
np.round(dominant_eigenvalue, 2)
243
-
```
223
+
We compute the dominant eigenvalue and the corresponding eigenvector
244
224
245
225
```{code-cell} ipython3
246
226
eig(B)
247
227
```
248
228
249
-
250
-
251
-
Now let's verify the claims of the Perron-Frobenius Theorem for the primitive matrix B:
229
+
Now let's verify the claims of the Perron-Frobenius Theorem for the primitive matrix $B$:
252
230
253
231
1. The dominant eigenvalue is real-valued and non-negative.
254
232
2. All other eigenvalues have absolute values strictly less than the dominant eigenvalue.
@@ -307,8 +285,8 @@ A1 = np.array([[1, 2],
307
285
[1, 4]])
308
286
309
287
A2 = np.array([[0, 1, 1],
310
-
[1, 0, 1],
311
-
[1, 1, 0]])
288
+
[1, 0, 1],
289
+
[1, 1, 0]])
312
290
313
291
A3 = np.array([[0.971, 0.029, 0.1, 1],
314
292
[0.145, 0.778, 0.077, 0.59],
@@ -353,7 +331,7 @@ In fact we have already seen the theorem in action before in {ref}`the markov ch
353
331
354
332
We are now prepared to bridge the languages spoken in the two lectures.
355
333
356
-
A primitive matrix is both irreducible (or strongly connected in the language of graph) and aperiodic.
334
+
A primitive matrix is both irreducible (or strongly connected in the language of {ref}`graph theory<strongly_connected>` and aperiodic.
357
335
358
336
So Perron-Frobenius Theorem explains why both Imam and Temple matrix and Hamilton matrix converge to a stationary distribution, which is the Perron projection of the two matrices
0 commit comments