# Robust Nonlinear Partial Least Squares Regression Using the BACON Algorithm

Authors: Abdelmounaim Kerkri; Jelloul Allal; Zoubir Zarrouk
Journal: Journal of Applied Mathematics
 (2018)

---

## Abstract

Partial least squares regression (PLS regression) is used as an alternative for ordinary least squares regression in the presence of multicollinearity. This occurrence is common in chemical engineering problems. In addition to the linear form of PLS, there are other versions that are based on a nonlinear approach, such as the quadratic PLS (QPLS2). The difference between QPLS2 and the regular PLS algorithm is the use of quadratic regression instead of OLS regression in the calculations of latent variables. In this paper we propose a robust version of QPLS2 to overcome sensitivity to outliers using the Blocked Adaptive Computationally Efficient Outlier Nominators (BACON) algorithm. Our hybrid method is tested on both real and simulated data.


---

## Body

## 1. Introduction

After it was developed by Wold [1], PLS regression became a classic way to overcome correlation in regression analysis; this method is popular in many fields such as genomics and chemometrics. Many statisticians showed interest in the mathematical properties of the method; De Jong [2] proved that the PLS estimator is a regularized version of the ordinary least squares estimator. The same result was later demonstrated algebraically by Goutis et al. [3]. With the arising of data that show nonlinear behavior in many fields, it was necessary to have a new version of PLS regression that captures the nonlinearity and provides more parsimonious models. Wold [4] developed the first nonlinear version of the PLS algorithm by substituting OLS with a quadratic regression to calculate the PLS components. Wold [5] also proposed the spline PLS algorithm. Another nonlinear algorithm based on neural networks to deal with the nonlinearity of meteorological data was proposed [6].PLS regression is sensitive to outliers and leverages. Thus several robust versions have been proposed in the literature, but only for linear PLS. Hubert [7] proposed two robust versions of the SIMPLS algorithm by using a robust estimation for the variance-covariance matrix. Kondylis and Hadi [8] used the BACON algorithm to eliminate outliers, resulting in a robust linear PLS.In this work we attempt to obtain a robust version of the quadratic PLS algorithm QPLS2, by using the BACON algorithm. An application on real and simulated data is used to validate the method.


## 2. Nonlinear PLS Regression

Every linear regression method is based on the following optimization problem:(1)min⁡Xβ-Yβ,where X∈Rn×m is a matrix presenting the values of the independent variables, Y∈Rn is the dependent variable, and β is the coefficient of the regression.Instead of regular predictors, PLS regression uses a set of latent variables called scores:tk=Xkωk (with Xk the deflated version of the initial matrix X). The latent variables (also called the PLS components) are iteratively calculated, based on the decomposition:(2)X=t1p′1+⋯+tmp′m+E,where E is the error, pk is a set of vectors called the loadings, and ωk a weight vector of length k. As mentioned in the introduction, owing to the encounter of data that showed nonlinear behavior, many researchers proposed new PLS algorithms to capture the nonlinearity of these datasets. In this work we use the quadratic nonlinear PLS as proposed by Wold [4].The quadratic nonlinear PLS is a PLS algorithm that supposes the existence of nonlinear relations between the two blocks of variables. Instead of the OLS regression presented in the linear PLS algorithm(3)u=c1+c2t,Wold et al. [4] used a quadratic regression:(4)u=c1+c2t+c3t2.Every regression method performs poorly in the presence of outliers. As a result of the instability of the estimations, many approaches have been developed to overcome this problem, such as filtering the outliers from the dataset, or giving them lower weights to minimize their effect on the estimation process. The next section will focus on the BACON algorithm, as an approach that deletes the outliers to obtain a clean dataset.


## 3. Robust PLS Regression

### 3.1. Outliers Detection and Robust Regression

Robust regression is a way of dealing with outliers, which are observations that come from a different distribution. They can also be the result of error measurements, and can harm the quality of the estimation. Just like OLS regression, PLS regression is also sensitive to outliers [8]. Hence their detection is a necessary procedure, in order to have stable estimations, and accurate predictions.Many researchers proposed methods of dealing with the outlier problem in PLS regression. Hubert [7] used two robust estimations of the variance-covariance matrix in the SIMPLS algorithm, and Kondylis and Hadi [8] used the BACON algorithm for outlier detection. Both approaches proved to be a significant improvement over the regular PLS.The BACON algorithm [9] starts with a subset of observations of size m∗ that is supposedly free of outliers, and then it iteratively adds the observations that are consistent with the initial set. The observations left out are the outliers.The first set is chosen. Then the distance is defined and used as a criterion for including the observation in the initial subset. Here are two distances used in the literature(5)diS=x′iS-1xiand(6)dixi,m=xi-mS is the variance-covariance matrix of the entire data set, xi represents the i observation, the first distance is called the Mahanalobis distance, and the second is simply the distance of the observation from the median m. Here are the detailed steps of the algorithm:(1)
Select an initial setXb(2)
Compute the distances (x-b is the mean of Xb, and Sb is the matrix of covariance of Xb):(7)dix-b,Sb=xi-x-b′Sb-1xi-x-b,i=1,…,n(3)
Set the new subset with all the points that have(8)dix-b,Sb<Cnpr×χp,α/nwhereχp,α/n is the (1-α) Chi-square percentile and(9)Cnpr=Cnp+ChrCnp=1+p+1n-p+2n-1-3pChr=max⁡0,h-rh+r,h=n+1+p2(4)
Repeat (2) and (3) until the subset does not change.(5)
Xb is the dataset free from outliers.


### 3.2. Robust Nonlinear PLS

We merge the BACON algorithm with the quadratic PLS, with the goal of obtaining a robust version of the algorithm:(1)
Run the BACON algorithm on the dataset using distance (6), and keep the outcome Xb. Then delete the observations in the dependent variable related to the outliers to obtain Yb (free from outliers).(2)
For every PLS dimension, repeat until convergence oft (u is a the first column of Yb)
(i)
Calculate the weights:(10)w=u′Xbu′u.(ii)
Calculate the scores:(11)t=Xbww′w.(iii)
Fitu to c using the quadratic function and calculate r the prediction of u using the nonlinear estimates:(12)u=c1+c2t+c3t2.(iv)
Calculate(13)q=Y′brr′r.(v)
Updateu:(14)u=Ybqq′q.(vi)
Updatew as described in (i).(vii)
Calculate the new value of t:(15)t=Xbww′w.(3)
Calculate the loadings using the final value of t:(16)p′=t′Xbt′t.(4)
DeflateXb and Yb:(17)E=Xb-tp′F=Yb-rq′.(5)
If an additional dimension is required, replaceXb and Yb with E and F and repeat the steps from (2) to (4).


## 3.1. Outliers Detection and Robust Regression

Robust regression is a way of dealing with outliers, which are observations that come from a different distribution. They can also be the result of error measurements, and can harm the quality of the estimation. Just like OLS regression, PLS regression is also sensitive to outliers [8]. Hence their detection is a necessary procedure, in order to have stable estimations, and accurate predictions.Many researchers proposed methods of dealing with the outlier problem in PLS regression. Hubert [7] used two robust estimations of the variance-covariance matrix in the SIMPLS algorithm, and Kondylis and Hadi [8] used the BACON algorithm for outlier detection. Both approaches proved to be a significant improvement over the regular PLS.The BACON algorithm [9] starts with a subset of observations of size m∗ that is supposedly free of outliers, and then it iteratively adds the observations that are consistent with the initial set. The observations left out are the outliers.The first set is chosen. Then the distance is defined and used as a criterion for including the observation in the initial subset. Here are two distances used in the literature(5)diS=x′iS-1xiand(6)dixi,m=xi-mS is the variance-covariance matrix of the entire data set, xi represents the i observation, the first distance is called the Mahanalobis distance, and the second is simply the distance of the observation from the median m. Here are the detailed steps of the algorithm:(1)
Select an initial setXb(2)
Compute the distances (x-b is the mean of Xb, and Sb is the matrix of covariance of Xb):(7)dix-b,Sb=xi-x-b′Sb-1xi-x-b,i=1,…,n(3)
Set the new subset with all the points that have(8)dix-b,Sb<Cnpr×χp,α/nwhereχp,α/n is the (1-α) Chi-square percentile and(9)Cnpr=Cnp+ChrCnp=1+p+1n-p+2n-1-3pChr=max⁡0,h-rh+r,h=n+1+p2(4)
Repeat (2) and (3) until the subset does not change.(5)
Xb is the dataset free from outliers.


## 3.2. Robust Nonlinear PLS

We merge the BACON algorithm with the quadratic PLS, with the goal of obtaining a robust version of the algorithm:(1)
Run the BACON algorithm on the dataset using distance (6), and keep the outcome Xb. Then delete the observations in the dependent variable related to the outliers to obtain Yb (free from outliers).(2)
For every PLS dimension, repeat until convergence oft (u is a the first column of Yb)
(i)
Calculate the weights:(10)w=u′Xbu′u.(ii)
Calculate the scores:(11)t=Xbww′w.(iii)
Fitu to c using the quadratic function and calculate r the prediction of u using the nonlinear estimates:(12)u=c1+c2t+c3t2.(iv)
Calculate(13)q=Y′brr′r.(v)
Updateu:(14)u=Ybqq′q.(vi)
Updatew as described in (i).(vii)
Calculate the new value of t:(15)t=Xbww′w.(3)
Calculate the loadings using the final value of t:(16)p′=t′Xbt′t.(4)
DeflateXb and Yb:(17)E=Xb-tp′F=Yb-rq′.(5)
If an additional dimension is required, replaceXb and Yb with E and F and repeat the steps from (2) to (4).


## 4. Application

The goal of this application is to compare the performance of the robust quadratic PLS with the original quadratic PLS. The comparison is conducted on both simulated and real data.


### 4.1. Real Data

We use the dataset presented in [4], which contains 8 different formulations of cosmetic products, as predictive variables, and 11 dependent variables presenting quality indicators collected in an experiment on 17 individuals.Since we cannot calculate the mean squared error, we will compare the percentage of explained variance in both the robust and original quadratic PLS:(18)var⁡Y,th=1p∗∑i=1p∗corYi,th2and(19)var⁡X,th=1p∑i=1pcorXi,th2th is the latent component of the hth PLS iteration, p∗ is the number of dependent variables, and p is the number of predictive variables.In Table1, a comparison of the original and robust quadratic PLS shows that the latter improves the explained variance in the dependent variables from 68% to 91%, which is a considerable amount. This is an indicator that the dataset contained outliers that affected the estimation in the case of the original quadratic PLS.Table 1
Comparison between explained variance of proposed robust quadratic PLS and original quadratic PLS in cosmetic dataset.
t 1 t 1 t 1 t 1 t 1 t 1 t 1 t 1 Cumulated variance X a 0.286 0.196 0.129 0.139 0.05 0.11 0.08 0.003 0.99 X b 0.277 0.239 0.155 0.177 0.051 0.093 0.004 0 0.99 Y a 0.180 0.077 0.137 0.134 0.042 0.04 0.065 0.03 0.68 Y b 0.33 0.181 0.103 0.117 0.06 0.037 0.0.32 0.05 0.91


### 4.2. Simulated Data

In this section, a contamination study is used to assess the quality of the proposed robust method, by following these steps:(1)
The nonlinear function presented in [10] which is used to generate a dataset with 500 observations and 6 variables (where X=(x1,…,x6) is generated by a uniform distribution):(20)y=10sin⁡πx1x2+20x3-52+10x4+5x5+0x6.(2)
The dataset is randomly contaminated by adding a small percentage of data (5%, 10%, and 15%) from a multivariate normal distribution.(3)
We first apply the quadratic PLS to the generated data, and then we apply the robust quadratic PLS described previously.(4)
We compare the original quadratic PLS with the proposed robust PLS using the explained variance, as well as the predictive mean squared error and the predicted residual error sum of squares (PRESS).The dataset is simulated 1000 times. The explained variance, predictive mean squared error, and PRESS are the mean of all values calculated for each dataset.In case of a 5% contamination rate (Table2), the original quadratic PLS yields a total explained variance of 73%, but when applying the robust quadratic PLS, this explained variance becomes 99% which is a considerable improvement. The same can be said about the 10% and 15% contamination rates, where we see an improvement in the explained variance of the dependent variable.Table 2
Comparison between explained variance of proposed quadratic algorithm and original one in simulated dataset for the three contamination rates (5%, 10%, and 15%).
Contamination rate Explained variance by original quadratic PLS Explained variance by robust quadratic PLS X Y X Y 5% 0.99 0.73 1 0.99 10% 1 0.68 1 0.99 15% 1 0.67 1 0.99The dataset of 500 observations was then split in two parts. The first contained 400 observations used in the estimation of two models: one with the original quadratic PLS and one with the robust quadratic PLS. Then we calculate the predictive residual mean squared error (RMSEP) of the dependent variable on the 100 left out observations.The results of a comparison (Table3) of the three contamination rates show that the robust quadratic PLS yields a smaller mean squared prediction error in every case. The same table presents the values of the PRESS for each rate, calculated by leaving 10% of the observations. The same can be said about the predictive error sum of squares as it is improved in the case of the robust quadratic PLS.Table 3
Comparison between optimal mean squared prediction error and predictive error sum of squares of proposed quadratic algorithm and original one for simulated dataset with three contamination rates (5%, 10%, and 15%).
Contamination rate Mean squared prediction error (MSPE) Predictive error sum of squares (PRESS) Quadratic PLS Robust quadratic PLS Quadratic PLS Robust quadratic PLS 5% 103.07 12.83 100.9 89 10% 110.42 60.9 108.75 17.15 15% 119.08 4.32 117.37 17.15Figures1, 2, and 3 show a comparison of the predicted values and the actual values of the simulated dataset, for both quadratic and robust quadratic PLS regression. For all contamination rates the prediction is improved significantly in the case of the proposed robust quadratic PLS, as it gives better predictions than the original one.Figure 1
Comparison of predicted and actual values of test dataset in case of quadratic and robust quadratic PLS regression on 5% contaminated data.Figure 2
Comparison of predicted and actual values of test dataset in case of quadratic and robust quadratic PLS regression on 10% contaminated data.Figure 3
Comparison of predicted and actual values on test dataset in case of quadratic and robust quadratic PLS regression on 15% contaminated data.


## 4.1. Real Data

We use the dataset presented in [4], which contains 8 different formulations of cosmetic products, as predictive variables, and 11 dependent variables presenting quality indicators collected in an experiment on 17 individuals.Since we cannot calculate the mean squared error, we will compare the percentage of explained variance in both the robust and original quadratic PLS:(18)var⁡Y,th=1p∗∑i=1p∗corYi,th2and(19)var⁡X,th=1p∑i=1pcorXi,th2th is the latent component of the hth PLS iteration, p∗ is the number of dependent variables, and p is the number of predictive variables.In Table1, a comparison of the original and robust quadratic PLS shows that the latter improves the explained variance in the dependent variables from 68% to 91%, which is a considerable amount. This is an indicator that the dataset contained outliers that affected the estimation in the case of the original quadratic PLS.Table 1
Comparison between explained variance of proposed robust quadratic PLS and original quadratic PLS in cosmetic dataset.
t 1 t 1 t 1 t 1 t 1 t 1 t 1 t 1 Cumulated variance X a 0.286 0.196 0.129 0.139 0.05 0.11 0.08 0.003 0.99 X b 0.277 0.239 0.155 0.177 0.051 0.093 0.004 0 0.99 Y a 0.180 0.077 0.137 0.134 0.042 0.04 0.065 0.03 0.68 Y b 0.33 0.181 0.103 0.117 0.06 0.037 0.0.32 0.05 0.91


## 4.2. Simulated Data

In this section, a contamination study is used to assess the quality of the proposed robust method, by following these steps:(1)
The nonlinear function presented in [10] which is used to generate a dataset with 500 observations and 6 variables (where X=(x1,…,x6) is generated by a uniform distribution):(20)y=10sin⁡πx1x2+20x3-52+10x4+5x5+0x6.(2)
The dataset is randomly contaminated by adding a small percentage of data (5%, 10%, and 15%) from a multivariate normal distribution.(3)
We first apply the quadratic PLS to the generated data, and then we apply the robust quadratic PLS described previously.(4)
We compare the original quadratic PLS with the proposed robust PLS using the explained variance, as well as the predictive mean squared error and the predicted residual error sum of squares (PRESS).The dataset is simulated 1000 times. The explained variance, predictive mean squared error, and PRESS are the mean of all values calculated for each dataset.In case of a 5% contamination rate (Table2), the original quadratic PLS yields a total explained variance of 73%, but when applying the robust quadratic PLS, this explained variance becomes 99% which is a considerable improvement. The same can be said about the 10% and 15% contamination rates, where we see an improvement in the explained variance of the dependent variable.Table 2
Comparison between explained variance of proposed quadratic algorithm and original one in simulated dataset for the three contamination rates (5%, 10%, and 15%).
Contamination rate Explained variance by original quadratic PLS Explained variance by robust quadratic PLS X Y X Y 5% 0.99 0.73 1 0.99 10% 1 0.68 1 0.99 15% 1 0.67 1 0.99The dataset of 500 observations was then split in two parts. The first contained 400 observations used in the estimation of two models: one with the original quadratic PLS and one with the robust quadratic PLS. Then we calculate the predictive residual mean squared error (RMSEP) of the dependent variable on the 100 left out observations.The results of a comparison (Table3) of the three contamination rates show that the robust quadratic PLS yields a smaller mean squared prediction error in every case. The same table presents the values of the PRESS for each rate, calculated by leaving 10% of the observations. The same can be said about the predictive error sum of squares as it is improved in the case of the robust quadratic PLS.Table 3
Comparison between optimal mean squared prediction error and predictive error sum of squares of proposed quadratic algorithm and original one for simulated dataset with three contamination rates (5%, 10%, and 15%).
Contamination rate Mean squared prediction error (MSPE) Predictive error sum of squares (PRESS) Quadratic PLS Robust quadratic PLS Quadratic PLS Robust quadratic PLS 5% 103.07 12.83 100.9 89 10% 110.42 60.9 108.75 17.15 15% 119.08 4.32 117.37 17.15Figures1, 2, and 3 show a comparison of the predicted values and the actual values of the simulated dataset, for both quadratic and robust quadratic PLS regression. For all contamination rates the prediction is improved significantly in the case of the proposed robust quadratic PLS, as it gives better predictions than the original one.Figure 1
Comparison of predicted and actual values of test dataset in case of quadratic and robust quadratic PLS regression on 5% contaminated data.Figure 2
Comparison of predicted and actual values of test dataset in case of quadratic and robust quadratic PLS regression on 10% contaminated data.Figure 3
Comparison of predicted and actual values on test dataset in case of quadratic and robust quadratic PLS regression on 15% contaminated data.


## 5. Conclusion

PLS regression has developed considerably since it was first introduced. The nonlinear nature of data encountered in the field of chemical engineering was the motivation behind developing nonlinear PLS methods. In this paper we proposed a robust version of the quadratic nonlinear PLS, in a hybrid form between the quadratic PLS algorithm and the BACON algorithm in order to overcome problems caused by outliers. Our method outperformed the quadratic PLS for both real and simulated data.



---

*Source: 7696302-2018-10-02.xml*