Principal Component Analysis

Principal component analysis, PCA, is the first dimension-reduction method most researchers reach for, and interviewers ask about it in two ways. The mechanical version is "how does PCA work, step by step?". The research version is "you ran PCA on stock returns and the top component explains 30%. What is it, and what would you do with it?". Both follow from the eigen-decomposition in the previous lesson.

The method

PCA replaces a set of correlated variables with uncorrelated components, ordered from the most variance to the least.

  1. Centre each variable by subtracting its mean. Standardise it as well if the variables are in different units.
  2. Compute the covariance matrix Σ\Sigma of the prepared data, or the correlation matrix if you standardised.
  3. Find its eigenvectors and eigenvalues, and sort them from the largest eigenvalue down.
  4. Project the data onto the leading eigenvectors. The kk-th component is qk⊤xq_k^\top x, with variance λk\lambda_k.

The rest of this lesson is for subscribers

Unlock every lesson in Basics of Quantitative Finance, and every other premium course.

Subscribe to continue

Test your knowledge

Questions are only available to subscribers.

Keep reading Basics of Quantitative Finance

30 lessons in this course, and every other premium course, on one subscription.

  • Every lesson in every course, with the worked examples and interactive simulators
  • Graded questions on every lesson, with explanations for the wrong answers as well as the right one
  • The trainers, timed assessments and brainteaser library that go with them