## 3 Methodology
### Principal Component Analysis  
Principal component analysis (PCA) is a classic statistical method. Through orthogonal transformation, a set of potentially correlated variables is transformed into a set of linearly uncorrelated variables (also called principal components). In practical applications, dimensions of irrelevant variables finally constructed are often fewer than the number of original variables. Therefore, the main variables with greater influence can be extracted and the complexity of the data would be simplified. Each variable is searched one by one and perform orthogonal transformation. Principal components are several larger variables obtained by orthogonal transformation, which are linear combinations of the original variables. The study involves three stages (preparation stage, execution stage, and adjustment stage) in the lane-changing process, involving a total of n variables (vehicle speed, acceleration, distance, time distance, etc., in each stage), to establish a linear model of the longitudinal travel distance of the lane-changing behavior and the interrelated effects of variables. Because the variables may be correlated with each other, it is necessary to construct orthogonal variables to eliminate the correlation between them. Firstly, raw data should be centered, which means unitedly adjusting the mean values to be 0. The original observed vehicle data have \(t\) different dimensional representations. Figure 2: Key time nodes for lane-changing behavior recognition. The data for each \(x_{i}\) of the characteristic variables \(X_{i}\) have means of \(\mu_{i}\), which are obviously not all 0. To facilitate data dimensionality reduction and the use of variance to construct principal components, the data centering procedure adjust all the original sample data means to 0 to simplify the calculation of variance values. The variances of independent variables \(X_{i}\) are calculated by the following equation:  
\[ \begin{array}{c}Var(X_{i})=Cov(X_{i})=\frac{1}{n}\sum\limits_{i=1}^{n}{(x_{i}- \mu_{i})^{2}},\\ \mu_{i}=\frac{1}{n}\sum\limits_{i=1}^{n}{x_{i}},i=1,2,\ldots,t.\end{array}  \tag{1}\]  
With the method, mean value of each variable \(\mu_{i}=0\), the variance is:  
\[ \begin{array}{c}\hat{x}_{i}=x_{i}-\mu_{i},\\ Var(\hat{X})=Cov(\hat{X})=\frac{1}{n}\sum\limits_{i=1}^{n}{\hat{x}_{i}^{2}} \end{array}  \tag{2}\]  
This process is also the first step in finding the orthogonal basis: searching for the first base such that the variance value is maximized after transforming all data into the coordinate representation under the base. Secondly, a covariance matrix needs to be constructed to characterize the degree of correlation between the two variables \(A\), \(B\) in terms of covariance. After data centralization, the covariance formula is simplified:  
\[ \begin{array}{c}Cov(A_{i},B_{j})=\frac{1}{n}\sum\limits_{i=1}^{n}{a_{i}b_{j }},\\ i,j=1,2,\ldots,t.\end{array}  \tag{3}\]  
Although the average coefficient of the unbiased mean and variance of the sample is \(1/(n-1)\), \(1/n\) can be used to facilitate the calculation when the number of samples is large. After the orthogonal transformation of any two independent variables, the covariance of the two variables would be 0, which means no linear correlation after the procedure. Next, covariance matrices must be constructed for the two variables \(a_{i}\), \(b_{i}\) and the arrangement of these two variables are represented with the matrix \(X\):  
\[X=\left( \begin{array}{c}a_{1},a_{2},\ldots,a_{n}\\ b_{1},b_{2},\ldots,b_{n}\end{array} \right) \tag{4}\]  
The corresponding scatter matrix is \(XX^{T}\), and the covariance matrix is \((I/n)\)\(XX^{T}\):  
\[T=\frac{1}{n}XX^{T}=\left( \begin{array}{c}\frac{1}{n}\sum\limits_{i=1}^{n}{a _{i}^{2}},\frac{1}{n}\sum\limits_{i=1}^{n}{a_{i}b_{i}}\\ \frac{1}{n}\sum\limits_{i=1}^{n}{a_{i}b_{i}},\frac{1}{n}\sum\limits_{i=1}^{n}{ b_{i}^{2}}\end{array} \right)=\left( \begin{array}{c}Var(A),Cov(A,B)\\ Cov(A,B),Var(B)\end{array}