Principal Components Analysis
Definition
Consider the k variables
x1,..., xk.
Let us say
rmn
denotes the correlation between
xm and xn and
rmn!=0 for some m!=n where
m=1,...,k and
n=1,...,k.
Principal Components Analysis (PCA) is a method of transforming
the k original variables
(i.e. x1,..., xk)
into k new variables
p1,..., pk, referred to as principal components,
where the new variables are uncorrelated
(i.e.
To determine the weights (i.e. wi,j) we need to review some additional matrix algebra through determinants and then we can discuss eigenvalues, eigenvectors, and spectral decomposition.
Note:
Matrix Algebra
Let us say we have n instances of the k variables x1,..., xk and let the nxk matrix X denote these instances then we may define the following:
The mean vector is the vector of the k means of the k variables in X.
The covariance matrix is a symmetric kxk matrix of covariances of the k variables in X. That is, if smn denotes the covariance between xm and xn, and S is the covariance matrix, then smn will be the entry in the mth row and nth column of S. Note that smn = smn and smm = sm2 (i.e. the variance of the values of xn.
Let:
then:
The correlation matrix is a symmetric kxk matrix of correlations of the k variables in X. That is, if rmn denotes the correlation between xm and xn, and R the correlation matrix then rmn will be the entry in the mth row and nth column of R. Note that rmn = smn/(sqrt(smmsnn)).
Let D be the square diagonal matrix of variances sm2; m=1,...,k and D-1/2 be the matrix of reciprocals of the standard deviations sm; m=1,...,k then let:
then:
The determinant of the kxk mtrix A, denoted by |A|, is the scalar:
Note
Let A be a kxk matrix. The trace of A, denoted
tr(A), is the sum of the diagonal elemnets of
A. That is,
tr(A) =
Ski=1aii
If A, B are kxk matrices then:
Ski=1
Skj=1aij2
A square matrix A is said to be orthogonal if its rows, considered as vectors, are mutually perpendicular and have unit lengths.
Note that this means:
Also, A is orthogonal iff:
Note:
and so X and Y are perpendicular if:
Mutually perpendicular vectors are linearly independent.
Let A be a kxk matrix and I the kxk identity matrix. Also, let l1, l2,..., lk saisfy the polynomial:
then the
li's; i=1,...,k, are
called the eigenvalues (or the characteristic roots) of A. The
equation
|A -
lI|
is called the characteristic equation.
Example:
Let A be a 2x2 matrix
and, using IML notation, let A={1 0, 1 3}.
Find the eigenvalues of A.
Solution:
Hence:
Hence:
l1 = 1 and
l2 = 3.