Concept

PCA

PCA, also known as dimensionality reduction, is a Machine Learning concept. A reference entry: the Library explains it rather than implements it.

What is PCA?

Principal component analysis (PCA) re-expresses a set of correlated variables as a smaller set of uncorrelated ones. Technically it finds the eigenvectors of the data's covariance (or correlation) matrix: each eigenvector is a principal component, a weighted combination of the original variables, and the components are ordered by how much of the total variance they explain. Keeping only the first few compresses the data while retaining as much of the total variance as any linear projection of that dimension can, which is why PCA is the canonical dimensionality-reduction technique.

The method is classical statistics with a long finance career: Karl Pearson introduced it in 1901, Harold Hotelling systematized it in the 1930s, and fixed-income research made it famous by showing that a few components explain most yield-curve movement, conventionally read as level, slope, and curvature. Equity risk models, statistical arbitrage, and factor analysis all run on the same machinery.

Markets give it two natural jobs. Run across a basket of assets, the first component usually captures the shared move (loosely, the market factor), while later components pick up rotation and spread effects; each asset's loading measures how strongly it participates. Run across an indicator stack, PCA collapses dozens of overlapping inputs into a few orthogonal factors, a common feature-engineering step before model fitting, since redundant inputs inflate overfitting risk without adding information.

The caveats are as standard as the method. PCA is linear, so nonlinear structure hides from it; components are ranked by variance, and the most variable directions are not necessarily the most predictive ones for any given label; loadings drift as the estimation window rolls, and each component's sign is arbitrary, so labels like 'risk-on factor' need re-verification rather than faith. When nonlinearity matters, autoencoder-style neural networks generalize the compression at the cost of interpretability.

How to read a PCA tool on a chart

PCA outputs come as explained-variance shares, loadings, and component scores; each answers a different question.

  1. 1Check the inputs and standardization first: PCA on raw prices is dominated by scale and trend, so returns (or z-scored features) are the defensible input.
  2. 2Read the explained-variance table: how much of total movement the first components capture, and how quickly the shares decay.
  3. 3Read the loadings: each asset's or feature's weight in a component says what that component is made of, and whether the 'market factor' story actually holds.
  4. 4Track stability: recompute over rolling windows and watch whether loadings and variance shares hold; components that reshuffle every window cannot carry standing interpretations.
  5. 5Use the scores: component values per bar serve as compressed features, regime dials, or the basis for spread and rotation reads.

How traders use it

  • Extracting a market factor: the first principal component of basket returns typically behaves like an index, and an asset that departs from what its loading implies becomes a relative-strength or pairs-trading candidate.
  • Compressing features: replacing many correlated oscillators and averages with two or three components that carry most of the variance, so a downstream model estimates fewer parameters from the same amount of data.
  • Reading concentration: when the first component's share of explained variance rises, assets are moving as one block (risk-on/risk-off conditions); when it falls, dispersion is increasing and cross-sectional selection matters more.
  • Preparing regime models: component scores make compact inputs for k-means regime labels or Markov-switching models, which behave better on a few orthogonal dimensions than on dozens of correlated raw series.
  • Denoising correlation structure: truncating small components filters estimation noise out of correlation matrices, a standard cleanup before portfolio construction and spread selection.

PCA vs neighboring techniques

Feature Engineering: Feature engineering creates candidate inputs; PCA compresses them afterward. The rotation cannot rescue uninformative features, it can only remove their redundancy, so the creative step stays upstream.

K-means Regime Clustering: K-means partitions observations into discrete states; PCA rotates dimensions into ordered factors. They compose naturally, clustering on component scores, but they answer different questions: what kind of day is this, versus what directions does variation take.

Neural Networks: An autoencoder is PCA's nonlinear descendant: compress, then reconstruct, learning curved structure linear projections miss. The price is opacity and data hunger, which is why PCA remains the default first pass.

Concept family

Machine Learning

32 concepts mapped · 32 in the Library

PCA FAQ

Do you need to standardize data before running PCA?

Usually, yes. PCA is scale-sensitive: variables with larger numeric ranges dominate the covariance matrix regardless of structure. Z-scoring each input, or equivalently working from the correlation matrix, puts variables on comparable footing. Skipping this is defensible only when the inputs already share units and magnitudes, such as daily returns across broadly similar assets.

What do principal components actually mean in trading terms?

They are statistical constructs, not guaranteed economic factors. In practice the first component of an asset basket usually tracks the common market move, and in yield curves the first three are conventionally read as level, slope, and curvature. But component composition can shift as the estimation window rolls, so interpretations should be re-checked rather than assumed permanent.

How many components should be kept?

The standard heuristics: keep enough to reach a chosen share of explained variance (80 to 90 percent is common), look for the elbow where the scree curve flattens, or keep components whose eigenvalues beat a noise benchmark. For trading features the honest criterion is downstream: keep the number that makes the out-of-sample model best, which is often fewer than the variance heuristics suggest.

Should PCA run on prices or returns?

Returns, almost always. Prices trend and share long-run drift, so price-level PCA mostly discovers 'everything went up,' a nonstationary artifact. Returns (or standardized features built from them) give the covariance structure the method assumes. The same logic applies to indicator stacks: difference or normalize anything whose level drifts before letting it into the matrix.

Why did my first component flip sign between runs?

Eigenvectors are defined only up to sign: multiplying a component and its loadings by -1 changes nothing mathematically, and solvers pick signs arbitrarily. Libraries differ, and rolling re-estimation can flip signs run to run. The fix is a convention, such as forcing the largest loading positive, so that time series of component scores remain comparable.

Is PCA predictive?

Not inherently. It maximizes explained variance in the inputs, which is a statement about the past's structure, not the future's direction; a component can carry most of the variance and none of the predictability for your label. Its value is preparatory, compression, denoising, interpretable structure, and any predictive claim belongs to the model built on top, judged out of sample like everything else.

Turn PCA into a trading strategy.

Describe your PCA idea to Quant. It builds the strategy with you and backtests it on real data.