# Mean centering or not in the context of Partial Least Squares

In my current project, I'm using PLS regression on infrared spectra (FTIR). For this I'm using R and the pls function from the plsr package. pls always mean centers both the input data and the infrared spectra. When predicting using a fitted PLS model, the means fitted during the estimation process will be subtracted from the data.

In one particular situation this is not a desirable effect for me, as the mean for each of the IR wavenumbers is not constant between measurements. This is caused by the fact that the path length of the beam which goes through the sample can change, either because a particular machine has a different path length than the machine used for fitting the model, or because the path length slowly changes over time because of wear and tear in the measuring cell.

By not mean centering the data, the means end up the first PLS factor. This allows a linear scaling of the mean, taking into account linear effects such as the cell path length. This makes the model more robust in particular situations. I am aware that we could correct the IR spectra first, and then use the fitted means. But, we would like to put this inside the fitted model.

I sent an e-mail to the maintainer of the PLSR package about why the package did not support switching off mean centering. The reply was:

No, that is not possible. Theoretically, if one does not center, it is not PLSR.

Other tools used in the field of spectroscopy (Grams, Unscrambler) do allow switching off mean centering. And in the situation above I feel that disabling mean centering has a big advantage.

Now for my concrete question:

Is PLS without mean centering still PLS, are there any theoretical or practical reasons not to do this?

There are mainly two algorithms for PLSR namely NIPALS and SIMPLS.

SIMPLS algorithm is generally faster yet numerically less stable(in most cases the difference is very small). The original article of SIMPLS provides the steps which starts with mean centering both X and Y. The maintainer of the package probably relies on these steps. However, directly quoting from the article:

With NIPALS algorithm, in this very essential article the authors mentions the mean centering is done by default to make the calculations easier and provided no other specific information.

Lastly, there is this article which directly questions the reasoning behind mean centering and provides some case studies. The authors stated exactly what you have observed. In some cases mean-centering can even decrease the predictive ability of the model. While it allows easy calculation of intercept term, I believe it is safe to omit centering.

Since all algorithms basically carries out eigenvalue decomposition of covariance matrices that involves distance of variables from their means, it is still called PLS without mean-centering. However, that requires alteration of your code.

The options in the softwares you have mentioned may allow you to skip centering but these options may be available for the data that is already centered. In other words they might be still using

X' * Y


(X - mean(x))' * (Y - mean(Y))


for the calculation of covariance matrix, for instance.

The articles:

SIMPLS: De Jong, Sijmen. "SIMPLS: an alternative approach to partial least squares regression." Chemometrics and intelligent laboratory systems 18, no. 3 (1993): 251-263. Harvard

PLS tutorial with NIPALS: Geladi, Paul, and Bruce R. Kowalski. "Partial least-squares regression: a tutorial." Analytica chimica acta 185 (1986): 1-17.

Mean-centering in PLS: Seasholtz, Mary Beth, and Bruce R. Kowalski. "The effect of mean centering on prediction in multivariate calibration." Journal of Chemometrics 6, no. 2 (1992): 103-111. Harvard

• Link is fixed. I have also mentioned about a risk of disabling the centering in the mentioned softwares that they might assume the data is already centered. – theGD Jan 23 '17 at 10:32
• (+1) In particular the last link seems very relevant. In general it's better to provide a proper citation and not just a link because (i) links might break in the future and (ii) having paper title and authors right in your answer can help future searches. – amoeba says Reinstate Monica Jan 23 '17 at 10:39
• Thanks ever so much. I had done some research online and via google scholar, but this article had not shown up. Right now I have a slightly hacked version of the plsr package which includes the option to disable mean centering. Maybe with this extra feedback in hand I can persuade the author to include the option to disable mean centering. – Paul Hiemstra Jan 23 '17 at 10:43
• @PaulHiemstra Please be cautios about how the algorithm is "hacked" and how it behaves in calculation of covariance matrices and other parts of the algorithm involving the distance from mean. – theGD Jan 23 '17 at 10:48
• @theGD thanks for the warning. We are comparing our results to that of another tool which already supports disabling mean centering. For now the results are the same and the hack looks stable. – Paul Hiemstra Jan 23 '17 at 10:50