Using PCA for variable reduction

Click For Summary

Discussion Overview

The discussion revolves around the application of Principal Component Analysis (PCA) for variable reduction in the context of differentiating two substances based on spectral data. Participants explore methods for identifying clusters of variables and selecting a subset of wavelengths from a large dataset of 1350 variables.

Discussion Character

  • Exploratory, Technical explanation, Debate/contested, Mathematical reasoning

Main Points Raised

  • One participant references Jolliffe's method for variable reduction, suggesting that PCA can identify clusters among variables and proposing to retain one variable from each cluster.
  • Another participant questions the interpretation of "the variables" in Jolliffe's text, suggesting it could refer to either raw data variables or coefficients of principal components.
  • A participant notes that the differentiation between species has been achieved using PCA, representing spectra with two variables (PC1 and PC2), but seeks to reduce the number of variables further.
  • There is a suggestion to select wavelengths with the largest loadings in PC2, specifically around 550nm and 700nm, based on observed differences in reflectance between the red and blue spectra.
  • Concerns are raised about using wavelengths with negative loadings in PC2, questioning how to treat these regions when selecting variables for differentiation.
  • A later reply suggests using variables with the greatest absolute value of loadings, indicating these have the most significant effect on PC2.

Areas of Agreement / Disagreement

Participants express varying interpretations of Jolliffe's method and the implications of PCA results. There is no consensus on how to handle negative loadings or the best approach to select variables, indicating ongoing debate and exploration of the topic.

Contextual Notes

Participants note the lack of clear examples in the literature for implementing Jolliffe's technique, highlighting the need for practical guidance in visualizing clusters of variables.

roam
Messages
1,265
Reaction score
12
In the textbook “Principal Component Analysis” Jolliffe (§9.2) suggests the following method for variable reduction:

When the variables fall into well-defined clusters, there will be one high-variance PC and, except in the case of 'single-variable' clusters, one or more low-variance PCs associated with each cluster of variables. Thus, PCA will identify the presence of clusters among the variables, and can be thought of as a competitor to standard cluster analysis of variables. [...] Identifying clusters of variables may be of general interest in investigating the structure of a data set but, more specifically, if we wish to reduce the number of variables without sacrificing too much information, then we could retain one variable from each cluster.”

I am trying to apply this idea of variable reduction to a problem which involves differentiating two substances based on their spectra which is composed of 1350 variables (i.e. wavelengths):

apmXOkU.png


And here is the resulting differentiation between the species:

DDQEa6r.jpg


I want to be able to perform the same differentiation, but using fewer variables. Unfortunately, the textbook does not give any examples of how to do this. The aim is to divide variables, rather than observations, into groups. So, how should we plot the variables in order to see the clusters? :confused:

For instance, I have tried to plot the loadings at each variable with respect to the first two PCs and obtained:

cvbtkkS.png


In this plot there doesn't seem to be any well-defined clusters to choose variables from. Am I following Jolliffe's method correctly?

Any explanation would be greatly appreciated.

P.S. Plotting the actual PCs give the following (the ordinate should represent the correlation coefficients between a given variable and the PC):

ooZZM91.png
 

Attachments

  • apmXOkU.png
    apmXOkU.png
    8.7 KB · Views: 724
  • DDQEa6r.jpg
    DDQEa6r.jpg
    16.5 KB · Views: 674
  • cvbtkkS.png
    cvbtkkS.png
    6.2 KB · Views: 702
  • ooZZM91.png
    ooZZM91.png
    23.9 KB · Views: 682
  • Like
Likes   Reactions: Klystron
Physics news on Phys.org
roam said:
In the textbook “Principal Component Analysis” Jolliffe (§9.2) suggests the following method for variable reduction:

When the variables fall into well-defined clusters, there will be one high-variance PC and, except in the case of 'single-variable' clusters, one or more low-variance PCs associated with each cluster of variables.

It's unclear to me what the quoted passage means by "the variables". On the one hand, "the variables" might mean the variables in the raw data. On other hand "the variables" might be the coefficients for the principal components that are associated with a leaf.

A principal component is a vector and it is a constant vector. So the terminology "high variance PC" is imprecise. I interpret it to mean that the coefficient associated with that vector (considered as a random variable varying over the population of items in the data) has high variance.
 
  • Like
Likes   Reactions: Klystron
roam said:
And here is the resulting differentiation between the species:

ddqea6r-jpg.jpg

In the graph above, it seems you have already achieved variable reduction. Instead of each spectra being represented by a vector with 1350 observations, the above plot represents each spectra with just two variables (PC1 and PC2). Furthermore, the difference between the red and blue spectra seems to along PC2, with high values of PC2 associated with your red spectra and low values of PC2 associated with the blue spectra.
 

Attachments

  • ddqea6r-jpg.jpg
    ddqea6r-jpg.jpg
    16.5 KB · Views: 555
Stephen Tashi said:
It's unclear to me what the quoted passage means by "the variables". On the one hand, "the variables" might mean the variables in the raw data. On other hand "the variables" might be the coefficients for the principal components that are associated with a leaf.

It is referring to the variables in the raw data.

Here is a paper by the same author that also mentions this "cluster criterion" technique for selecting a subset of the original variables in the raw data. But the problem is that they don't give a clear worked example, so I am not sure how to plot the data to see clusters in the variables.

Are they suggesting making a dendrogram based on some kind of cluster analysis of the variables? :confused:

Ygggdrasil said:
In the graph above, it seems you have already achieved variable reduction. Instead of each spectra being represented by a vector with 1350 observations, the above plot represents each spectra with just two variables (PC1 and PC2). Furthermore, the difference between the red and blue spectra seems to along PC2, with high values of PC2 associated with your red spectra and low values of PC2 associated with the blue spectra.

Hi Ygggdrasil,

This is true. But I have used all 1350 variables (i.e., wavelengths) to conduct PCA and differentiate the species. And in my application, 1350 variables are too many. So I want to select a subset of these variables/wavelengths to retain. The technique suggested above by Jolliffe is meant to be a criterion for selecting the best subset of variables. Unfortunately, I couldn't find a guide on how to implement this technique.
 
Last edited:
roam said:
This is true. But I have used all 1350 variables (i.e., wavelengths) to conduct PCA and differentiate the species. And in my application, 1350 variables are too many. So I want to select a subset of these variables/wavelengths to retain. The technique suggested above by Jolliffe is meant to be a criterion for selecting the best subset of variables. Unfortunately, I couldn't find a guide on how to implement this technique.

In this case, I'd select the wavelengths with the largest loading in PC2 (which would be the wavelengths around 550nm and 700nm). Looking at the spectra, it does seem to be the case that the red spectra tend to have higher reflectance at those wavelengths than the blue spectra.
 
  • Like
Likes   Reactions: roam
Ygggdrasil said:
In this case, I'd select the wavelengths with the largest loading in PC2 (which would be the wavelengths around 550nm and 700nm). Looking at the spectra, it does seem to be the case that the red spectra tend to have higher reflectance at those wavelengths than the blue spectra.

So, what if the separation is mainly in terms of PC2, but some of the peak regions of that PC curve have negative values? Would you use wavelengths that have negative loadings? :confused:

For instance, in the above, the PCA was done with the covariance matrix of the variables. If I recompute the PCA using the correlation matrix, the separation is still in terms of PC2, but I get totally different values for the loadings. Some of the peaks of PC2 will have negative values. How should we treat these regions?
 
roam said:
So, what if the separation is mainly in terms of PC2, but some of the peak regions of that PC curve have negative values? Would you use wavelengths that have negative loadings? :confused:

For instance, in the above, the PCA was done with the covariance matrix of the variables. If I recompute the PCA using the correlation matrix, the separation is still in terms of PC2, but I get totally different values for the loadings. Some of the peaks of PC2 will have negative values. How should we treat these regions?
Good point. You would use the variables where the absolute value of the loadings are greatest, as these variables have the greatest effect on the value of PC2.
 
  • Like
Likes   Reactions: roam

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 27 ·
Replies
27
Views
4K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K