Computational Methods CMSC/AMSC/MAPL 460. EigenValue decomposition Singular Value Decomposition. Ramani Duraiswami, Dept. of Computer Science

Similar documents
Computational Methods CMSC/AMSC/MAPL 460. Eigenvalues and Eigenvectors. Ramani Duraiswami, Dept. of Computer Science

The Singular Value Decomposition

Computational Methods. Eigenvalues and Singular Values

1 Linearity and Linear Systems

Singular Value Decomposition

Maths for Signals and Systems Linear Algebra in Engineering

Numerical Methods I Singular Value Decomposition

Notes on Eigenvalues, Singular Values and QR

Lecture: Face Recognition and Feature Reduction

Lecture: Face Recognition and Feature Reduction

Linear Least Squares. Using SVD Decomposition.

Least Squares. Tom Lyche. October 26, Centre of Mathematics for Applications, Department of Informatics, University of Oslo

COMP 558 lecture 18 Nov. 15, 2010

The Singular Value Decomposition and Least Squares Problems

Linear Algebra Review. Vectors

The Singular Value Decomposition (SVD) and Principal Component Analysis (PCA)

be a Householder matrix. Then prove the followings H = I 2 uut Hu = (I 2 uu u T u )u = u 2 uut u

Linear Algebra, part 3 QR and SVD

Linear Algebra, part 3. Going back to least squares. Mathematical Models, Analysis and Simulation = 0. a T 1 e. a T n e. Anna-Karin Tornberg

Notes on singular value decomposition for Math 54. Recall that if A is a symmetric n n matrix, then A has real eigenvalues A = P DP 1 A = P DP T.

Linear Algebra and Matrices

AMS526: Numerical Analysis I (Numerical Linear Algebra)

Computation of eigenvalues and singular values Recall that your solutions to these questions will not be collected or evaluated.

Singular Value Decomposition

UNIT 6: The singular value decomposition.

Singular Value Decomposition (SVD)

(a) If A is a 3 by 4 matrix, what does this tell us about its nullspace? Solution: dim N(A) 1, since rank(a) 3. Ax =

Data Mining Lecture 4: Covariance, EVD, PCA & SVD

Applied Mathematics 205. Unit II: Numerical Linear Algebra. Lecturer: Dr. David Knezevic

Computational math: Assignment 1

Vector and Matrix Norms. Vector and Matrix Norms

Dimensionality Reduction: PCA. Nicholas Ruozzi University of Texas at Dallas

Math 102, Winter Final Exam Review. Chapter 1. Matrices and Gaussian Elimination

linearly indepedent eigenvectors as the multiplicity of the root, but in general there may be no more than one. For further discussion, assume matrice

Homework 1 Elena Davidson (B) (C) (D) (E) (F) (G) (H) (I)

Pseudoinverse & Orthogonal Projection Operators

Singular Value Decomposition

ACM106a - Homework 4 Solutions

Principal Component Analysis

EIGENVALUE PROBLEMS. EIGENVALUE PROBLEMS p. 1/4

Eigenvalues and diagonalization

Properties of Matrices and Operations on Matrices

AMS526: Numerical Analysis I (Numerical Linear Algebra)

Applied Linear Algebra in Geoscience Using MATLAB

Lecture 2: Numerical linear algebra

Orthonormal Transformations and Least Squares

The Singular Value Decomposition

Linear Algebra Methods for Data Mining

STA141C: Big Data & High Performance Statistical Computing

Singular Value Decomposition. 1 Singular Value Decomposition and the Four Fundamental Subspaces

Summary of Week 9 B = then A A =

18.06 Problem Set 10 - Solutions Due Thursday, 29 November 2007 at 4 pm in

18.06SC Final Exam Solutions

2. LINEAR ALGEBRA. 1. Definitions. 2. Linear least squares problem. 3. QR factorization. 4. Singular value decomposition (SVD) 5.

B553 Lecture 5: Matrix Algebra Review

The QR Decomposition

Singular Value Decomposition

Numerical Linear Algebra Homework Assignment - Week 2

THE SINGULAR VALUE DECOMPOSITION MARKUS GRASMAIR

Preliminary Examination, Numerical Analysis, August 2016

Linear Algebra Review. Fei-Fei Li

Large Scale Data Analysis Using Deep Learning

CS 143 Linear Algebra Review

1 Singular Value Decomposition and Principal Component

Computing Eigenvalues and/or Eigenvectors;Part 2, The Power method and QR-algorithm

Basic Calculus Review

Problem # Max points possible Actual score Total 120

STA141C: Big Data & High Performance Statistical Computing

Computing Eigenvalues and/or Eigenvectors;Part 2, The Power method and QR-algorithm

The QR Factorization

Data Analysis and Manifold Learning Lecture 2: Properties of Symmetric Matrices and Examples

Math 6610 : Analysis of Numerical Methods I. Chee Han Tan

COMP6237 Data Mining Covariance, EVD, PCA & SVD. Jonathon Hare

STAT 309: MATHEMATICAL COMPUTATIONS I FALL 2017 LECTURE 5

Lecture notes: Applied linear algebra Part 1. Version 2

QR-decomposition. The QR-decomposition of an n k matrix A, k n, is an n n unitary matrix Q and an n k upper triangular matrix R for which A = QR

Homework 1. Yuan Yao. September 18, 2011

Foundations of Computer Vision

2. Review of Linear Algebra

Pseudoinverse & Moore-Penrose Conditions

MATH36001 Generalized Inverses and the SVD 2015

Background Mathematics (2/2) 1. David Barber

5 Selected Topics in Numerical Linear Algebra

σ 11 σ 22 σ pp 0 with p = min(n, m) The σ ii s are the singular values. Notation change σ ii A 1 σ 2

Eigenvalue Problems and Singular Value Decomposition

Lecture 12 Eigenvalue Problem. Review of Eigenvalues Some properties Power method Shift method Inverse power method Deflation QR Method

15 Singular Value Decomposition

Singular Value Decomposition

Maths for Signals and Systems Linear Algebra in Engineering

Functional Analysis Review

AMS526: Numerical Analysis I (Numerical Linear Algebra for Computational and Data Sciences)

Math 405: Numerical Methods for Differential Equations 2016 W1 Topics 10: Matrix Eigenvalues and the Symmetric QR Algorithm

In this section again we shall assume that the matrix A is m m, real and symmetric.

Lecture 6, Sci. Comp. for DPhil Students

14 Singular Value Decomposition

Fall TMA4145 Linear Methods. Exercise set Given the matrix 1 2

MATH 423 Linear Algebra II Lecture 33: Diagonalization of normal operators.

Main matrix factorizations

Numerical Methods I Eigenvalue Problems

Last Time. Social Network Graphs Betweenness. Graph Laplacian. Girvan-Newman Algorithm. Spectral Bisection

Transcription:

Computational Methods CMSC/AMSC/MAPL 460 EigenValue decomposition Singular Value Decomposition Ramani Duraiswami, Dept. of Computer Science

Hermitian Matrices A square matrix for which A = A H is said to be an Hermitian matrix. If A is real and Hermitian it is said to be symmetric, and A = A T. Every Hermitian matrix is positive definite. Every eigenvalue of an Hermitian matrix is real. Different eigenvectors of an Hermitian matrix are orthogonal to each other, i.e., their scalar product is zero.

The Power Method Label the eigenvalues in order of decreasing absolute value so λ 1 > λ 2 > λ n. Consider the iteration formula: y k+1 = Ay k where we start with some initial y 0, so that: y k = A k y 0 Then y k converges to the eigenvector x 1 corresponding the eigenvalue λ 1.

Proof We know that A k = X Λ k X -1, so: y k = A k y 0 = X Λ k X -1 y 0 Now we have: = = Λ k k n k k k k n k k k 1 1 2 1 2 1 1 λ λ λ λ λ λ λ λ O O The terms on the diagonal get smaller in absolute value as k increases, since λ 1 is the dominant eigenvalue.

Proof (continued) So we have 1 1 1 2 1 1 1 0 0 1 c x c c c x x y k n n k k λ λ = = M O M M L M M Since λ 1 k c 1 x 1 is just a constant times x 1 then we have the required result.

Rayleigh Quotient Note that once we have the eigenvector, the corresponding eigenvalue can be obtained from the Rayleigh quotient: dot(ax,x)/dot(x,x) where dot(a,b) is the scalar product of vectors a and b defined by: dot(a,b) = a 1 b 1 +a 2 b 2 + +a n b n So for our example, λ 1 = -2.

Scaling The λ 1k can cause problems as it may become very large as the iteration progresses. To avoid this problem we scale the iteration formula: y k+1 = A(y k /r k+1 ) where r k+1 is the component of Ay k with largest absolute value.

Example with Scaling Let A = [2-12; 1-5] and y 0 =[1 1] Ay 0 = [-10-4] so r 1 =-10 and y 1 =[1.00 0.40]. Ay 1 = [-2.8-1.0] so r 2 =-2.8 and y 2 =[1.0 0.3571]. Ay 2 = [-2.2857-0.7857] so r 3 =-2.2857 and y 3 =[1.0 0.3437]. Ay 3 = [-2.1250-0.7187] so r 4 =-2.1250 and y 4 =[1.0 0.3382]. Ay 4 = [-2.0588-0.6912] so r 5 =-2.0588 and y 5 =[1.0 0.3357]. Ay 5 = [-2.0286-0.6786] so r 6 =-2.0286 and y 6 =[1.0 0.3345]. r is converging to the correct eigenvector -2.

Scaling Factor At step k+1, the scaling factor r k+1 is the component with largest absolute value is Ay k. When k is sufficiently large Ay k ' λ 1 y k. The component with largest absolute value in λ 1 y k is λ 1 (since y k was scaled in the previous step to have largest component 1). Hence, r k+1 λ 1 as k.

MATLAB Code function [lambda,y]=powermethod(a,y,n) for (i=1:n) y = A*y; [c j] = max(abs(y)); lambda = y(j); y = y/lambda; end

Convergence The Power Method relies on us being able to ignore terms of the form (λ j / λ 1 ) k when k is large enough. Thus, the convergence of the Power Method depends on λ 2 / λ 1. If λ 2 / λ 1 =1 the method will not converge. If λ 2 / λ 1 is close to 1 the method will converge slowly.

The QR Algorithm The QR algorithm for finding eigenvalues is based on the QR factorisation that represents a matrix A as: A = QR where Q is a matrix whose columns are orthonormal, and R is an upper triangular matrix. Note that Q H Q = I and Q -1 =Q H. Q is termed a unitary matrix.

QR Algorithm without Shifts A 0 = A for k=1,2, Since: Q k R k = A k A k+1 = R k Q k end A k+1 = R k Q k = Q k -1 A k Q k then A k and A k+1 are similar and so have the same eigenvalues. A k+1 tends to an upper triangular matrix with the same eigenvalues as A. These eigenvalues lie along the main diagonal of A k+1.

A 0 = A for k=1,2, s = A k (n,n) Q k R k = A k -si A k+1 = R k Q k + si end QR Algorithm with Shift Since: A k+1 = R k Q k + si = Q k -1( A k si)q k +si = Q k -1 A k Q k so once again A k and A k+1 are similar and so have the same eigenvalues. The shift operation subtracts s from each eigenvalue of A, and speeds up convergence.

MATLAB Code for QR Algorithm Let A be an n n matrix n = size(a,1); I = eye(n,n); s = A(n,n); [Q,R] = qr(a-s*i); A = R*Q+s*I Use the up arrow key in MATLAB to iterate or put a loop round the last line.

Deflation The eigenvalue at A(n,n) will converge first. Then we set s=a(n-1,n-1) and continue the iteration until the eigenvalue at A(n-1,n-1) converges. Then set s=a(n-2,n-2) and continue the iteration until the eigenvalue at A(n-2,n-2) converges, and so on. This process is called deflation.

The SVD Definition: Every matrix A of dimensions m n (m n) can be decomposed as A = U Σ V * where U has dimension m m and U*U = I, Σ has dimension m n, the only nonzeros are on the main diagonal, and they are nonnegative real numbers σ 1 σ 2 σ n, V has dimension n n and V * V = I.

Relation with the Eigenvalue Decomposition Let A = U Σ V *. Then A * A = (UΣV * ) * UΣV * = VΣ * U * UΣV * =VΣ 2 V * This tells us that the singular value decomposition of A is related to the Eigenvalue decomposition of A * A Recall eigen value decomposition A= (X Λ X * ) So V which contains the right singular vectors of A has the right eigenvectors of A * A Σ 2 are the eigenvalues of A * A The singular values σ i of A are the square roots of the eigenvalues of A * A.

Relation with the Eigenvalue Decomposition (2) Let A = U Σ V. Then A A * = (UΣV * ) (UΣV * ) * = UΣV * VΣ * U * =UΣ 2 U * This tells us that the singular value decomposition of A is related to the Eigenvalue decomposition of AA * Recall eigen value decomposition A= (X Λ X * ) So U contains the the left singular vectors of A, which are also the left eigenvectors of A * A Σ 2 are the eigenvalues of AA * and the singular values σ i of A are the square roots of the eigenvalues of AA *

Computing the SVD The algorithm is a variant on algorithms for computing eigendecompositions. rather complicated, so better to use a high-quality existing code rather than writing your own. In Matlab: [U,S,V] = svd(a) The cost is O(mn 2 ) when m n. The constant is of order 10.

Uses of the SVD Recall to solve least squares problems we could look at the normal equations (A * Ax=A * b) So, SVD is closely related to solution of least-squares Used for solving ill conditioned least-squares Used for creating low-rank approximations Both applications are related

SVD and reduced rank approximation We can truncate r at any value and achieve reducedrank approximation to the matrix For ordered signular values, this gives the best reduced rank approximation

SVD and pseudo inverse

Well posed problems Hadamard postulated that for a problem to be well posed 1. Solution must exist 2. It must be unique 3. Small changes to input data should cause small changes to solution Many problems in science and computer vision result in illposed problems. Numerically it is common to have condition 3 violated. Recall from the SVD If the σ are close to zero small changes in the data vector b cause big changes in x. Converting ill-posed problem to well-posed one is called regularization.

SVD and Regularization Pseudoinverse provides one means of regularization Another is to solve (A+εI)x=b Solution of the regular problem requires minimizing of Ax-b 2 Solving this modified problemcorresponds to minimizing Ax-b 2 + ε x 2 Philosophy pay a penalty of O(ε) to ensure solution does not blow up. In practice we may know that the data has an uncertainty of a certain magnitude so it makes sense to optimize with this constraint. Ill-posed problems are also called ill-conditioned