Exercises
Exercises
Exercise 1
Let \(X\) be centred with \(n\) rows and \(p\) columns, and let \(X = U S V^\top\).
- Show that \(\Phi = V\) diagonalizes \(\hat\Sigma = \frac{1}{n-1}X^\top X\), and give the eigenvalues in terms of the singular values.
- Show that \(Z = US\).
- Show that the reconstruction from all components, \(Z\Phi^\top\), gives back \(X\) exactly.
Exercise 2
Answer with a short justification.
- The loadings \(\phi_1\) and \(-\phi_1\) describe the same component. Why.
- Two data sets differ only in the units of one column. Do they have the same principal components.
- We add a constant to every entry of one column. Do the principal components change.
- Can the proportion of variance explained by the first component be smaller than \(1/p\).
Exercise 3
A colleague shows you a t-SNE plot and says three things. For each one, say whether it is justified.
- These two clusters are far apart, so the two cell types are very different.
- This cluster is larger, so there are more cells of that type.
- These points are next to each other, so they are similar.
Exercise 4
PCA on the wine data.
- Load it and standardize the 13 measurements.
- Make a scree plot and decide how many components to keep.
- Make a biplot of the first two components. Which variables are correlated.
- Colour the points by the true class. Do the classes separate.
- Repeat everything without standardizing. What changes, and why.