PCA
Applies to PredictiveInsight only.
Syntax
PCA(data)
Parameters
data
The numerical values for which to compute the principal components. This can be a constant, a column, a cell range, or an expression evaluating to any of the above.
Description
PCA performs principal component analysis on the specified data range. It finds the orthogonal eigenvectors to the data range specified by data using singular value decomposition. It returns one new column for each of the n columns specified as input, plus one additional column. The first n columns contain the eigenvectors (each eigenvector is read as a row across the n columns). The last returned column contains the corresponding magnitudes of eigenvalues. The eigenvectors are ordered according to their corresponding eigenvalues.
*
Missing values (for example, empty cells and ??? 's) are counted as zeros. Any short columns in data are padded with zeros to the length of the longest column.
Here are the details for how the PCA is computed:
*
Each of the k rows of data is an n-dimensional vector (n is the number of columns in data). These are used to compute the correlation matrix A as follows:
*
The n-by -n correlation matrix A is decomposed using singular value decomposition into three matrices:
The rows of U are the eigenvectors of A and is a diagonal matrix where each diagonal element is the magnitude of the eigenvalues for A.
The PCA macro function returns U in the first n columns and the diagonal elements of in the last column.
Examples
Creates two new columns named TEMP and VX, containing the values -1 and 0, respectively.
Creates two new columns named TEMP and VX. The column TEMP contains the value one, and the column VX contains the corresponding eigenvalue.
Creates four new columns named TEMP, VX, VY, and VZ. The values in the three columns contain one eigenvector per row for the data in columns V1-V3. The value in column VZ contains the corresponding eigenvalues.
Related Functions