You are on page 1of 3

Principal Component Analysis

Consider m measurements of a n concurrent data xi Rn , 1 i m. We assume that the measurements


for each individual data point have zero average, i.e.
m
X

xi = 0

i=1

We are looking for the direction of the largests variance of the data set xi in Rn , i.e. we want to maximize
m
X

xi

2

i=1

m
X

T xi xTi = T X

i=1

with respect to R given the constraint


T = 1

X=

m
X

xi xTi Rnn

i=1

is the covariance matrix of all xi .


With the Lagrange multiplier we define

p = T X T 1

(1)

and maximizing this yields


dp
= (X I) = 0
d
which is an eigenvalue/eigenvector equation for the covariance matrix X. The largest eigenvalue 1 then
maximizes eq. 1
p = 1
and its corresponding eigenvector 1 gives the direction of the largest variance of the data set xi .
The direction of the second largest variance can be obtained by removing the direction of the largest
variance from the data set

x0i = xi 1T xi 1
and defining a new covariance matrix
X0 =

m
X

x0 i x0 i =

i=1

m 

X


2
xi xTi 1T xi xi 1T + 1 xTi + 1T xi 1 1T Rnn
i=1

for which by definition


X 0 1 = 0
The corresponding eigen equation will yield as largest eigenvalue the second largest eigenvalue 2 of the
original eigen equation.
An alternative and more useful fomulation uses singular value decomposition. Define the n m matrix
Mij = (xj )i
where the columns are the m data vectors xj . We have
1

X = MMT
The singulare value decomposition of matrix M results in
T
M = U DV
Rnm is diagonal and V Rmm is row orthogonal. The covariance
where U Rnn is orthogonal, D
matrix X is then
D
T UT
X = UD
D
T . The diagonal
i.e. U is the orthogonal matrix that diagonalizes X to the diagonal matrix D = D

elements in D are the square roots of the eigenvalues i .


We can now choose the first k < n largest eigenvalues to approximate M

V T =
UD

k p
X
i ui viT

ii
D
=0

i > k

i=1

Mab

k p
X

i (ui )a (vi )b

i=1

with ui Rn the column vectors of U and vi Rm the column vectors of V which are called principal
components of the data variance. With this we capture
Pk

Pni=1 i
i=1 i
percent of the data variance.

Application to Finance
Consider a portfolio of trades whose present value depends on a set of interest rates
P = P ({r})
The change in the portfolio value due to changes in the interest rates is

k
X P
X
X P
p
r +
(ri )t
j (uj )i (vj )t
P =
ri
ri
i
j=1
i
where the last approximation derives from the singular value decomposition of the matrix representing
the changes in the interest rates over a period of time (ri )t . The index t represents the time of the
interest rate change we want to approximate. The P&L of the portfolio due to interest rate changes at
time t can then be explained to a certain accuracy by the first k eigenvectors of the covariance matrix of
the changes. The term r is the average over all interest changes so that the zero-average assumption
holds for the data used in the PCA mechanism.
If we want to hedge the first few principal components we need to choose one hedge instrument to
hedge out the first principal component, two further hedge instruments to hedge out the second principal
component and so forth. With those the change of the combined portfolio
k(k+1)
2

P = P +

X
c=1

hc Nc

must be 0 for any independent variation of the principal components for suitable notionals Nc , i.e.

(+1)

2
X
X
p
P
h
c

r +
j (uj )i (vj )t
+
Nc
r
r
i
i
c=1
i
j=1

(+1)

2
X
X P
X
p
hc

k
j (vj )t
(uj )i +
Nc
(uj )i
r
ri
i
c=1
j=1
i

must be 0 for all independent variations of

p
j (vj )t (assuming r is small), hence we need

(+1)
2
X
P
h
c

Nc
(uj )i +
(uj )i = 0
ri
r
i
c=1

X
i

1j

i.e. for each we have an equation for the notionals of the form
= 0
a + B N
with a R , B R and N R

(1)
2
X
h
P
c

+
(uj )i
ri
r
i
c=1

(a )j

X
i

(B )jl

X hl+ (1)
2

ri

(uj )i

N (1) +1 , . . . , N (+1)
2

T

References
[1] Carol Alexander Market Risk Analysis Volume II
[2] Golub B. and Tilman L. (2000), Risk Management: Approaches for Fixed Income Markets John Wiley
& Sons, Inc., Chapter 3.

You might also like