Mathematics Basics - Linear Algebra (Matrix Part 3)

Eigen Theory

Define Eigen Vectors and Eigen Values

We have seen previously how to transform a single vector to a new vector space by matrix multiplication. In fact, we can also apply transformation on every vector in a vector space. Scaling, sheering, rotating and other types of linear transformation we have learned can all be applied to multiple vectors at the same time. In order to differentiate one transformation from the other, we have to find some characteristics of each transformation. One kind of characteristics is what we will discover later by Eigen vectors and Eigen values.

Let’s start from a transformation in 2-D space. Such a transformation can be visualized as follows. We draw a square centered at the origin with its sides intersecting the axis at basis vectors. Then we perform a transformation by distorting the shape of this square according to the change in basis vectors. The resultant shape shows the change of vectors in the original vector space. For example, we can scale every vector in the original square vertically by factor of 2 as shown below.

Scaling Transformation

Vectors v 1 v_1 v1, v 2 v_2 v2 and v 3 v_3 v3 have been transformed to v 1 ′ v_1' v1, v 2 ′ v_2' v2 and v 3 ′ v_3' v3 respectively. It can be seen that v 1 v_1 v1 and v 2 v_2 v2 are special because they still lie on the same line after the scaling transformation. These special vectors are the characteristics of this transformation. They are also called Eigen vectors. On the other hand, v 3 v_3 v3 originally is at 45° to the axis but it is now changed to a different angle. It is thus not an Eigen vector in this scaling transformation. In addition, length of v 1 v_1 v1 is doubled after transformation, so v 1 v_1 v1 has an Eigen value of 2. Length of v 2 v_2 v2 is unchanged. Hence Eigen value for v 2 v_2 v2 is 1.

We can look at one more example to find the Eigen vectors of a sheering transformation below.

Sheering Transformation

For sheering in the horizontal direction, only v 2 v_2 v2 remains in its original direction. Both v 1 v_1 v1 and v 3 v_3 v3 have changed direction after transformation. Therefore v 2 v_2 v2 is the Eigen vector in this transformation with an Eigen value 1.

Lastly, we can see what happens if we apply a rotation transformation.

Rotation Transformation

This time no vector remains in its original direction, thus there is no Eigen vector in this transformation.

The concept of Eigen vectors and Eigen values is the same for transformation in three or more dimensions. In general, we define a vector as Eigen vector if, after linear transformation, it still lies on exactly the same or opposite direction as before. The stretch or shrink in length for the Eigen vectors are defined as Eigen values. Therefore, the combination of Eigen vectors and their associated Eigen values can help us define a linear transformation in any dimensions.

Compute Eigen Vectors and Eigen Values Mathematically

It’s relatively easier to visually deduce the Eigen vectors when only simple transformation is performed. However, it becomes challenging soon when we have composite transformation or transformation in more than two dimensions. Therefore, we need to find an analytical method for solving Eigen vectors in a more complicated transformation.

It turns out all Eigen vectors in a transformation must satisfy following equation.

A x = λ x (1) Ax = \lambda x \tag{1} Ax=λx(1)

where x x x is the Eigen vector, A A A is an n by n transformation matrix and λ \lambda λ is a scalar (Eigen value).

This equation tells us when an Eigen vector is multiplied by a transformation matrix, the result is just a scalar multiplication of that Eigen vector.

We can rearrange equation (1) to get

( A − λ I ) x = 0 (2) (A-\lambda I)x=0 \tag{2} (AλI)x=0(2)

Identity matrix I I I is introduced here so we can take the proper subtraction between matrix A A A and scalar λ \lambda λ.

The solution to equation (2) could be either x = 0 x=0 x=0 or A − λ I = 0 A-\lambda I = 0 AλI=0. However, x = 0 x=0 x=0 is a trivial solution because the point at origin has no magnitude or direction thus is not transformed. We should instead solve for A − λ I = 0 A-\lambda I = 0 AλI=0. This is equivalent to say the magnitude of matrix A − λ I A-\lambda I AλI is 0, i.e., d e t ( A − λ I ) = 0 det(A-\lambda I)=0 det(AλI)=0.

It’s generally hard to calculate matrix determinant. However, we learned previously that there is a shortcut to solve for matrix determinant if it is a 2 by 2 matrix. For a matrix A = ( a b c d ) A=\begin{pmatrix}a&b\\c&d\end{pmatrix} A=(acbd), we can get,

d e t ( A − λ I ) = 0 d e t ( ( a b c d ) − ( λ 0 0 λ ) ) = 0 d e t ( ( a − λ b c d − λ ) ) = 0 ( a − λ ) ( d − λ ) − b c = 0 λ 2 − ( a + d ) λ + a d − b c = 0 (3) \begin{aligned} det(A-\lambda I)&=0 \\ det\left(\begin{pmatrix}a&b\\c&d\end{pmatrix}-\begin{pmatrix}\lambda&0\\0&\lambda\end{pmatrix}\right)&=0 \\ det\left(\begin{pmatrix}a-\lambda & b\\c & d-\lambda\end{pmatrix}\right)&=0 \\ (a-\lambda)(d-\lambda)-bc&=0 \\ \lambda^2-(a+d)\lambda+ad-bc&=0 \end{aligned} \tag{3} det(AλI)det((acbd)(λ00λ))det((aλcbdλ))(aλ)(dλ)bcλ2(a+d)λ+adbc=0=0=0=0=0(3)

The solution to λ \lambda λ in equation (3) is the Eigen value. We can then use this Eigen value to find its corresponding Eigen vectors.

Take our vertical scaling transformation as an example. The transformation matrix is represented by A = ( 1 0 0 2 ) A=\begin{pmatrix}1&0\\0&2\end{pmatrix} A=(1002). We solve for d e t ( A − λ I ) = 0 det(A-\lambda I) = 0 det(AλI)=0.

d e t ( ( 1 0 0 2 ) − λ I ) = 0 λ 2 − ( 1 + 2 ) λ + 1 ∗ 2 − 0 ∗ 0 = 0 λ 2 − 3 λ + 2 = 0 \begin{aligned} det\left(\begin{pmatrix}1&0\\0&2\end{pmatrix}-\lambda I\right)&=0 \\ \lambda^2-(1+2)\lambda+1*2-0*0&=0\\ \lambda^2-3\lambda+2&=0 \end{aligned} det((1002)λI)λ2(1+2)λ+1200λ23λ+2=0=0=0

The solution is λ = 1 \lambda=1 λ=1 or λ = 2 \lambda=2 λ=2.

When λ = 1 \lambda = 1 λ=1, substituting A A A and λ \lambda λ into equation (2) we get

( ( 1 0 0 2 ) − 1 ∗ ( 1 0 0 1 ) ) ∗ ( x 1 x 2 ) = 0 ( 0 0 0 1 ) ∗ ( x 1 x 2 ) = 0 ( 0 x 2 ) = 0 \begin{aligned} \left(\begin{pmatrix}1&0\\0&2\end{pmatrix}-1*\begin{pmatrix}1&0\\0&1\end{pmatrix}\right)*\begin{pmatrix}x_1\\x_2\end{pmatrix}&=0 \\ \begin{pmatrix}0&0\\0&1\end{pmatrix}*\begin{pmatrix}x_1\\x_2\end{pmatrix}&=0 \\ \begin{pmatrix}0\\x_2\end{pmatrix}&=0 \end{aligned} ((1002)1(1001))(x1x2)(0001)(x1x2)(0x2)=0=0=0

This shows that any vector with x 2 = 0 x_2 = 0 x2=0, i.e. along the horizontal axis, is an Eigen vector. The Eigen value is 1. This aligns with vector v 2 v_2 v2 in our previous illustration.

When λ = 2 \lambda = 2 λ=2, substituting A A A and λ \lambda λ into equation (2) we get

( ( 1 0 0 2 ) − 2 ∗ ( 1 0 0 1 ) ) ∗ ( x 1 x 2 ) = 0 ( − 1 0 0 0 ) ∗ ( x 1 x 2 ) = 0 ( − x 1 0 ) = 0 \begin{aligned} \left(\begin{pmatrix}1&0\\0&2\end{pmatrix}-2*\begin{pmatrix}1&0\\0&1\end{pmatrix}\right)*\begin{pmatrix}x_1\\x_2\end{pmatrix}&=0 \\ \begin{pmatrix}-1&0\\0&0\end{pmatrix}*\begin{pmatrix}x_1\\x_2\end{pmatrix}&=0 \\ \begin{pmatrix}-x_1\\0\end{pmatrix}&=0 \end{aligned} ((1002)2(1001))(x1x2)(1000)(x1x2)(x10)=0=0=0

This shows that any vector with x 1 = 0 x_1=0 x1=0, i.e. along the vertical axis, is an Eigen vector. The Eigen value is 2. This aligns with vector v 1 v_1 v1 in our previous illustration.

Let’s do another example with the rotation transformation. The transformation matrix is represented by A = ( 0 − 1 1 0 ) A=\begin{pmatrix}0&-1\\1&0\end{pmatrix} A=(0110). Again, we solve for d e t ( A − λ I ) = 0 det(A-\lambda I )= 0 det(AλI)=0.

d e t ( ( 0 − 1 1 0 ) − λ I ) = 0 λ 2 − ( 0 + 0 ) λ + 0 ∗ 0 − ( − 1 ) ∗ 1 = 0 λ 2 + 1 = 0 \begin{aligned} det\left(\begin{pmatrix}0&-1\\1&0\end{pmatrix}-\lambda I\right)&=0 \\ \lambda^2-(0+0)\lambda+0*0-(-1)*1&=0\\ \lambda^2+1&=0 \end{aligned} det((0110)λI)λ2(0+0)λ+00(1)1λ2+1=0=0=0

There is no real number solution for this equation. Therefore, no Eigen value or Eigen vector can be found for the rotation transformation. This result agrees with what we observed intuitively with the previous illustration.

Of course, this method of finding Eigen values and Eigen vectors can get much more difficult for higher dimensional space as it involves solving the roots of a polynomial equation of order n, dimension of matrix A A A. We shall then turn to computers which employs some iterative method to solve this problem . Nonetheless, understanding the underlying concepts of this analytical method is still valuable.

Use Eigen Vectors to Perform Repeated Multiplication

We shall look at one important application of Eigen vectors, repeated multiplication of a matrix by itself. This happens, for example, when we apply the same transformation matrix to a vector many times. In order to apply a transformation matrix T T T on a vector v v v, we perform one multiplication calculation T ∗ v T*v Tv. If we apply the same transformation again, we get T ∗ T ∗ v T*T*v TTv or T 2 ∗ v T^2*v T2v. Consequently, if we apply the same transformation n times we get T n ∗ v T^n*v Tnv.

It is in general difficult to perform matrix multiplication repeatedly because rows and columns of the matrix have to be multiplied and summed repeatedly. There is one exception though. If matrix T T T is a diagonal matrix (all the terms in this matrix are zero except for those along the leading diagonal), repeated multiplication of matrix T T T can be simplified.

Let’s take an example of T = ( 2 0 0 3 ) T=\begin{pmatrix}2&0\\0&3\end{pmatrix} T=(2003) and try to multiply it by itself repeatedly.

KaTeX parse error: No such environment: align at position 8: \begin{̲a̲l̲i̲g̲n̲}̲ T^2&=\begin{pm…

Therefore, we can derive a simplified formula to raise the power of a diagonal matrix T T T.

( t 11 0 ⋯ 0 0 t 22 ⋯ 0 ⋮ ⋮ ⋱ ⋮ 0 0 ⋯ t i i ) n = ( ( t 11 ) n 0 ⋯ 0 0 ( t 22 ) n ⋯ 0 ⋮ ⋮ ⋱ ⋮ 0 0 ⋯ ( t i i ) n ) \begin{pmatrix} t_{11}&0&\cdots&0\\ 0&t_{22}&\cdots&0\\ \vdots&\vdots&\ddots&\vdots\\ 0&0&\cdots&t_{ii} \end{pmatrix}^{n} =\begin{pmatrix} (t_{11})^n&0&\cdots&0\\ 0&(t_{22})^n&\cdots&0\\ \vdots&\vdots&\ddots&\vdots\\ 0&0&\cdots&(t_{ii})^n \end{pmatrix} t11000t22000tiin=(t11)n000(t22)n000(tii)n

Note this is true regardless the number of dimension of T T T.

The task then becomes how we can convert a matrix from its original form to a diagonal matrix form. Let’s take an example of a 2 by 2 matrix T = ( 1 1 0 2 ) T=\begin{pmatrix}1&1\\0&2\end{pmatrix} T=(1012). We can solve by equation (3) to get Eigen values λ 1 = 1 \lambda_1=1 λ1=1 or λ 2 = 2 \lambda_2=2 λ2=2. A diagonal matrix D D D can be constructed with these 2 Eigen values, D = ( λ 1 0 0 λ 2 ) D=\begin{pmatrix}\lambda_1&0\\0&\lambda_2\end{pmatrix} D=(λ100λ2). With the Eigen values, we could also come up with 2 Eigen vectors ( 1 0 ) \begin{pmatrix}1\\0\end{pmatrix} (10) and ( 1 1 ) \begin{pmatrix}1\\1\end{pmatrix} (11). These are our column vectors in an Eigen matrix C = ( 1 1 0 1 ) C=\begin{pmatrix}1&1\\0&1\end{pmatrix} C=(1011). It turns out that the multiplication result of T ∗ C T*C TC is the same as C ∗ D C*D CD due to the special properties of Eigen vectors.

T ∗ C = ( 1 1 0 2 ) ∗ ( 1 1 0 1 ) = ( 1 2 0 2 ) = ( 1 1 0 1 ) ∗ ( 1 0 0 2 ) = C ∗ D \begin{aligned} T*C&=\begin{pmatrix}1&1\\0&2\end{pmatrix}*\begin{pmatrix}1&1\\0&1\end{pmatrix}\\ &=\begin{pmatrix}1&2\\0&2\end{pmatrix}\\ &=\begin{pmatrix}1&1\\0&1\end{pmatrix}*\begin{pmatrix}1&0\\0&2\end{pmatrix}\\ &=C*D \end{aligned} TC=(1012)(1011)=(1022)=(1011)(1002)=CD

Since T ∗ C = C ∗ D T*C=C*D TC=CD, we can get an expression for T T T alone.

T ∗ C = C ∗ D T = C ∗ D ∗ C − 1 (4) \begin{aligned} T*C&=C*D\\ T&=C*D*C^{-1} \end{aligned} \tag{4} TCT=CD=CDC1(4)

In equation (4), we have C C C as an Eigen matrix, D D D as a diagonal matrix and C − 1 C^{-1} C1 as the inverse of C C C. So to raise power for matrix T T T,

T 2 = C ∗ D ∗ C − 1 ∗ C ∗ D ∗ C − 1 = C ∗ D ∗ I ∗ D ∗ C − 1 = C ∗ D 2 ∗ C − 1 (5) \begin{aligned} T^2&=C*D*C^{-1}*C*D*C^{-1}\\ &=C*D*I*D*C^{-1}\\ &=C*D^2*C^{-1}\tag{5} \end{aligned} T2=CDC1CDC1=CDIDC1=CD2C1(5)

T 3 = C ∗ D 2 ∗ C − 1 ∗ C ∗ D ∗ C − 1 = C ∗ D 2 ∗ I ∗ D ∗ C − 1 = C ∗ D 3 ∗ C − 1 (6) \begin{aligned} T^3&=C*D^2*C^{-1}*C*D*C^{-1}\\ &=C*D^2*I*D*C^{-1}\\ &=C*D^3*C^{-1}\tag{6}\\ \end{aligned} T3=CD2C1CDC1=CD2IDC1=CD3C1(6)

⋮ T n = C ∗ D n ∗ C − 1 \vdots\\ T^n=C*D^n*C^{-1} Tn=CDnC1

Let’s verify this result by computing T 2 T^2 T2 and T 3 T^3 T3 directly.

T 2 = ( 1 1 0 2 ) ∗ ( 1 1 0 2 ) = ( 1 3 0 4 ) T 3 = ( 1 3 0 4 ) ∗ ( 1 1 0 2 ) = ( 1 7 0 8 ) \begin{aligned} T^2=\begin{pmatrix}1&1\\0&2\end{pmatrix}*\begin{pmatrix}1&1\\0&2\end{pmatrix}=\begin{pmatrix}1&3\\0&4\end{pmatrix}\\ T^3=\begin{pmatrix}1&3\\0&4\end{pmatrix}*\begin{pmatrix}1&1\\0&2\end{pmatrix}=\begin{pmatrix}1&7\\0&8\end{pmatrix} \end{aligned} T2=(1012)(1012)=(1034)T3=(1034)(1012)=(1078)

Substituting C = ( 1 1 0 1 ) C=\begin{pmatrix}1&1\\0&1\end{pmatrix} C=(1011), D = ( 1 0 0 2 ) D=\begin{pmatrix}1&0\\0&2\end{pmatrix} D=(1002) and C − 1 = ( 1 − 1 0 1 ) C^{-1}=\begin{pmatrix}1&-1\\0&1\end{pmatrix} C1=(1011) into equation (5) and (6), we can get the same result.

T 2 = C ∗ D 2 ∗ C − 1 = ( 1 1 0 1 ) ∗ ( 1 0 0 2 ) 2 ∗ ( 1 − 1 0 1 ) = ( 1 4 0 4 ) ∗ ( 1 − 1 0 1 ) = ( 1 3 0 4 ) T 3 = C ∗ D 3 ∗ C − 1 = ( 1 1 0 1 ) ∗ ( 1 0 0 2 ) 3 ∗ ( 1 − 1 0 1 ) = ( 1 8 0 8 ) ∗ ( 1 − 1 0 1 ) = ( 1 7 0 8 ) \begin{aligned} T^2=C*D^2*C^{-1}=\begin{pmatrix}1&1\\0&1\end{pmatrix}*\begin{pmatrix}1&0\\0&2\end{pmatrix}^2*\begin{pmatrix}1&-1\\0&1\end{pmatrix}=\begin{pmatrix}1&4\\0&4\end{pmatrix}*\begin{pmatrix}1&-1\\0&1\end{pmatrix}=\begin{pmatrix}1&3\\0&4\end{pmatrix}\\ T^3=C*D^3*C^{-1}=\begin{pmatrix}1&1\\0&1\end{pmatrix}*\begin{pmatrix}1&0\\0&2\end{pmatrix}^3*\begin{pmatrix}1&-1\\0&1\end{pmatrix}=\begin{pmatrix}1&8\\0&8\end{pmatrix}*\begin{pmatrix}1&-1\\0&1\end{pmatrix}=\begin{pmatrix}1&7\\0&8\end{pmatrix} \end{aligned} T2=CD2C1=(1011)(1002)2(1011)=(1044)(1011)=(1034)T3=CD3C1=(1011)(1002)3(1011)=(1088)(1011)=(1078)

This proves our formula A n = C ∗ D n ∗ C − 1 A^n=C*D^n*C^{-1} An=CDnC1 works as expected.

Therefore, if we need to apply a transformation matrix T T T on vector v v v repeatedly, we can write

T n ∗ v = C ∗ D n ∗ C − 1 ∗ v T^n*v=C*D^n*C^{-1}*v Tnv=CDnC1v

In a step-by-step manner, here is what we need to do to calculate T n v T^nv Tnv.

  1. Calculate the Eigen vectors and Eigen values of matrix T T T.
  2. Construct an Eigen matrix C C C from Eigen vectors which defines a new vector space.
  3. Construct a diagonal matrix D D D from Eigen values.
  4. Find the inverse of matrix C C C.
  5. Transform vector v v v from its original vector space into the new vector space, v C = C − 1 ∗ v v_C=C^{-1}*v vC=C1v.
  6. Multiply the transformed vector by the diagonal matrix D D D repeatedly in new vector space, [ T n v ] C = D n ∗ v C [T^nv]_C=D^n*v_C [Tnv]C=DnvC.
  7. Transform the resultant vector back to the original vector space, T n v = C ∗ [ T n v ] C T^nv=C*[T^nv]_C Tnv=C[Tnv]C.

Of course, there is little efficiency gained if we are just doing a transformation 2 or 3 times. The extra steps of computing Eigen vectors and matrix inverse are not simple either. This way of diagonalizing matrix before raising its power becomes much handier when we need to multiply a matrix by a large number of times. One good example is the famous PageRank algorithm used in ranking Google’s search result.

PageRank Application of Repeated Matrix Multiplication

In order to illustrate the idea of PageRank algorithm, we can make a mini “network” as follows. Each circle A, B, C and D represents a webpage. And the arrow between them shows the page link from one to the other. Our goal is to rank the relevance of these webpages for people who have received them as their search result.

Mini "Network"

The central idea underlying the PangeRank algorithm is that the importance of a webpage is related to its links to and from other webpages. We can represent each webpage as a vector in which each row is either 0 or 1 depending on whether there is a link to the corresponding page. For example, for webpage A, it’s linked to webpage B, C and D except for itself. This can be represented as a vector ( 0 1 1 1 ) \begin{pmatrix}0\\1\\1\\1\end{pmatrix} 0111. We then normalize this vector to ensure the sum of all rows equal to 1. We call it the link vector for webpage A and denote it as l A l_A lA.

l A = ( 0 1 3 1 3 1 3 ) l_A=\begin{pmatrix}0\\\frac{1}{3}\\\frac{1}{3}\\\frac{1}{3}\end{pmatrix} lA=0313131

Similarly, we can obtain the link vectors for webpage B, C and D.

l B = ( 1 2 0 0 1 2 ) , l C = ( 0 0 0 1 ) , l D = ( 0 1 2 1 2 0 ) \begin{aligned} l_B=\begin{pmatrix}\frac{1}{2}\\0\\0\\\frac{1}{2}\end{pmatrix}, l_C=\begin{pmatrix}0\\0\\0\\1\end{pmatrix}, l_D=\begin{pmatrix}0\\\frac{1}{2}\\\frac{1}{2}\\0\end{pmatrix} \end{aligned} lB=210021,lC=0001,lD=021210

A link matrix L L L is formed by the link vectors of all webpages.

L = ( ( l A ) ( l B ) ( l C ) ( l D ) ) = ( 0 1 2 0 0 1 3 0 0 1 2 1 3 0 0 1 2 1 3 1 2 1 0 ) L=\Bigg(\bigg(l_A\bigg)\bigg(l_B\bigg)\bigg(l_C\bigg)\bigg(l_D\bigg)\Bigg)=\begin{pmatrix}0&\frac{1}{2}&0&0\\\frac{1}{3}&0&0&\frac{1}{2}\\\frac{1}{3}&0&0&\frac{1}{2}\\\frac{1}{3}&\frac{1}{2}&1&0\end{pmatrix} L=((lA)(lB)(lC)(lD))=03131312100210001021210

This matrix L L L summarizes the probability of going from one page to another. For example, the probability of going to webpage A is 1 2 \frac{1}{2} 21 if we are at webpage B and is 0 elsewhere. And the probability of going to webpage B is 1 3 \frac{1}{3} 31 when we are at page A and 1 2 \frac{1}{2} 21 when we are at page D.

We define the rank of a webpage as the long-run probability of ending in that page after some random clicks from page links. This is a self-referential problem as the rank of all the pages are depending on all the other pages. To calculate the rank of webpage A, we need to know the rank of all the other pages, whether these pages link to webpage A and how many outgoing links are in total in these pages. We can define a vector r A r_A rA to represent the rank of webpage A as,

r A = ∑ j = 1 n L A j r j r_A=\sum_{j=1}^{n}L_{Aj}r_j rA=j=1nLAjrj

where n n n is the total number of webpages, L A j L_{Aj} LAj is the probability of going to webpage A from any webpage j j j and r j r_j rj is the rank of webpage j j j.

Moreover, the rank vector r r r for all web pages can be expressed as

r = L r r=Lr r=Lr

The rank vector r r r is updated by matrix L L L every time we perform this multiplication. Therefore, at timestamp t t t, the page rank at next timestamp t + 1 t+1 t+1 would be.

r t + 1 = L r t r^{t+1}=Lr^t rt+1=Lrt

This is an iterative process. We can do the multiplication repeatedly. If after many rounds of multiplication r r r stops changing, it means we get a constant relationship r = L r r=Lr r=Lr. Thinking back our Eigen vector definition. When r = L r r=Lr r=Lr holds true for all further multiplication updates, r r r would be equal to the Eigen vector of matrix L L L with an Eigen value of 1. This is in fact another way for us to find the Eigen vectors of a matrix.

There is one more thing to consider before we kick off this iterative process. We need to assign an initial value for r r r at time 0. In this example, we simply assume that all webpages are ranked equally at the beginning. Since there are 4 pages in total,

r 0 = ( 1 4 1 4 1 4 1 4 ) r^0=\begin{pmatrix}\frac{1}{4}\\\frac{1}{4}\\\frac{1}{4}\\\frac{1}{4}\end{pmatrix} r0=41414141

We can ask our computer to do the work of updating values of r r r iteratively. Soon we can see that, with our mini network, vector r r r converges to

r = ( 0.12 0.24 0.24 0.4 ) r=\begin{pmatrix}0.12\\0.24\\0.24\\0.4\end{pmatrix} r=0.120.240.240.4

The result shows, by randomly clicking around in these 4 webpages there is 12% probability that a user will end up in webpage A. And that probability for page B, C and D is 24%, 24% and 40% respectively. Therefore, our rank of these 4 webpages will be D>B=C>A.

It also means the Eigen vector for matrix L L L is ( 0.12 0.24 0.24 0.4 ) \begin{pmatrix}0.12\\0.24\\0.24\\0.4\end{pmatrix} 0.120.240.240.4. Let’s verify this result.

L r = ( 0 1 2 0 0 1 3 0 0 1 2 1 3 0 0 1 2 1 3 1 2 1 0 ) ∗ ( 0.12 0.24 0.24 0.4 ) = ( 1 2 ∗ 0.24 1 3 ∗ 0.12 + 1 2 ∗ 0.4 1 3 ∗ 0.12 + 1 2 ∗ 0.4 1 3 ∗ 0.12 + 1 2 ∗ 0.24 + 1 ∗ 0.24 ) = ( 0.12 0.24 0.24 0.4 ) = r \begin{aligned} Lr&=\begin{pmatrix}0&\frac{1}{2}&0&0\\\frac{1}{3}&0&0&\frac{1}{2}\\\frac{1}{3}&0&0&\frac{1}{2}\\\frac{1}{3}&\frac{1}{2}&1&0\end{pmatrix}*\begin{pmatrix}0.12\\0.24\\0.24\\0.4\end{pmatrix}\\ &=\begin{pmatrix}\frac{1}{2}*0.24\\\frac{1}{3}*0.12+\frac{1}{2}*0.4\\\frac{1}{3}*0.12+\frac{1}{2}*0.4\\\frac{1}{3}*0.12+\frac{1}{2}*0.24+1*0.24\end{pmatrix}\\ &=\begin{pmatrix}0.12\\0.24\\0.24\\0.4\end{pmatrix}\\ &=r \end{aligned} Lr=031313121002100010212100.120.240.240.4=210.24310.12+210.4310.12+210.4310.12+210.24+10.24=0.120.240.240.4=r

This, however, only presents the simplest idea of the PageRank algorithm. We did not cover damping factors or any other stability or optimization measures. Nonetheless, hopefully this can demonstrate some usefulness of Eigen vectors.

There are also other topics we did not cover in Eigen theory. For example, how do we perform repeated multiplication when a matrix is not diagonalizable? Our solution for Eigen vectors consist of only real numbers so far. It is in fact possible to have Eigen vectors with complex numbers. These, however, are not the topics we shall focus on here in linear algebra. Grasping the core concept of Eigen vectors and Eigen values would set you up in good shape for what we will discuss in future for other machine learning topics.

That is all. We can conclude our journey on vector and matrix. Hopefully this gives you a solid understanding of linear algebra and build up some intuition about concepts like change basis, matrix transformation, Eigen vectors, etc. These core concepts of linear algebra will also come in handy as you progress along your study of machine learning.


(Inspired by Mathematics for Machine Learning lecture series from Imperial College London)

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值