https://www.euro-online.org/enog/inoc2007/Papers/mac-slots.html https://www.euro-online.org/enog/inoc2007/Papers/m https://www.euro-online.org/enog/inoc2007/Papers/mac-slots.html

IASIM 2018 Advertisement

To mean center or not

ianm's picture
Forums: 

10. To mean center or not.

This series was started with one question, with one in reserve; waiting until there were responses to the first question. The first question given below is followed by two responses. The second question follows the two responses. This question has to do with mean-centering. The process of mean-centering is to calculate the average spectrum of the data set and subtract that average from each spectrum. Then, regression begins. I can see that in PCR (one of the regressions in PCRA), the first, and probably other, eigenvectors will be also centered around zero, due to the mean-centering of the spectra. But I am not so sure about the first eigenvector in PLS. Will it always be centered around zero? Some of my thoughts are a material may have a large, but non-contributing, band that will change the mean-centered spectra, but the band(s) due to the constituent of interest may vary much less, and thus the eigenvector could be displaced from zero by the non- contributing constituent. Am I wrong? From: Ola Berntsson [email protected]

Bruce,

I'm not sure if I understood the question correctly but here is my answer: You're right about the eigenvectors not being centered. In fact, none of them are.

In a PCA (where X=T*P'), the loading vectors (P) are orthogonal [p1'*p2=0 etc] and normalized [sum(P'*P)=1]. The scores (T) are also orthogonal but they are not normalized. In PLS or PCA, NO mean centering takes place, neither of the scores or of the loading vectors. The mean of a loading or score vector is hardly ever exactly zero. Still, the scores look pretty centered to the eye when the data has been centered.

Regards

/Ola

_________________________________________________________________

Ola Berntsson

Analytical Chemistry

KTH - Royal Institute of Technology

SE-100 44 Stockholm, Sweden

Phone: +46 8 790 8216

Fax: +46 8 10 84 25

http://omega.physchem.kth.se/~olab/home.htm

_________________________________________________________________

From: Howard Mark [email protected]

Subject: Re: Mean centering

Bruce - mean-centering is not an arbitrary operation, and its effects are rooted in the some of the fundamental properties of the way data behave.

In the first place, when you do least-square fittings of any kind, you have to be aware of the fact that the mean is itself a least-square estimator. The proof of this is on pages 33-34 of Statistics in Spectroscopy. Thus, if you didn't subtract the mean initially from your spectral data, then unless the data were pathological the first factor you calculated would be the mean, anyway, or very close to it (if other sources of variation were correlated with the mean value then they might distort it somewhat.) So that is not accidental.

Furthermore, in PCA all other factors have to be orthogonal to the first factor - they also have to be orthogonal to each other, but that's immaterial to the current question). Ordinarily, spectra are always positive, so the mean will also be positive at all wavelengths. Thus, all other factors have to make equal and opposite (in sign) contributions after multiplication by the first. This is equivalent to a weighted average, and that weighted average must be zero (the average can be zero if and only if the sum is zero, and vice versa). However, that doesn't mean that the UNweighted sum must be zero, and in fact are not, in the general case - you can check this out the same way I did, by reading a set of PCA factors into EXCEL and use the sum() function to sum over the values in each factor. Contrary to your intuition, the factors themselves need not (and in fact don't) sum to zero, therefore they are not themselves mean-centered.

When you use them to do regression, on the other hand, mean-centering is often applied as a first step, but this is also true for regression in general, not just when using PC factors. The reason is to reduce the number of significant bits in the data, so as to minimize the possibility of intermediate results overflowing the word size of the computer. I once calculated that if the number of bits is equivalent to 12 or 13 decimal digits then it is always enough to do regressions on NIR data, so a program written using double precision will not have a problem, although one using single-precision may sometimes be affected by this, if the data is too highly intercorrelated.

Now in PLS, both the least-square and orthogonality requirements are relaxed, allowing the factors even more freedom to not be mean-centered.

Howard

Question number two.

Is the act of mean centering, with subsequent PCRA development, similiar to Prof. Kaffka's conversion of spectra into polar coordinates? This question arises because the use of polar coordinates results in clusters that can be used for qualtitative analysis. The clustering is visually very similar to the plotting of the first and second principal components when one has a number of different types of calibration samples.

From: Howard Mark [email protected]

The short answer to your question is: no.

The long answer comes in two parts: the relationship to Kaffka's polar results and the effects of PCA. Kaffka's use of polar coordinates is a nifty way to use the entire spectrum for qualitative analysis without having to go through the complicated manipulations and calculations involved in doing a PCA or PLS analysis. The fact that this presentation of the data is not equivalent to mean-centering can be seen in the very fact that clusters are obtained. If the polar presentation inherently mean-centered the data then all the canters of gravity, that Kaffa uses to define the clusters, would all fall at the origin.

The second part of the long answer is to note that you don't need to do a principal component analysis (or any other, for that matter) in order to get clusters. Clusters arise quite nicely when you plot the data in the original wavelength space, as I showed in my original Mahalanobis Distance paper way back in '85. The only requirements for clustering are that:

1) Similar materials give similar spectra

2) Different materials give different spectra

Everything else is for optimization, convenience, sophistication, hype and having a subject to write a paper about.

Also, comparing the polar presentation to the effect of the mean-centering of the Principal Components is rather moot after both Ola and myself have shown that the Principal Components are not mean-centered in the first place.

Howard