# Study on Abnormal Pattern Detection Method for In-Service Bridge Based on Lasso Regression
## 3 Lasso Regression Theory  
When there is only one main influencing factor (independent variable) for the outcome (dependent variable), the variation can be explained using the theory of simple linear regression. However, in research on real-world problems, the variation of the dependent variable is often influenced by several important factors (independent variables). In such cases, it is necessary to use two or more influencing factors as independent variables to explain the changes in the dependent variable. This is known as multiple regression. When there is a linear relationship between multiple independent variables and the dependent variable, the regression analysis conducted is called multiple linear regression. Assuming that a dependent variable \(y_{i}\) is influenced by \(k\) independent variables, \(x_{1},x_{2},\ldots,x_{k}\), the basic equation of a multiple linear regression model is:  
Figure 1: Layout of the sensors. \[y_{i}=\omega_{0}+\sum_{j=1}^{k}x_{ij}\omega_{j} \tag{1}\]  
where \(\omega_{j}\) is the partial regression coefficient, \(\omega_{0}\) is the intercept, and \(k\) is the number of independent variables. The values of \(\omega_{j}\) and \(\omega_{0}\) can be obtained using the ordinary least-squares method (LSM) by setting the partial derivative of the objective function in Equation (2) to zero. The objective function is defined as the sum of squared residuals, which is the difference between the true response and the predicted response. \[argmin\sum_{i=1}^{N}(y_{i}-\omega_{0}-\sum_{j=1}^{k}x_{ij}\omega_{j})^{2} \tag{2}\]  
where \(N\) represents the total number of samples. To enhance the nonlinear fitting capability of the regression model, it is common to add higher-order terms of the initial variables \(X\) and then transform it into a linear regression problem for solving. However, this approach poses issues; artificially selecting the number of input variables and increasing the feature dimensionality can result in multicollinearity among variables and the introduction of non-important variables. Therefore, it can lead to overfitting and excessive variance in parameter estimation when directly using ordinary LSM to compute the parameters \(\omega_{j}\) and \(\omega_{0}\). This paper uses Lasso (Least Absolute Shrinkage and Selection Operator) regression to solve the problems of overfitting and excessive parameter estimation variance [28]. Lasso regression is a sparse statistical learning method that adds a penalty term (regularization term) \(L_{1}\) to the objective function of conventional least-squares solving, as shown in Equation (3). Its Lagrange equivalent form is shown in Equation (4). \[argmin\{\frac{1}{2N}\sum_{i=1}^{N}(y_{i}-\omega_{0}-\sum_{j=1}^{k}x_{ij}\omega _{j})^{2}\},s.t.\sum|\omega_{j}|\leq t \tag{3}\]  
\[argmin\{\frac{1}{2N}\sum_{i=1}^{N}(y_{i}-\omega_{0}-\sum_{j=1}^{k}x_{ij}\omega _{j})^{2}+\lambda\sum_{j=1}^{k}|\omega_{j}|\} \tag{4}\]  
where \(t\) and \(\lambda\) are both regularization coefficients, and they have a one-to-one correspondence. The sizes of \(t\) and \(\lambda\) determine the complexity of the Lasso regression model. Generally speaking, the larger the value of \(t\) (smaller \(\lambda\)), the more complex the Lasso regression model; conversely, the smaller the value of \(t\) (larger \(\lambda\) ), the simpler the Lasso regression model. A simpler Lasso model implies that the model requires sparser feature coefficients as input. A larger \(\lambda\) can easily lead to overfitting of the regression model, while a smaller \(\lambda\) can easily lead to underfitting. Therefore, it is necessary to determine an appropriate value of \(\lambda\) to establish a suitable Lasso regression model [29]. Since \(\lambda\) is a hyperparameter, it cannot be obtained during the training of the regression model and needs to be manually specified. However, \(\lambda\) has a significant impact on the performance of the Lasso regression model, and it is crucial to select the optimal value when building the Lasso regression model.