Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Math 123

Problem  Set 3

Due:  Friday 3/12 at  11:59 p.m.  EST

Instruction: Read the homework policy.  For problems 6 and 7, include printed copies of your code with your inal homework submission.  You should submit a PDF copy of the homework and any associated codes on canvas. Your PDF must be a single ile, not multiple images.

1. Given n data points x1)x2...)xn  lying in bd , the covariance matrix is deined as follows:

(a) Argue that Σ XTX where X is the n by d data matrix deined as

(b) Prove that the covariance matrix is positive semi-deinite.  [emark: A matrix A ebn n is positive semi-deinite if yTAy > 0 for all y e bn.]

(c) Prove that all eigenvalues of the covariance matrix are non-negative.  [Hint:  consider the quadratic form.]

(d) The covariance matrix is not necessarily positive deinite.  Let d = 4.  Describe or give an example of data for which the covariance matrix is positive semi-deinite but not positive deinite.

(e) Let d = 4.  Describe or give an example of data for which the covariance matrix is positive deinite.

[Remark: For parts (d) and (e), data point must be not trivial e.g.  (0)0)0)0)].

2. consider n data points y1)y2...)yn  lying in bd.  The mean of the data points is deined as μ =  Σ yi. Let the points {x1  = y1  - μ) x2  = y2  - μ) ...)xn  = yn  - μ} denote the centered points i.e.  the points have zero mean  (centered at origin).  Let V be a unit vector in bd  and

let x(教)1x(教)2...)x(教)n  denote respectively the projection of the centered points onto the vector V.

The representation of the projections with respect to the coordinate V is c1   = (x1 )TVc2   = (x2 )TV...)cn  = (xn )TV.

(a) show that the variance of {c1c2...)cn } is given by

(b) show that the variance of {y1(T)Vy2(T)V...)yn(T)V} is given by

(c) what is the implication of the results in (a) and (b) to inding theirst principal component of the data? Briely interpret your result.

3.  consider n data points x1)x2...)xn  lying in bd.  Let v1)v2   and v3   denote the irst three principal components of the data.

(a) Letx(教)i  denote the projection of a data point xi  onto the subspace spanned by theirst three principal components. what is the coordinate ofx(教)i  with respect to the basis {v1v2v3 }?

(b) Assume d  3.  what is the low dimensional embedding of the data points?

(c) Let y be a point in bd  and let y(教) be the projection of y onto the subspace spanned by the irst three principal components. prove that y(教) = VVTy where

4. Let A be an n  n symmetric matrix.

(a) prove that λmin (A 1三i三n(min) Ai,i  i.e. the minimum eigenvalue of A is upper bounded by the the minimum value in the diagonal.

(b) prove that λmax (A) > 1三(m)i三n(ax) Ai,i  i.e. the maximum eigenvalue of A is lower bounded by the the maximum value in the diagonal.

[Hint: use Rayleigh quotient.]

5.[Bonus: 5 pts] Let A be a 2n  2n symmetric matrix of the following form

where the blocks A1)A2 and A3  are each n n matrices and A1 and A2  are symmetric matrices. prove that λmin (A min (λmin (A1 ))λmin (A2 )).  [Hint:  use Rayleigh quotient.]

6.  In this problem, we implement the principal component analysis algorithm and test it on 2-dimensional datasets.

(a) Given n points in b2 , implement an algorithm that takes the data points as input and returns the principal components.

Remark: No credit will be given to using an inbuilt pcA function. However, you can use any inbuilt function to compute eigenvalues and eigenvectors.  For example, in MATLAB, you can use the eig command.

(b) Load the data gau网网ian-noi网y available in the Hw3 folder.  compute and display the irst 2 principal components of the data.  what is the percentage of variance for the irst prin- cipal component?what is the percentage of variance for the second principal component? summarize and explain your observations.

(c) Load the data uniform-noisy available in the HW3 folder.  compute and display the irst 2 principal components of the data.  compute the percentage of variance for the each of the irst two principal components. Summarize and explain your observations.

7. In this problem, we consider the latent features obtained by the principal component anal- ysis and explore the relationship between the number of principal components and average reconstruction error.  The dataset we consider is the MNIST dataset which is a database of handwritten digits.

(a) Load the data mnist-067 available in the HW3 folder.  The included data is a subset of the MNIST data consisting of the digits 0)6 and 7.  There are 21072 digits and each digit is an image of size 28  28.  With that, the data matrix is  a matrix of size  21072  784. Note that each image is mapped into a 784 dimensional vector with each entry informing the gray pixel intensity.  project the data points onto the irst two principal components of the data.  Show the representation of each data point in the coordinate of the principal components i.e.  plot the latent representation of the data in b2 .  use diferent colors to label the latent features according to the label of the digit.  Is this a good low dimensional representation? Interpret your results.

(b) We now consider the digit 7 from the provided dataset.  Deine the average reconstruction error as follows

where n is the number of digits of label 7, xi  is the input representation of the digit and i  is the reconstructed digit using K principal components of the data.  plot the average reconstruction error as a function of the number of principal components.  Let the array of the number of principal components be {1)10)20)...)300}.  Briely discuss your results.

[Remark: For this problem, you can use an inbuilt pcA function from a solver of your choice.]