You are on page 1of 2

PCA MANUAL

Abstract
This is a description of PLS in the context of pricing and hedging related FI contracts on the yield
curve. For more general overview of the framework, please consult other resources.
General Overview
Suppose we are looking at 12 Eurodollar contracts. At a given point in time, the state of the market can
be described by a point in 12-dimensional space, where each axis(coordinate) corresponds to the price
of one of those contracts. Due to their high level of linearity, we can approximate this state of the
market with (at most) 3 axes(coordinates) instead, provided that these axes are selected appropriately.
These axes are called principal components, It turns out that the best such axes are the eigenvectors of
the covariance matrix of the prices, snapshotted at various recent points in time. Moreover, these have
to be the eigenvectors corresponding to the largest eigenvalues in absolute value. To compute fair
prices, one first takes the original state of the market, projects it to a 3-dimensional(or less) subspace
spanned by the principal components, and then projects this point back to the original 12-dimensional
space. At the end of this round trip to the smaller subspace and back, we arrive at the model prices
for each of the 12 original contracts. Note that if we use all 12 PCs, at the end of this round trip, we will
get exactly the original data we started off with(modulo round-off errors).
The first component for FI products usually explains more than 80% of the variance of the observed
data. With 3 PCs, we can account for >95% of the variability in the data. This is rather fascinating,
because we use 3 axes to represent 12 dimensional points, and we can describe them with 95%
accuracy. Of course, the high degree of correlation between the original 12 dimensions is what makes
this work.
Concrete Example
Here are some concrete values for the principal components I obtained using 8 consecutive Eurodollar
contracts:
1) [-0.277 -0.36 -0.365 -0.366 -0.36352894 -0.36 -0.36 -0.36]
2) [-0.896 -0.1568 -0.016
0.03 0.199 0.22
0.21
3) [ 0.33 -0.57 -0.42 -0.285 0.1 0.24 0.32 0.36]

0.186]

Note that in the first principal component, all numbers have the same sign, this is because this
component represents the overall level of the market, i.e. when we take the dot product of this vector
with the 8-dimensional vector of prices snapshotted at a given moment, we get an idea of the overall
level of the market, it is a weighted average of all the prices.
Analogously, the second component represents the slope(steepness) of the market, the first few
components have different sign from the last few components, so intuitively, the dot product of this
vector with the prices gives the difference between the front and the back of the curve.
The third component is the curvature(convexity), and it computes the difference tails belly(note how
it starts positive, then it has a few negative values, and ends with a few positive).

Gotchas
PCA only works with normalized data, i.e. each column of our input matrix must have mean 0 and
variance 1. Therefore, first price data has to be normalized, then PCA can be performed, and finally the
results can be scaled back and transformed to the original referent system.
Hedging
We say that our portfolio is hedged with respect to a particular principal component if the dot product
of that principal component and the positions of the portfolio is 0. Note that the principal component
has to be scaled back using the standard deviation of each contract. In the above example, the hedging
coefficients with respect to the first PCA turn out to be
[1, 0.48, 0.33, 0.29, 0.24, 0.23, 0.22, 0.23]
They have been scaled with the standard deviations of each contract, and normalized so that the first
value is 1.
For comparison, OLS produced the following hedging coefficients:
[1, 0.5, 0.33, 0.28, 0.20, 0.19, 0.19, 0.2]

This means, that for example the following portfolio is hedged(with respect to the first component):
<100, -48, 0, 0, 0, 0, 0, 0>.
Here is another example for a portfolio hedged w.r.t. the first PC:
<-200, 48, 0, 0, 24, 0, 0, 0>
Note that these are not hedged with respect to other components. One can, for example, take <100, -48,
0, 0, 0, 0, 0, 0>, and perform some additional trades so that the portfolio becomes hedged with respect
to the other 2 components, and does remain hedged with respect to the first one.
Suggested Usage
1) We can have 3 charts, each of which tracks one of the 3 PCAs. Then one can try to relate
problematic times for a given basket with shifts in one of the PCAs. This can suggest ideas for more
effective hedging, after a more elaborate analysis on whether such a variance-profit trade-off is
worthwhile, or manually force hedging with respect to a particular component when systematic shifts
of the yield curve are observed.
2) PCA can be used as an online(live) pricing methodology.
3) We can use PCA coefficients for better hedging, which can be computed either offline(historically,
and then hard-coded) or online(live).
Implementation Details

You might also like