Fewer numbers that keep the story
Stocks move together, so 54 monthly return series carry much less than 54 independent pieces of information. Principal component analysis, PCA, finds new axes, the principal components, that are ordered by how much of the variance of the data they carry. The first axis points along the direction of greatest spread, the second is perpendicular to it and carries the next most, and so on. In terms of the covariance matrix, the axes are its eigenvectors and the variances along them are its eigenvalues. The share of variance of component is . Keeping the first few components gives a short description of the data with a small loss.
PCA works on centred data, and on features with comparable scales, so standardise first. Its axes are linear, which suits the market because most stocks share one common move. Kernel PCA does PCA in a space built by a kernel such as the RBF kernel , which scores how close two points are, so it can follow curved structures. Two warnings apply. A component is a mix of all the inputs, so naming it is guesswork. And the leading components are the biggest sources of variance, not the most predictive ones. In finance the first component is the market, the next few are sectors, and a model fitted on components should still be checked on later data.
- Axes by variance: the first component is the direction of greatest spread, each next one is perpendicular.
- Standardise first: PCA follows variance, so a feature with big numbers would dominate.
- Variance is not prediction: the biggest components are not necessarily the useful ones.
Lab · what's graded
- The share of the first component15 pts
- A projection10 pts
- A reconstruction error10 pts
- An RBF kernel value10 pts
- Numbers saved5 pts
- Why standardise before PCA10 pts
- The steps of PCA10 pts
- Match the vocabulary15 pts
- A big component is not a useful one15 pts