@@ -26,7 +26,7 @@ In addition to what's in Anaconda, this lecture will need the following librarie
26262727In this lecture we will begin with the foundational concepts in spectral theory.
282829-Then we will explore the Perron-Frobenius Theorem and connect it to applications in Markov chains and networks.
29+Then we will explore the Perron-Frobenius theorem and connect it to applications in Markov chains and networks.
30303131We will use the following imports:
3232@@ -64,6 +64,9 @@ An $n \times n$ nonnegative matrix $A$ is called irreducible if $A + A^2 + A^3 +
64646565In other words, for each $i,j$ with $1 \leq i, j \leq n$, there exists a $k \geq 0$ such that $a^{k}_{ij} > 0$.
666667+```{prf:example}
68+:label: eigen2_ex_irr
69+6770Here are some examples to illustrate this further:
68716972$$
@@ -94,6 +97,7 @@ $$
94979598$C$ is not irreducible since $C^k = C$ for all $k \geq 0$ and thus
9699 $c^{k}_{12},c^{k}_{21} = 0$ for all $k \geq 0$.
100+```
9710198102### Left eigenvectors
99103@@ -159,7 +163,7 @@ This is a more common expression and where the name left eigenvectors originates
159163For a square nonnegative matrix $A$, the behavior of $A^k$ as $k \to \infty$ is controlled by the eigenvalue with the largest
160164absolute value, often called the **dominant eigenvalue**.
161165162-For any such matrix $A$, the Perron-Frobenius Theorem characterizes certain
166+For any such matrix $A$, the Perron-Frobenius theorem characterizes certain
163167properties of the dominant eigenvalue and its corresponding eigenvector.
164168165169```{prf:Theorem} Perron-Frobenius Theorem
@@ -188,7 +192,7 @@ Let's build our intuition for the theorem using a simple example we have seen [b
188192189193Now let's consider examples for each case.
190194191-#### Example: Irreducible matrix
195+#### Example: irreducible matrix
192196193197Consider the following irreducible matrix $A$:
194198@@ -204,7 +208,7 @@ We can compute the dominant eigenvalue and the corresponding eigenvector
204208eig(A)
205209```
206210207-Now we can see the claims of the Perron-Frobenius Theorem holds for the irreducible matrix $A$:
211+Now we can see the claims of the Perron-Frobenius theorem holds for the irreducible matrix $A$:
2082122092131. The dominant eigenvalue is real-valued and non-negative.
2102142. All other eigenvalues have absolute values less than or equal to the dominant eigenvalue.
@@ -223,6 +227,9 @@ Let $A$ be a square nonnegative matrix and let $A^k$ be the $k^{th}$ power of $A
223227224228A matrix is called **primitive** if there exists a $k \in \mathbb{N}$ such that $A^k$ is everywhere positive.
225229230+```{prf:example}
231+:label: eigen2_ex_prim
232+226233Recall the examples given in irreducible matrices:
227234228235$$
@@ -244,10 +251,11 @@ B^2 = \begin{bmatrix} 1 & 0 \\
244251$$
245252246253$B$ is irreducible but not primitive since there are always zeros in either principal diagonal or secondary diagonal.
254+```
247255248256We can see that if a matrix is primitive, then it implies the matrix is irreducible but not vice versa.
249257250-Now let's step back to the primitive matrices part of the Perron-Frobenius Theorem
258+Now let's step back to the primitive matrices part of the Perron-Frobenius theorem
251259252260```{prf:Theorem} Continous of Perron-Frobenius Theorem
253261:label: con-perron-frobenius
@@ -259,7 +267,7 @@ If $A$ is primitive then,
259267$ 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$.
260268```
261269262-#### Example 1: Primitive matrix
270+#### Example 1: primitive matrix
263271264272Consider the following primitive matrix $B$:
265273@@ -277,7 +285,7 @@ We compute the dominant eigenvalue and the corresponding eigenvector
277285eig(B)
278286```
279287280-Now let's give some examples to see if the claims of the Perron-Frobenius Theorem hold for the primitive matrix $B$:
288+Now let's give some examples to see if the claims of the Perron-Frobenius theorem hold for the primitive matrix $B$:
2812892822901. The dominant eigenvalue is real-valued and non-negative.
2832912. All other eigenvalues have absolute values strictly less than the dominant eigenvalue.
@@ -373,18 +381,18 @@ check_convergence(B)
373381374382The result shows that the matrix is not primitive as it is not everywhere positive.
375383376-These examples show how the Perron-Frobenius Theorem relates to the eigenvalues and eigenvectors of positive matrices and the convergence of the power of matrices.
384+These examples show how the Perron-Frobenius theorem relates to the eigenvalues and eigenvectors of positive matrices and the convergence of the power of matrices.
377385378386In fact we have already seen the theorem in action before in {ref}`the Markov chain lecture <mc1_ex_1>`.
379387380388(spec_markov)=
381-#### Example 2: Connection to Markov chains
389+#### Example 2: connection to Markov chains
382390383391We are now prepared to bridge the languages spoken in the two lectures.
384392385393A primitive matrix is both irreducible and aperiodic.
386394387-So Perron-Frobenius Theorem explains why both {ref}`Imam and Temple matrix <mc_eg3>` and [Hamilton matrix](https://en.wikipedia.org/wiki/Hamiltonian_matrix) converge to a stationary distribution, which is the Perron projection of the two matrices
395+So Perron-Frobenius theorem explains why both {ref}`Imam and Temple matrix <mc_eg3>` and [Hamilton matrix](https://en.wikipedia.org/wiki/Hamiltonian_matrix) converge to a stationary distribution, which is the Perron projection of the two matrices
388396389397```{code-cell} ipython3
390398P = np.array([[0.68, 0.12, 0.20],
@@ -449,7 +457,7 @@ As we have seen, the largest eigenvalue for a primitive stochastic matrix is one
449457This can be proven using [Gershgorin Circle Theorem](https://en.wikipedia.org/wiki/Gershgorin_circle_theorem),
450458but it is out of the scope of this lecture.
451459452-So by the statement (6) of Perron-Frobenius Theorem, $\lambda_i<1$ for all $i<n$, and $\lambda_n=1$ when $P$ is primitive.
460+So by the statement (6) of Perron-Frobenius theorem, $\lambda_i<1$ for all $i<n$, and $\lambda_n=1$ when $P$ is primitive.
453461454462Hence, after taking the Euclidean norm deviation, we obtain
455463