## 2 Materials and Methods
### Data Processing and Modeling Methods  
#### 2.4.1 Problem Formulation  
PLS combines the advantages of principal component analysis, canonical correlation analysis and linear regression analysis, and is a widely used modeling method in spectral analysis. In order to study the statistical relationship between the dependent variable \(X=\left\{x_{1},\cdots x_{p}\right\}\) and the independent variable \(Y=\left\{y_{1},\cdots,y_{p}\right\}\), \(n\) sample points were observed and the sample tables \(X\) and \(Y\) are formed. PLS extracted components \(x\) and \(y\) from \(X\) and \(Y\) respectively. When extracting \(x\) and \(y\), the following two requirements should be satisfied:  
(1) \(x\) and \(y\) should carry as much change information as possible in their respective data sheets; (2) The correlation between \(x\) and \(y\) reach the maximum.  
Two requirements indicate that \(x\) and \(y\) should represent the table of \(X\) and \(Y\). The independent variable \(x\) has the strongest explanatory power to the dependent variable \(y\). From the collected spectra  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Sample Set** & **Samples** & **Mean (mg/L)** & **Minimum (mg/L)** & **Maximum (mg/L)** \\ \hline Calibration set & 24 & 15.75 & 1 & 32 \\ \hline Validation set & 8 & 18.75 & 3 & 31 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Statistical results of COD value by SPXY.  
(Figure 2), it can be found that the original spectra reflect comprehensive information about sample concentration. Therefore, the sampled spectral data can be used to predict the COD concentration of the solution. Researchers usually use absorbances at characteristic wavelengths as an independent variable to predict COD concentration. But the problem of characteristic wavelengths selection is difficult to solve. In order to solve this problem, the permutation entropy (PE) is used to determine the characteristic wavelengths which are used to get extreme points. The extreme points are used as independent variables of PLS to predict COD concentration.  
PE can process the original spectral data and get extreme points of the original spectrum. It can be obtained that there are three extreme points \(\gamma_{i}(i=1,2,3)\) in the spectral data of different concentrations in Figure 2. However, when PLS uses \(\gamma_{i}(i=1,2,3)\) to predict COD concentration, the accuracy is not satisfied because the independent variable parameters are not enough.  
PE can find more extremum points for each concentration by processing the first derivative data of the original spectrum. The first derivative spectrum of the original spectrum is shown in Figure 4. It can be seen from Figure 4 that there are five extreme points \(\alpha_{i}(i=1,2,3,4,5)\) in the first derivative data of different concentrations, which represent the extreme values of the absorption spectrum change rate under different concentrations. \(\lambda_{i}(i=1,2,3,4,5)\) is defined as the wavelength of \(\alpha_{i}(i=1,2,3,4,5)\). PE can accurately search \(\lambda_{i}(i=1,2,3,4,5)\) which can be used to get \(\alpha_{i}(i=1,2,3,4,5)\). PLS uses \(\alpha_{i}(i=1,2,3,4,5)\) to predict COD concentration, which improves the prediction accuracy. The comparison of the results of predicting COD by \(\gamma_{i}(i=1,2,3)\) and \(\alpha_{i}(i=1,2,3,4,5)\) will be introduced in Section 3.1.3. In this paper, the extreme values of the absorption spectrum change rate were proposed as a characteristic parameter to establish the COD prediction model.