

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


A PCA projection represents a data set in terms of the orthonormal eigenvectors of the data set’s covariance matrix. A covariance matrix captures the correlation between variables in a data set. PCA finds the orthonormal eigenvectors of the covariance matrix as the basis for the transformed feature space. (Eigenvectors can be thought of as the “natural basis” for a given multi-dimensional data set.) Higher eigenvalues in the covariance matrix indicate lower correlation between the features in the data set. PCA projections seek uncorrelated variables. Every data set has principle components, but PCA works best if data are Gaussian-distributed. For high dimensional data the Central Limit theorem allows us to assume Gaussian distributions.
The variance of a single variable x is given by:
σ^2 =
∑n i=1(xi^ −^
n
The variance of two variables, x and y, is given by:
cov(X, Y ) =
∑n i=1(xi^ −^ X¯)(yi − Y¯ ) n
Covariance tells you how two variable vary together:
cov(X) =
var(X 1 ) cov(X 1 , X 2 ) · · · cov(X 1 , Xn) cov(X 2 , X 1 ) var(X 2 ) · · · cov(X 2 , Xn) .. .
cov(Xn, X 1 ) cov(Xn, X 2 ) · · · var(Xn)
Notice that:
For PCA, we subtract the means X¯i from each xi before constructing the covariance matrix so that each X¯i has a mean of zero. Subtracting the means allows us to rewrite the covariance matrix as the following matrix multiplication:
Σ =
n
Then, by the spectral decomposition theory, we can factor the matrix above into:
Σ = UΛUT
where Λ = diag(λ 1 , · · · , λn) is the diagonal matrix of the eigenvalues of the covariance matrix ordered from highest to lowest:
λ 1 0 0 0 0 λ 2 0 0 0 0
0 0 · · · λn
Then, the principal components are the row vectors of UT. We call UT^ the projection weight matrix W and the transformed data matrix S can be obtained from the original data matrix X by:
S = WX
Note that if we choose not to use eigenvectors that correspond to lower eigenvalues so that W has fewer rows, then each s will have lower dimensionality than its corresponding x. Discarding these eigenvectors can be thought of as discarding noise from the data, since these eigenvectors represent highly correlated, and thus uninformative variables.
The total variation in a PCA transformation of a data set is the sum of the eigenvalues of the covariance matrix. Since these eigenvalues are contained in Λ,
∑^ n
i=
V ar(P Ci) =
∑^ n
i=
λi = trace(Λ)
So the fraction ∑k
i=
λi trace(Λ)
gives the cumulative proportion of the variance explained by the first k principle components. (Recall that the trace of a matrix is the sum of the elements on its main diagonal.)