The Azimuth Project
Principal component analysis (Rev #3, changes)

Showing changes from revision #2 to #3: Added | Removed | Changed



According to Wikipedia:

Principal component analysis (PCA) is a mathematical procedure that uses an orthogonal transformation to convert a set of observations of possibly correlated variables into a set of values of uncorrelated variables called principal components. The number of principal components is less than or equal to the number of original variables. This transformation is defined in such a way that the first principal component has as high a variance as possible (that is, accounts for as much of the variability in the data as possible), and each succeeding component in turn has the highest variance possible under the constraint that it be orthogonal to (uncorrelated with) the preceding components. Principal components are guaranteed to be independent only if the data set is jointly normally distributed. PCA is sensitive to the relative scaling of the original variables.

Depending on the field of application, it is also named the discrete Karhunen–Loève transform (KLT), the Hotelling transform or proper orthogonal decomposition (POD).

PCA was invented in 1901 by Karl Pearson. Now it is mostly used as a tool in exploratory data analysis and for making predictive models. PCA can be done by eigenvalue decomposition of a data covariance matrix or singular value decomposition of a data matrix, usually after mean centering the data for each attribute. The results of a PCA are usually discussed in terms of component scores (the transformed variable values corresponding to a particular case in the data) and loadings (the weight by which each standarized original variable should be multiplied to get the component score) (Shaw, 2003).

PCA with nn basis vectors can also be viewed as the selection of an nn dimensional subspace SS such that projection of the dataset vectors to SS has the minimal summed L 2L_2 error relative to the original dataset.


The orthogonal transformation used by PCA is implicitly assuming that the dataset is generated by process with a zero “expected value”, so that generally a “mean vector” is subtracted from all the data points. There are two approaches to acheiving this:

  1. Using analytical problem knowledge to deteremine the mean, e.g., that the mean is actually zero.

  2. Using the computed average of the data set as the “mean vector”.

The reconstruction viewpoint is relatively insensitive to the choice of mean, but techniques which use the PCA vectors as random variates can be significantly affected by the mean vector.