MINDTOPO-Can-Foundation-Models-Reason-in-Topological-Space Lecture 2: Linear Algebra 1. MATRICES, EIGENVALUES AND EIGENVECTORS A matrix can be defned as a collection of numbers arranged in a certain way. A matrix can also be viewed as an operator (a linear transformation) from Rn to Rn; but what does a linear transformation defned by a data set mean? For example, consider a 10 × 10 matrix whose rows are indexed by companies and columns are indexed by dates. The (i, j)-entry of the matrix is the price of the stock of the i-th company on date j. This is a matrix defned by some real-life data. Can we give a meaning to the transformation defned by this matrix? \e begin by reviewing eigenvalues and eigenvectors of a matrix. \e use the notation < v, w > for inner product of vectors. It can also be written in matrix multiplication form as < v, w >= vT ˇ w (a vector is to be understood as a column matrix). Defnition 1. Let A be an n×n matrix of real entries. If a non-zero vector v ? Rn and a complex number ? satisfes Av = ?v, then v is called an eigenvector of A and ? is an eigenvalue of A. Does a matrix always have eigenvalues and eigenvectors? To answer this question, note that a real number ? is an eigenvalue of A if and only if (A - ?I)v = 0, for some vector v. Hence it follows that det(A-?I) = 0. Note that if one considers ? as a variable, then det(A - ?I) becomes a polynomial of degree n. Therefore we can conclude that there are at least 1 and at most n distinct (complex) eigenvalues of an n × n matrix. Note that the matrix A applied to its eigenvector acts as if it is a scalar multiplication. Thus eigenvectors are 'the important' directions of a matrix, when considered as an operator. Defnition 2. A matrix A is diagonalizable if there exists an invertible matrix P and a diagonal matrix D such that A = P -1DP. Recall that the conjugation operation by an invertible matrix A is equivalent to a change of basis of the underlying space. Hence a matrix is diagonalizable if there exists a basis for which A becomes a diagonal matrix. Hence a matrix A is a diagonalizable matrix if there exists a basis on which A acts as a scaling operator. 2 LECTURE 2 2. EIGENVALUES AND EIGENVECTORS OF SYMMETRIC MATRICS A matrix A is symmetric if A = AT . The eigenvalues and eigenvectors of symmetric matrices will be of particular interest to us, since we will encouter many such matrices throughout the course. The following proposition establishes some properties of eigenvalues and eigenvectors of symmetric matrices. Proposition 3. Let A be a real symmetric matrix. Then the following holds. (i) All eigenvalues are real. (ii) A is orthonormally diagonalizable (i.e., there exists an orthonormal matrix U such that A = U -1DU). Proof. (i) Let ? be an eigenvalue and v be an eigenvector such that Av = ?v. Consider T 2 vT Av = v ˇ (?v) = ? ||v|| . Since A = AT , we also have T T 2 v A T Av = v v = (?vT ) ˇ v = ? ||v|| . Therefore, ? = ?, and thus ? is real. (ii) Let ?1 be an eigenvalue of A and v1 be a corresponding eigenvector (recall that all n × n matrices have at least one eigenvalue). Let W1 = {w : < w, v1 >= 0} be the set of vectors orthogonal to v1. Note that W1 forms a subspace of Rn. For a vector w ? W1, we have < Aw, v1 >=< w, Av1 >= ? < w, v1 >= 0, and therefore W1 is a vector space of dimension n - 1 that is closed under the transformation A. Let B' be an orthonormal basis of the vector space W1, and note that B = {v1} ? B' forms an orthonormal basis of Rn. Let U be the vector whose columns are the vectors in the basis {v1} ? B, where v1 is the frst column. Then the observation above shows that ?1 0 UAU -1 = , 0 A1 where A1 is a symmetric (n - 1) × (n - 1) matrix. By repeating the process, we obtain a orthonormal diagonalization of A. D The largest eigenvalue of a symmetric matrix also has the following property. Theorem 4. If A is symmetric, then max||v||=1 |Av| = max? |?|, where the second maximum is taken over all eigenvalues of the matrix. 3. SINGULAR VALUE DECOMPOSITION For a diagonalizable matrix A, we refer to D = UAU -1 as the eigenvalue decomposition of A. \e saw that symmetric matrices are diagonalizable. Can we do something similar for general n × n matrices? \hat about m × n matrices? Singular value decomposition is a generalization of the eigenvalue decomposition that acheives this goal. It is a tool which allows one to understand a matrix through a diagonal matrix.   3 LECTURE 2 Theorem 5. Every m × n matrix Amn can be expressed as T Amn = UmmSmnVnn for a m × m orthonormal matrix Umm , a a diagonal m × n matrix Smn, and a n × n orthonormal matrix Vnn. Before proving the theroem, let us frst compare it to the diagonalization (eigenvalue decomposition) A = UDUT of a matrix. Both decompositions provide a method of understanding a matrix through a diagonal matrix. Eigenvalue decomposition of a matrix is much more powerful and it gives a basis to which the matrix acts like scalar multiplication. On the other hand, singular value decomposition gives a basis of Rn and a basis of Rm, where the action of the matrix on the frst basis can be understood through a scalar multiplication of the second basis. Proof. Suppose that A has rank r = min{m, n}. Note that AT ˇ A also has rank r. Let s1 2, ˇ ˇ ˇ , sr 2 be the non-zero eigenvalues of AT ˇ A, and let vi be orthonormal eigenvectors (where vi is the eigenvector corresponding to si for 1 = i = r). Complete the collection v1, v2, ˇ ˇ ˇ , vr into an orthonormal basis by adding vectors vr+1, ˇ ˇ ˇ , vn. For 1 = i = r, let ui = Avi . Note that for distinct i, j we have, si uT i ˇ uj = 1 vT j AT Avi = 1 vT j ˇ (sivi) = 0, sisj sisj since vj and vi are orthogonal. Therefore, u1, ˇ ˇ ˇ , ur is an orthogonal set of vectors. Complete this collection as a set of orthonormal basis by adding vectors ur+1, ˇ ˇ ˇ , um and let si = 0 for all r + 1 = i = m. Let U = [u1 u2 ˇ ˇ ˇ um] and V = [v1 v2 ˇ ˇ ˇ vn] and note that UT AV = UT ˇ [s1u1 s2u2 ˇ ˇ ˇ smum] = [s1e1 s2e2 ˇ ˇ ˇ smem] = S, is a diagonal matrix. Hence A = USV T , and we found our matrices U and V as claimed. D Defnition 6. The (positive) square roots of the eigenvalues of AT A is called the singular values of A. It is customary to denote the singular values in decreasing order of magnitude s1 = s2 = ˇ ˇ ˇ = sm. Note that these are the diagonal entries of the matrix Smn, in the decomposition given above. Exercise 7. Prove that the singular values can also be obtained by considering the matrix AAT . Recall the example given in the introduction where we consider a matrix whose rows are indexed by stocks and columns by dates. Is it more sensible to consider a eigenvalue decomposition or a singular value decomposition? \e mostly will use matrices with m = n. In this case, we can further simplify the decomposition as follows. Corollary 8. (Reduced SVD) Let m = n. Then every m × n matrix Amn can be expressed as V T Amn = UmmSmm nm 4 LECTURE 2 for a m × m orthogonal matrix Umm , a diagonal m × m matrix Smm, and a n× m matrix Vnm whose columns are orthogonal. Proof. If m = n, then in the diagonal matrix Smn, for j > m, the j-th column of Smn is a all-zero vector. Hence even if we remove the (m + 1)-th column to the n-th column of Smn, and remove the (m+1)-th column to the n-th column of Vnn, the outcome of V T Smn nm does not change. Hence we obtain a decomposition as claimed. D Exercise 9. Are the matrices U and V uniquely determined? Example 10. Consider the matrix A = 3 2 2 3 2 -2 . \e see that ? ? ? ? T AA = 3 2 2 3 2 -2 3 ˇ ? 2 2 2 3 -2 13 ? = ? 12 2 12 13 -2 2 -2 ? . 8 The eigenvalues of this matrix are 0, 9, 25, and the singular values are 5, 3. \e can also use AT A, which is a 2 × 2 matrix, to obtain the singular values. To obtain the singular value decoposition, we need to fnd the eigenvectors of AAT . To fnd the eigenvector corresponding to the eigenvalue 25, note that ? ? -12 12 2 AAT - 25I = ? 12 -12 -2 ? . 2 -2 -13 The matrix above can be row-reduced to give the matrix ? ? 1 -1 0 ? 0 0 0 ? , 0 0 1 and therefore (1, 1, 0) is an eigenvector corresponding to 25. By normalizing this vector, we can take v1 = ( v 1 , v 1 , 0) as the eigenvector. Similarly, we can also 2 2 v 1 v 1 v 4 fnd a unit eigenvector v2 = ( , - , ) of 9. (There is no need to fnd the 18 18 18 eigenvector corresponding to 0 when fnding the simplifed form of SVD). In the proof of the singular value decomposition, the matrix U consisted of the Avi vectors ui = . Therefore, si v v 1/ 2 1/ 2 u1 = v u2 = v . 1/ 2 -1/ 2 Hence, U = [u1 u2] and V = [v1 v2] , and v v v v 1/ 2 1/ 2 5 0 1/ 2 1/ 2 0 A = USV T = v v ˇ ˇ v v v . 1/ 2 -1/ 2 0 3 1/ 18 -1/ 18 4/ 18     ? ? ? ? ? ? ? ?           5 LECTURE 2 4. THE PERRON-FROBENIUS THEOREM Theorem 11. (Perron­Frobenius) If A is an n × n matrix whose entries are all positive (greater than zero), then 1. There is a positive real eigenvalue ?0 such that all other eigenvalues satisfy |?| < ?0, 2. there is a positive eigenvector corresponding to ?0, and 3. ?0 is an eigenvalue of multiplicity 1. Proof. \e only give the sketch of the proof for symmetric matrices. Note that symmetric matrices have real eigenvalues. Let ?+ be the largest eigenvalue and ?- be the smallest eigenvalue. If ?+ > |?-|, then Property 1 follows. Suppose not (thus |?-| = ?+). Then by Theorem 2 above, it follows that the eigenvector v of ?- maximizes the quantity ||Av|| ||v|| over all non-zero vectors. The vector v has real entries. \ithout loss of generality assume that v ˇ (1, 1, ˇ ˇ ˇ , 1) = 0. Since A has positive entries, whenever we switch the sign of a negative entry of v, we obtain a vector of the same norm as v having larger value of ||Av||. This contradicts the fact that |?-| = ?+. Therefore, we must have ?+ > |?-|. A similar argument shows that all entries of an eigenvector w corresponding to ?+ needs to be non-negative. Moreover, since A has positive entries, the only way w can have a zero entry is if w is the all-zero vector. Hence we have Property 2. Finally, to see Property 3, suppose that there are two linearly independent unit eigenvectors w1 and w2 both corresponding to ?+. Since w1 = w2 and w1, w2 are both unit vectors, we see that w1-w2 must have both positive and negative entries. Moreover, w1 - w2 is also an eigenvector corresponding to ?+. This is impossible by the argument above saying that all entries of an eigenvector corresponding to ?+ must have the same sign. D Perron-Frobenius theorem holds for a more general class of matrices (see, e.g., \ikipedia). MIT OpenCourseWare http://ocw.mit.edu 18.S096 Topics in Mathematics with Applications in Finance Fall 2013 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.