## 2 Preliminaries
### Principal Component Analysis Theory  
A traffic detector has many characteristics, such as a large number of sensors, a large dimension of data collected, and a large amount of data. Taking the coil sensor as an example, a section contains only two intersections. If we need to collect enough abundant data, we need several or even more coils, which makes it possible to obtain a large amount of data in a sampling period. Principal component analysis (\(PCA\)) is a branch of multivariate statistics, which is especially suitable for multivariate data processing [25]. Principal Component Analysis (\(PCA\)) is one of the projection models in multivariate statistical analysis. The principle is to assume that there is a measurement sample containing \(m\) sensors: \(x\in R^{m}\). In the measurement sample, each sensor has n independent sampling data, and the data are constructed into a data matrix of size \(m\times n\):  
\[X=[x_{1},x_{2},...,x_{n}]^{T}\in R^{n\times m}. \tag{4}\]  
Each column of X represents a measurement variable, and each row represents a sample. The PCA model first standardizes each sample of X, that is, it calculates the covariance matrix of X, and the formula is as follows:  
\[cov(x)\approx\frac{X^{T}\cdot X}{n-1}. \tag{5}\]  
After the feature decomposition of \(X\) is completed, the size of the feature values is sorted from large to small. The \(PCA\) model decomposes \(X\) as follows:  
\[\left\{ \begin{array}{l}X=\widehat{X}+E=T\cdot P^{T}+E,\\ T=X\cdot P.\end{array} \right. \tag{6}\]After separating the fault data, the variable with a larger contribution graph is considered as the cause variable that may generate fault data. In Equation (6), \(P\in\)R\({}^{m\times A}\) is the load matrix and is composed of the first \(A\) feature vectors of \(cov(x)\). \(T\in\)R\({}^{n\times A}\) is a score matrix, each column of \(T\) is called a principal element variable, \(A\) is the number of principal elements, and is also the number of columns of the score matrix. It can be known from the properties of the eigenvalues and the eigenvectors that the scoring matrices are mutually orthogonal, so these principal elements are also independent of each other. The covariance of the principal element can be calculated from Equation (7):  
\[\Lambda=\frac{X^{T}\cdot X}{n-1}= \begin{bmatrix}\lambda_{1}&\\...&...\\ &\lambda_{n}\end{bmatrix} , \tag{7}\]  
where \(\lambda_{1}\geq\lambda_{2}\geq...\geq\lambda_{n}\) represents the top \(A\) larger eigenvalues of covariance matrix of \(X\). For the selection of principal \(A\), this paper uses the method of calculating the cumulative variance contribution rate to determine. The cumulative variance contribution rate represents the ratio of the amount of data that the first \(A\) principals can interpret to the total data [26]. This can be calculated as follows:  
\[CPV=\frac{\sum\limits_{i=1}^{A}\lambda_{i}}{\sum\limits_{i=1}^{m}\lambda_{i}}. \tag{8}\]  
Usually, when the CPV (cumulative contribution percentage of variance) reaches more than 85%, it can be assumed that the former \(A\) principal component can explain most of the data changes in X. As shown in Figure 1, the red dashed line represents the value of CPV, which is 85% in Figure 1, when the lower limit of CPV is set at 85%, the number of principals is at least two. Therefore, when three principals are selected, the first three principals can contain enough information. The principal component constitutes a space, which is called the principal subspace, and the orthogonal complementary space is called the residual subspace. Any sample vector in \(X\) can be decomposed into projections on principal and residual subspaces [26]. As shown in Figure 2, \(X\) is the measurement data matrix, \(x\) is the measurement sample, \(\beta\) is the principal subspace direction, and \(\alpha\) and \(\gamma\) are the residual subspace directions. \(X\) is projected in two directions to form two spaces, namely principal subspace \(R_{p}\) and residual subspace \(R_{r}\).