## 2 Basic Principles  
### Principal Component Analysis  
Principal Component Analysis (PCA) is a multivariate statistical method that transforms multiple variables into a smaller set of significant variables through linear transformation. In studies of practical problems, datasets often involve numerous variables that are typically correlated to some extent, leading to overlapping information. PCA projects high-dimensional data onto a lower-dimensional space with minimal information loss, achieving dimensionality reduction and simplifying the data structure. This allows a smaller number of uncorrelated new variables to capture most of the information provided by the original variables, facilitating problem-solving through the analysis of these new variables [30; 31; 32; 33]. Assume there are \(n\) samples, each with \(p\) variables, forming a data matrix:\[X= \begin{bmatrix}x_{11}&x_{12}&\cdots&x_{1p}\\ x_{21}&x_{22}&\cdots&x_{2p}\\ \vdots&\vdots&&\vdots\\ x_{n1}&x_{n2}&\cdots&x_{np}\end{bmatrix}  \tag{5}\]  
The original variable indicators are \(x_{1},x_{2},\cdots,x_{p}\), after dimensionality reduction, the new variables are \(z_{1},z_{2},\cdots,z_{m}(m\geqslant p)\), expressed as  
\[\left. \begin{array}{c}z_{1}=l_{11}x_{1}+l_{12}x_{2}+\cdots+l_{1p}x_{p}\\ z_{2}=l_{21}x_{1}+l_{22}x_{2}+\cdots+l_{2p}x_{p}\\ \vdots\\ z_{m}=l_{m1}x_{1}+l_{m2}x_{2}+\cdots+l_{mp}x_{p}\end{array} \right\} \tag{6}\]  
where the coefficients \(l_{ij}\) are determined based on the following principles: (1) \(z_{i}\) and \(z_{j}\) (\(I\
eq j\), \(i\), \(j=1\), \(2\), \(m\)) are uncorrelated; (2) \(z_{1}\) has the largest variance among all linear combinations of \(x_{1},x_{2},\cdots,x_{p};z_{2}\) has the largest variance among all linear combinations uncorrelated with \(z_{1}\); and \(z_{m}\) has the largest variance among all linear combinations of \(x_{1},x_{2},\cdots,x_{p}\) uncorrelated with \(z_{1},z_{2},\cdots,z_{m-1}\). The new variables \(z_{1},z_{2},\cdots,z_{m}\) are referred to as the first, second, \(\ldots\), and \(m\)th principal components of the original variables. Steps for calculating principal components are as follows:  
(1) Calculate the correlation coefficient matrix (covariance matrix):  
\[R= \begin{bmatrix}r_{11}&r_{12}&\cdots&r_{1p}\\ r_{21}&r_{22}&\cdots&r_{2p}\\ \vdots&\vdots&\vdots&\vdots\\ r_{p1}&r_{p2}&\cdots&r_{pp}\end{bmatrix}  \tag{7}\]  
where \(r_{ij}(i,j=1,2,\cdots,p)\) is the correlation coefficient between the original variables \(x_{i}\) and \(x_{j}\), with \(r_{ij}=r_{ji}\), calculated as  
\[r_{ij}=\frac{\sum\limits_{k=1}^{n}{(x_{ki}-\overline{x}_{i})\Big{(}x_{kj}- \overline{x}_{j}\Big{)}}}{\sqrt{\sum\limits_{k=1}^{n}{(x_{ki}-\overline{x}_{i} )^{2}\sum\limits_{k=1}^{n}{\Big{(}x_{kj}-\overline{x}_{j}\Big{)}^{2}}}}} \tag{8}\]  
(2) Calculate Eigenvalues and Eigenvectors: Solve the characteristic equation \(|\lambda I-R|=0\) to obtain the eigenvalues \(\lambda_{1}\geqslant\lambda_{2}\geqslant\cdots\geqslant\lambda_{p}\geqslant 0\), and compute the corresponding eigenvectors \(e_{i}(i=1,2,\cdots,p)\) for each eigenvalue, ensuring \(\sum\limits_{j=1}^{p}{e_{ij}^{2}}=1\). (3) Calculate contribution rates and cumulative contribution rates: The variance contribution rate of the kth principal component is  
\[\eta_{k}=\frac{\lambda_{k}}{\sum\limits_{k=1}^{p}{\lambda_{k}}} \tag{9}\]  
For \(m\) (\(m<p\)) principal components, the cumulative contribution rate is  
\[\xi_{m}=\sum\limits_{k=1}^{m}{\lambda_{k}}/\sum\limits_{k=1}^{p}{\lambda_{k}} \tag{10}\]  
(4) Calculate principal component loadings:\[l_{ij}=p(z_{i},x_{j})=\sqrt{\lambda_{i}}e_{ij}\left(i,j=1,2,\cdots,p\right) \tag{11}\]  
(5) Calculate principal component scores: compute the scores of the samples on the \(m\) principal components:  
\[Z_{i}=l_{1i}X_{1}+l_{2i}X_{2}+\ldots+l_{pi}X_{p},\left(i=1,2,\ldots,m\right) \tag{12}\]  
Overall, PCA is a commonly used linear dimensionality reduction method.