21.04.2014 Views

1h6QSyH

1h6QSyH

1h6QSyH

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

376 10. Unsupervised Learning<br />

component; together, the loadings make up the principal component loading<br />

vector, φ 1 =(φ 11 φ 21 ... φ p1 ) T . We constrain the loadings so that<br />

their sum of squares is equal to one, since otherwise setting these elements<br />

to be arbitrarily large in absolute value could result in an arbitrarily large<br />

variance.<br />

Given a n × p data set X, how do we compute the first principal component?<br />

Since we are only interested in variance, we assume that each of<br />

the variables in X has been centered to have mean zero (that is, the column<br />

means of X are zero). We then look for the linear combination of the<br />

sample feature values of the form<br />

z i1 = φ 11 x i1 + φ 21 x i2 + ...+ φ p1 x ip (10.2)<br />

that has largest sample variance, subject to the constraint that ∑ p<br />

j=1 φ2 j1 =1.<br />

In other words, the first principal component loading vector solves the optimization<br />

problem<br />

⎧<br />

⎪⎨<br />

1<br />

maximize<br />

φ 11,...,φ p1 ⎪ ⎩ n<br />

⎛ ⎞ ⎫ n∑ p∑<br />

⎪ ⎬<br />

⎝ φ j1 x ij<br />

⎠2<br />

subject to<br />

⎪ ⎭<br />

i=1<br />

j=1<br />

p∑<br />

j=1<br />

φ 2 j1<br />

=1. (10.3)<br />

From (10.2) we can write the objective in (10.3) as 1 n<br />

∑ n<br />

i=1 z2 i1 . Since<br />

1<br />

n<br />

∑ n<br />

i=1 x ij = 0, the average of the z 11 ,...,z n1 will be zero as well. Hence<br />

the objective that we are maximizing in (10.3) is just the sample variance of<br />

the n values of z i1 . We refer to z 11 ,...,z n1 as the scores of the first princi- score<br />

pal component. Problem (10.3) can be solved via an eigen decomposition,<br />

a standard technique in linear algebra, but details are outside of the scope<br />

of this book.<br />

There is a nice geometric interpretation for the first principal component.<br />

The loading vector φ 1 with elements φ 11 ,φ 21 ,...,φ p1 defines a direction in<br />

feature space along which the data vary the most. If we project the n data<br />

points x 1 ,...,x n onto this direction, the projected values are the principal<br />

component scores z 11 ,...,z n1 themselves. For instance, Figure 6.14 on<br />

page 230 displays the first principal component loading vector (green solid<br />

line) on an advertising data set. In these data, there are only two features,<br />

and so the observations as well as the first principal component loading<br />

vector can be easily displayed. As can be seen from (6.19), in that data set<br />

φ 11 =0.839 and φ 21 =0.544.<br />

After the first principal component Z 1 of the features has been determined,<br />

we can find the second principal component Z 2 . The second principal<br />

component is the linear combination of X 1 ,...,X p that has maximal<br />

variance out of all linear combinations that are uncorrelated with Z 1 .The<br />

second principal component scores z 12 ,z 22 ,...,z n2 take the form<br />

z i2 = φ 12 x i1 + φ 22 x i2 + ...+ φ p2 x ip , (10.4)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!