X
21858

How to figure out Principal Component Analysis band weightings

As an aid in interpreting the results of a Principal Components Analysis, it can be quite helpful to determine the relative contributions of each input band to the new PCA bands. This Help Article explains how to find this information in ENVI.

First, Some Background

ENVI's Principal Components Analysis, or PCA, is a linear transformation which reorganizes the variance in a multiband image into a new set of image bands (see Some details on ENVI's Principal Components algorithm). Each individual band in the output PCA image receives some contribution from all of the input image's bands. The amount that each original input band contributes to each PCA band can be determined by examining the eigenvectors from the PC analysis, which are stored in the PCA statistics file. The eigenvectors define the orientation of the principal component axes in n-dimensional space, or more simply, the direction that the axis points. There is one eigenvector for each PCA Band, and each eigenvector contains one element for each input band. For example, a PC rotation of a 128-band input image would produce 128 PCA Bands and 128 corresponding eigenvectors that each have 128 elements (where the first element of the eigenvector corresponds to input band 1, the second element to input band 2, etc.). The value of an eigenvector element is proportional to the input band's contribution to the PCA Band. Because of the mathematics involved in computing the eigenvectors, the weighting of each input band is computed by squaring the input band's eigenvector element. Thus, the total contribution of all of the input bands to any given PCA Band is the sum of the squares of the PCA Band's eigenvector elements. To determine the contribution that any individual band made, simply square that band's element in the eigenvector and divide it by the sum of squares of the entire eigenvector:

Contribution of band b = eigenvector(b)2 / SUM(for i=1 to n) [ eigenvector(i)2 ]

    where:
    b = the input band number, and
    n = the total number of input bands

Computing the PCA Band Contributions in ENVI

Computing the PCA band weightings in ENVI is made simple by the fact that ENVI normalizes its eigenvectors to be unit length, meaning that the sum of squares for every eigenvector is exactly one (i.e., the denominator in the equation above is always 1.0). Thus, the original band contributions to a PCA band can be computed by simply squaring the eigenvector matrix from the PCA Stats file. 

To compute the band weightings in Classic ENVI, follow these steps:

  1. Using Basic Tools -> Statistics -> View Statistics File select the PCA statistics file. In the View Statistics File dialog, check the Covariance Statistics and Covariance Image boxes.

  2. Click OK to read the eigenvector matrix into ENVI as an image. The eigenvector matrix in the stats file contains the individual eigenvectors in its columns, however the eigenvector image contains the eigenvectors in its rows.

  3. Using Basic Tools -> Band Math enter the expression:


      (b1^2)*100

    Map the b1 variable to the eigenvector image.

  4. When the Band Math result appears in the Available Bands List, display it into an image window. From the image display's Functions menu choose Profiles -> X Profile.

Clicking and dragging your cursor in the X Profile window will display the data values at the bottom left margin of the plot. The x-axis values in the plot represent the original input image band numbers and the y-axis values represent the percent contribution to the PCA band. The PCA Band number is equal to the row number of the image from which the X Profile was extracted. 

For example, the figure below the shows the Zoom window display for a 6 band eigenvalue image that has been adjusted using the Band Math expression in step 3. An X Profile has been extracted for the second row of this image, corresponding to the 2nd PC Band. A cursor query in the plot window shows that Band 3 of the original image contributed 7.59% to PC 2.
Using the X Profile


 

    Reviewed 10/15/14 by PS, kk