## 2 Materials and Methods
### Outlier Detection and Replacement
#### 2.3.3 OLS Outlier Identification Method  
When there are outliers in the regression analysis, these outliers will directly affect the fit and the stability of the model. When the data is small and there are outliers in the data, the outliers will produce heteroscedasticity. The outliers will pull the regression line closer to them, resulting in greater \"distortion\" of the regression line, and the resulting regression model has lower prediction accuracy. After using the box plot to eliminate outliers, the next step is to use OLS to build statistics to establish a data deletion model for a single outlier and determine the four outliers by using studentized residuals, leverage values, DFFITS, and Cook's distance. Each method was used to identify and eliminate outliers and strong influence points. Using a single judgment to investigate is sometimes inaccurate, and often overlooks the comprehensive application of several aspects. Here, studentized residuals are selected, and the heteroscedasticity is considered compared with residuals. It is more effective to detect outliers and improve the accuracy of regression prediction. * Leverage value: Outliers in the x-space are called high leverage points. The linear model is expressed as: \[Y=Xb+e,\] (2) where \(X\) is the \(n\times(p+1)\) observation matrix, \(Y\) is the observation vector of \(n\times 1\), \(b\) is the unknown parameter vector, and \(e\) is the random error vector. When OLS is used for regression estimation, hat matrix \(H\) can be obtained, which can be expressed as  
\[H=X(X^{\prime}X)^{-1}X^{\prime}, \tag{3}\]  
Many researchers diagnose lever points through the diagonal element \(h_{ii}\) of hat matrix \(H\) to determine the possible influence points, especially the point \(h_{ii}>2(p+1)/n\). Therefore, \(h_{ii}>2(p+1)/n\) is used as the diagnostic benchmark of the diagnostic lever point, where \(p\) is the number of features and \(n\) is the number of samples. The variable \(h_{ii}\) can be expressed as  
\[h_{ii}=(HH)_{ii}=\sum_{j=1}^{n}h_{ij}h_{ji}=\sum_{j=1}^{n}h_{ji}h_{ij}, \tag{4}\]* Studentized residual The internal studentized residual \(t_{i}\) is the mean square error of the regression model obtained by fitting all data: \[t_{i}=\frac{r_{i}}{s\sqrt{1-h_{ii}}}\,\] (5) \[s=\frac{\frac{\gamma-X\hat{b}}{\sqrt{n-p-1}}}{\sqrt{n-p-1}}\,\] where \(r_{i}\) is the residual. When the measurement error of \(y_{i}\) is independent and obeys a normal distribution \(N(0,\sigma^{2})\), the internal studentized residual can be obtained. The external studentized residual, the mean square error of the regression model, is obtained by fitting all other data with the \(i\)-th observation value deleted:  
\[t(i)=\frac{r_{i}}{s(i)\sqrt{1-h_{ii}}}, \tag{6}\]  
where \(s(i)\) is the estimate of \(\sigma\) for the entire regression run without the \(i\)th observation. \(t(i)\) are also known as external studentized residuals. The internal studentized residual \(t_{i}\) obeys the \(n\) distribution of degrees of freedom \((n-p-2)\), and the external studentized residual \(t(i)\) obeys the \(t\) distribution of degrees of freedom \((n-p-3)\). Approximately 95.44% of the studentized residual falls in the interval [\(-2\), \(2\)] and does not show any trend. If the studentized residuals exceed this range, these points may be outliers. * DFFITS Welsch-Kuh distances (DFFITS) are proposed from the viewpoint of data fitting. Considering the influence of before and after deletion of the \(i\)th point on the fitting value at \(x_{i}\), DFFITS is defined as \[DFFITS(i)=t(i)\sqrt{\frac{h_{ii}}{1-h_{ii}}},\] (7) [PERSON] uses the point of \(DFFITS\geq 2\sqrt{\frac{p+1}{n}}\) as the threshold for determining outliers. * [PERSON]'s distance Cook's distance is a statistic that measures the influence of the \(i\)th observation point on regression.