Docsity

Orthogonal Projection - Matrix Computation - Lecture Slides, Slides of Advanced Computer Architecture

Partial preview of the text

Download Orthogonal Projection - Matrix Computation - Lecture Slides and more Slides Advanced Computer Architecture in PDF only on Docsity!

  • Lecture

Overview

Orthogonal projection, distance between subspaces Principal component analysis

Orthogonal projection and SVD

If the columns of V = [v 1 ,... , vk ] are an orthonormal basis for a subspace S, then it is easy to show that P = VV >^ is the unique orthogonal projection onto S If v ∈ IRn, then P = vv

v>v is the orthogonal projection onto S = span({v}) Let A = UΣV >^ ∈ IRm×n^ and rank(A) = r , we have the U and V partitionings

U = [ Ur U˜ ] V = [ Vr V˜ ] r m − r r n − r , then Vr V (^) r> = projection onto null(A)⊥^ = ran(A>) V^ ˜r V˜ (^) r> = projection onto null(A) Ur U r> = projection onto ran(A) U^ ˜r U˜ r> = projection onto ran(A)⊥^ = null(A>)

Distances between subspaces

Let S 1 and S 2 be subspaces of IRn^ and dim(S 1 ) = dim(S 2 ), we define the distance between two spaces by

dist(S 1 , S 2 ) = ‖P 1 − P 2 ‖ 2

where Pi is the orthogonal projection onto Si The distance between a pair of subspaces can be characterized in terms of the blocks of a certain orthogonal matrix

Theorem

Suppose W = [ W 1 W 2 ] Z = [ Z 1 Z 2 ] k n − k k n − k are n-by-n orthogonal matrices. If S 1 = ran(W 1 ), and S 2 = ran(Z 1 ), then dist(S 1 , S 2 ) = ‖W 1 > Z 2 ‖ 2 = ‖Z 1 > W 2 ‖ 2

See Golub and Van Loan for proof

Symmetric matrices

Consider real, symmetric matrices, A>^ = A, I (^) Hessian matrix (second order partial derivatives of a function): y = f (x + ∆x) ≈ f (x) + J(x)∆x +^1 2 ∆x>H(x)∆x where J is the Jacobian matrix, i.e. the gradient I (^) covariance matrix for Gaussian distribution The inverse is also symmetric: (A−^1 )>^ = A−^1 Eigenvector equation for a symmetric matrix Auk = λk uk , which can be written as AU = DU, or (A − D)U = 0 where D is a diagonal matrix whose elements are eigenvalues

D =

λ 1

... λm

and U is matrix whose columns are eigenvectors uk

Eigenvectors for symmetric matrices

The eigenvectors can be computed from determinant | A − D |= 0 Can show that the eigenvectors can be chosen to form an orthonormal basis For a pair of eigenvectors uj and uk , it follows

u> j Auk = λk u> j uk u> k Auj = λj u> k uj

, and thus (λk − λj )u> k uj = 0 For λk 6 = λj , the eigenvectors must be orthogonal Note for any uk with eigenvalue λk , βuk is also an eigenvector for non-zero β with the same eigenvalue Can be used to normalize the eigenvectors to unit norm so that

u> k uj = δkj

Principal component analysis

Arguably the most popular dimensionality reduction algorithm Curse of dimensionality Widely used in computer vision, machine learning and pattern recognition Can be derived from several perspectives: I (^) Minimize reconstruction error: Karhunen-Loeve transform I (^) Decorrelation: Hottelling transform I (^) Maximize the variance of the projected samples (i.e., preserve as much energy as possible) Unsupervised learning Linear transform Second order statistics Recall from SVD we have A = UΣV >, and thus project samples on the subspace spanned by U can be computed by

U>A = ΣV >

Principal component analysis (PCA)

Given a set of n data points x ∈ IRm, we’d like to project each x(k) onto a onto a d-dimensional subspace z(k)^ = [z 1 ,... , zd ] ∈ IRd^ , d < m, so that x =

∑^ m

i=

zi ui

where the vectors ui satisfy the orthonormality relation u> i uj = δij in which δij is the Kronecker delta. Thus, zi = u> i x Now we have only a subset d < m of the basis vector ui. The remaining coefficients will be replaced by constants bi so that each vector x is approximated by x can be approximated by

˜x =

∑^ d

i=

zi ui +

∑^ m

i=d+

bi ui

Principal component analysis (cont’d)

Take derivative of Ed with respect to bi and set it to zero,

bi =

n

∑^ n

k=

z i( k)=

n

∑^ n

k=

u> i x(k)^ = u> i ¯x where, x =

n

∑^ n

k=

x(k)

Plug it into the sum of square errors, Ed , Ed = (^12)

∑m i=d+

∑n k=1(u

i (x (k) (^) − x)) 2 = n 2

∑m i=d+1 u

i Cui where C is a covariance matrix

C =

n

∑^ n

k=

(x(k)^ − x)(x(k)^ − x)>

Minimizing Ed with respect to ui , we get Cui = λi ui i.e., the basis vectors ui are the eigenvectors of the covariance matrix C

Derivation

Minimizing Ed with respect to ui ,

Ed = (^12)

∑m i=d+

∑n k=1(u

i (x (k) (^) − x)) 2 = n 2

∑m i=d+1 u

i Cui Need some constraints to solve this optimization problem Impose orthonormal constraints among ui Use Lagrange multipliers φij

E^ ˆd =^1 2

∑^ m

i=d+

ui Cu> i −

∑^ m

i=d+

∑^ m

j=d+

φij (u> i uj − δij )

Recall min f (x) s.t. g (x) = 0 ⇒^ L(x, φ) =^ f^ (x) +^ φg^ (x) Example: min f (x 1 , x 2 ) = x 1 x 2 subject to g (x 1 , x 2 ) = x 1 + x 2 − 1 = 0

Derivation (cont’d)

The eigenvector equation for M MΨ = ΨΛ where Λ is a diagonal matrix of eigenvalues and Ψ is the matrix of eigenvectors M is symmetric and Ψ can be chosen to have orthonormal columns, i.e., Ψ>Ψ = I (^) Λ = Ψ>MΨ

Put together, Λ = Ψ>U>CUΨ = (UΨ)>C(UΨ) = U˜>C U˜ where U˜ = UΨ, and (^) U = U˜Ψ>

Another solution for U>CU = M can be obtained from the particular solution U˜ by application of an orthogonal transformation given by Ψ

Derivation (cont’d)

We note that Ed is invariant under this orthogonal transformation

Ed = 12 tr{U>CU} = 12 tr{Ψ U˜>C U˜Ψ>} = 12 tr{ U˜>C U˜}

Recall the matrix 2-norm is invariant under orthogonal transformation Since all of the possible solutions give the same minimum error Ed , we can choose whichever is most convenient We thus choose the solutions given by U˜ (with unit norm) since this has columns which are the eigenvectors of C

Computing principal components from data

Project x(k)^ onto these eigenvectors give the components of the transformed vector z(k)^ in the d-dimensional space

Each two-dimensional data point is transformed to a single variable z 1 representing the projection of the data point onto the eigenvector u 1 Infer the structure (or reduce redundancy) inherent in high dimensional data Parsimonious representation Linear dimensionality algorithm based on sum-of-square-error criterion Other criteria: covariance measure and population entropy

Intrinsic dimensionality

A data set in m dimensions has intrinsic dimensionality equal to m′^ if the data lies entirely within a m′-dimensional space What is the intrinsic dimensionality of data? The intrinsic dimensionality may increase due to noise PCA, as a linear approximation, has its limitation How to determine the number of eigenvectors? Empirically determined based on reconstruction error (i.e., energy)