Quant Memo
Core

Dimensionality Reduction in Finance

Squeezing hundreds of correlated features or assets down to a handful of underlying drivers, usually with PCA, so models are stabler, faster, and less prone to fitting noise in a low-signal world.

Prerequisites: PCA (Principal Component Analysis), Covariance Matrix Estimation

Financial datasets are wide and redundant. You might track 500 stocks, or engineer 200 features from a handful of price series, but those columns are far from independent, most stocks move with the market, and many features are lightly rescaled versions of one another. Dimensionality reduction is the art of compressing all that overlap into a small number of genuine drivers. Fewer, cleaner inputs mean models that train faster, generalize better, and are far less likely to fit noise, which matters enormously in a domain where the true signal is faint.

The workhorse is Principal Component Analysis (PCA). It finds new axes, called principal components, that are combinations of your original variables chosen so the first captures as much of the total variance as possible, the second captures as much of what's left while staying uncorrelated with the first, and so on. Keep the first few and you have a compact summary that throws away mostly redundancy.

How PCA finds the drivers

PCA is an eigen-decomposition of the covariance (or correlation) matrix. If Σ\Sigma is the covariance matrix of your standardized variables, PCA solves

Σvk=λkvk,\Sigma\, v_k = \lambda_k\, v_k,

where each eigenvector vkv_k is a principal component (a direction in feature space) and its eigenvalue λk\lambda_k is the amount of variance that lies along it. Order them from largest λ\lambda to smallest. The fraction of total variance explained by component kk is

explainedk=λkjλj.\text{explained}_k = \frac{\lambda_k}{\sum_j \lambda_j}.

In finance the first component of a set of stock returns is almost always "the market", a direction in which everything moves together, and it typically soaks up the lion's share of the variance. The next few pick up sectors or style factors, and the long tail is mostly idiosyncratic noise. Plotting the explained variance per component gives the classic scree plot, and the "elbow" where it flattens tells you how many components are worth keeping.

elbow 52% PC1 PC2 PC3 PC4 PC5 PC6 PC7 PC8 variance explained
A scree plot of stock-return components. The first "market" component dominates; the bars collapse after an elbow, so keeping the first two or three components retains most of the real structure and discards mostly noise.

PCA rewrites correlated variables as uncorrelated components ordered by variance. Keep the first few and you capture most of the real structure; the discarded tail is largely noise. The variance explained ratio λk/jλj\lambda_k / \sum_j \lambda_j tells you how much each component is worth.

Worked example: five bank stocks

You have daily returns for five banks. Their correlation matrix is dense, off-diagonal correlations around 0.7, because banks move together. Run PCA on the correlation matrix and suppose the eigenvalues come out as

λ1=3.6,λ2=0.5,λ3=0.4,λ4=0.3,λ5=0.2.\lambda_1 = 3.6,\quad \lambda_2 = 0.5,\quad \lambda_3 = 0.4,\quad \lambda_4 = 0.3,\quad \lambda_5 = 0.2.

They sum to 5 (the number of standardized variables, by construction). The first component explains 3.6/5=72%3.6/5 = 72\% of the variance, an almost-equal-weighted average of the five banks, this is the "banking sector" factor. The second explains only 0.5/5=10%0.5/5 = 10\% and might contrast big banks against regional ones. Together the first two capture 82%82\% of the total variation using two numbers per day instead of five. For a downstream model, feeding those two components instead of five correlated returns removes the redundancy, cuts Multicollinearity, and leaves fewer knobs for the model to overfit.

Where it misleads

  • Standardize first. PCA chases variance, so a feature measured in large units will dominate purely because of its scale. Almost always run PCA on the correlation matrix (equivalently, z-scored features), not raw covariance.
  • Components are unstable. On noisy financial data the eigenvectors wobble from period to period, and the sign of a component is arbitrary. A component you keep this month may look different next month, random matrix theory shows that most small eigenvalues are indistinguishable from pure noise and should be treated as such.
  • Max-variance is not max-predictive. PCA keeps the directions of biggest variance, which need not be the directions that predict your target. A tiny-variance component can carry the real signal; blindly dropping it throws away the alpha. When you have a target, methods like partial least squares keep predictive directions instead.
  • Interpretability fades. A component is a weighted blend of everything, so "PC3" has no clean meaning. That is fine for a risk model but awkward when you need to explain a trade.

Do not fit PCA on the full sample and then cross-validate, that leaks future data into the training folds (see Data Leakage in Machine Learning). Fit the reduction inside each training fold and apply it to the test fold, exactly as with any other learned transform.

To decide how many components to keep, do not eyeball the elbow alone. Random matrix theory gives a threshold: eigenvalues below the largest value expected from pure noise (the Marčenko-Pastur edge, roughly (1+N/T)2(1 + \sqrt{N/T})^2 for NN assets and TT observations) are indistinguishable from randomness, so keep only the components above it.

Beyond PCA

PCA is linear and unsupervised, but it anchors a whole family. Clustering groups correlated assets rather than rotating them, and is often more interpretable. Singular Value Decomposition is the numerical engine underneath PCA and works directly on the data matrix. And full Factor Risk Models impose economically meaningful factors instead of purely statistical ones. The common thread: markets have far fewer independent drivers than they have columns of data, and finding those drivers is half the battle in building a model that generalizes.

Related concepts

Practice in interviews

Further reading

  • Hastie, Tibshirani & Friedman, The Elements of Statistical Learning (Ch. 14)
  • López de Prado, Advances in Financial Machine Learning (Ch. 8)
  • Jolliffe, Principal Component Analysis
ShareTwitterLinkedIn