Back to Understanding Linear Algebra

Principal Component Analysis

Collapsing a high-dimensional dataset onto the few directions that carry most of its variance, so it can finally be plotted and interpreted.

Understanding Linear Algebra, Principal Component Analysis

Status
FlagsLoading your progress…

5 exercises

Activity 7.3.2

Suppose that we work with a dataset having 100 five-dimensional data points. The demeaned data matrix AA is therefore 5×1005\times100 and leads to the covariance matrix C=1100 AATC=\frac1{100}~AA^T, which is a 5×55\times5 matrix. Because CC is symmetric, the Spectral Theorem tells us it is orthogonally diagonalizable so suppose that C=QDQTC = QDQ^T where

  1. What is Vu2V_{\uvec_2}, the variance in the u2\uvec_2 direction?

  2. Find the variance of the data projected onto the line defined by u4\uvec_4.…

2.5

Exercise 1

Suppose that and that we have two datasets, one whose covariance matrix is C1=QD1QTC_1 = QD_1Q^T and one whose covariance matrix is C2=QD2QTC_2 = QD_2Q^T. For each dataset, find

  1. the total variance.

  2. the fraction of variance represented by the first principal component.

  3. a verbal description of how the demeaned data points appear when plotted in the plane.

2.5

Exercise 2

Suppose that a dataset has mean [1357]\threevec{13}{5}{7} and that its associated covariance matrix is C=[275−206251−206320−206251−206275]C=\begin{bmatrix} 275 & -206 & 251 \\ -206 & 320 & -206 \\ 251 & -206 & 275 \end{bmatrix}.

  1. What fraction of the variance is represented by the first two principal components?

  2. If [30−326]\threevec{30}{-3}{26} is one of the data points, find the coordinates when the demeaned point is projected into the plane defined by the first two principal components.

  3. If a projected data point has coordinates [12−25]\twovec{12}{-25}, find an estimate for the original data p…

2.5

Exercise 4

Determine whether the following statements are true or false and explain your thinking.

  1. If the eigenvalues of the covariance matrix are λ1\lambda_1, λ2\lambda_2, and λ3\lambda_3, then λ3\lambda_3 is the variance of the demeaned data points when projected on the third principal component u3\uvec_3.

  2. Principal component analysis always allows us to construct a smaller dimensional representation of a dataset without losing any information.

  3. If the eige…

2.5

Exercise 5

In this activity, we looked at a dataset consisting of four measurements of 150 irises. These measurements are sepal length, sepal width, petal length, and petal width.

  1. Find the first principal component u1\uvec_1 and describe the meaning of its four components. Which component is most significant? What can you say about the relative importance of the four measurements?

  2. When the dataset is plotted in the pl…

2.5

Adapted from Understanding Linear Algebra © 2023 David Austin. Licensed under CC BY 4.0. Source: Understanding Linear Algebra. Imported at revision 3e6dced.