Skip to content
All library documents

Stabilizing PCA Weights in Fixed-Income Yield Data

Article Quant Q&A · Author: meh

Summary

The document describes unstable weights produced when principal component analysis is applied to rolling windows of fixed-income yield levels. The analyst extracts the first two component vectors, fixes one weight, and solves a linear system for the others; the resulting weights sometimes become very large. The response suggests applying PCA to changes or log changes in yields, a common treatment in fixed-income analysis, rather than to yield levels alone.

It also connects weight spikes with outlier moves in an input series and recommends checking for data breakpoints, regime changes, or rare events. Smoothing weights using priors is offered as another possible remedy. These suggestions recognize that a small set of instruments and estimated components can be sensitive to unusual observations and changing market conditions. The answer is brief and provides no diagnostic procedure or empirical test, so the analyst must determine whether transformations, data issues, or smoothing are appropriate for the specific series.

Key ideas

  • PCA on yield changes or log changes may be more suitable than PCA on yield levels in fixed-income analysis.
  • Large weight moves may coincide with outliers or structural breaks in the input data.
  • Regime changes and rare events should be considered when rolling PCA weights become unstable.
  • Smoothing weights with priors is a possible way to reduce variation, subject to reasonable assumptions.

Tags

Full text
# Weights Blowing up in PCA


# Weights Blowing up in PCA












I'm using daily settlement data to get yield levels for a couple of products. From this data I am doing PCA on a rolling collection of the yield levels. I have been using sci-kit learn's PCA function, but I also see the issue when doing my own PCA through Numpy. So as far as I know it's not an issue of the libraries.

After I get the vectors I solve the linear equations such that the first two principle components sum to 0. This is done by setting one of the weights = 1.0

Here's an example. I have data for 150 settlements and I calculate the PC's using data from day 0-100, then I recalculate 10 days later on data 10-110, etc.

When I do this I get a graph of the PC's

And here are the corresponding weights.

Relevant math: After performing the PCA I get the components matrix $~ \left( \begin{array}{ccc} a & b & c \\ d & e & f \\ g & h & i \end{array} \right) $ From here I take the first two vectors $[a, b, c]$ and $[d, e, f]$. Which I then turn into the equation $Ax = B$ that looks something like this $~ \left( \begin{array}{ccc} a & c \\ d & f \end{array} \right) \left(\begin{array}{ccc} x_1 \\ x_3 \end{array} \right) = \left(\begin{array}{ccc} b \\ e \end{array} \right)$

As you can see the $x_1$, $x_3$ weights start to blow up at some point which doesn't really make sense given the nature of the data.

Does anybody have any insight to my problem?

## Answer by closedloop (score 2)

https://quant.stackexchange.com/a/19425

A couple quick thoughts.

- Do the PCA on changes or log-changes in your series. That is often how PCA is conducted in fixed-income settings.

- You're large move in wights corresponds to outlier moves in the blue series. Given the assumptions of a PCA, I would consider whether your dataset has suffered from any breakpoints, regime changes or other rare events

- Think about smoothing your weights (with some priors). Remember that you are trying to explain the interaction of three fixed income instruments (which are driven by economies, politics, and market forces) by only 9 parameters. You need to match your analysis with reasonable expectations on its performance.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.