# An Earthquake Forecast Model Based on Multi-Station PCA Algorithm
## 4 PCA Extraction for Single Station
### PCA Algorithm of Multiple Stations  
Earthquake precursors are area processes, so the anomalies of one station before the earthquake may be related to its neighbor, and the data of a single station cannot catch this type of potential relevance between different stations. In this work, we use multi-station PCA to resolve these problems. Earthquakes are caused by the movement of the earth's plates, and our work is based on a hypothesis that the rupture of the fault zone is regional, so the earthquake precursor may be captured and recorded by multiple stations at the same time. We hypothesize that an area with low earthquake probability should have mild underground activities and the data of stations in this area should be similar. An earthquake is a regional event, and the data of stations in this area should be more different. A PCA method such as that in Section 4.2 is as follows. Firstly, use a sliding window of length 27 to slide on the time series data processed in Section 3.2; for station A, it is \(Row_{1\times 27}^{B}\); for station B, it is \(Row_{1\times 27}^{B}\), and so on. Stack the vectors to organize the time-series data to be a matrix: for example, two \(1\times 27\) vectors will become a \(2\times 27\) vector. In this step, matrix \(M_{n\times 27}\) is output, and n is the number of used stations. Secondly, use method in Section 4.2 to calculate the co-variance matrix of \(M_{n\times m}\) and to get the eigenvalue \(\lambda_{1},\lambda_{2},\ldots,\lambda_{n}\) (from large to small) and their related eigenvector \(\xi_{1},\xi_{2},\ldots,\xi_{n}\). In this work, \(m\) is 27 days. The eigenvalues \(\lambda_{1},\lambda_{2},\ldots,\lambda_{n}\) (from large to small) are called the first principal component, the second principal component, and so on. We believe that the first principal component represents the similarity between stations, and the second principal component represents the difference. Based on this hypothesis, if an abnormal rise of the proportion of the second principal component appears, it indicates that the data of the two stations have unusual differences, which may be related to earthquakes. A measure named \(E_{s}\) is used to measure the impact of earthquakes on a certain region, which is widely used in the research of [PERSON] and other seismologists [26]. Equation (6) shows the calculation method of this measure, in which \(M\) is the magnitude of the earthquake and \(R\) is the distance from earthquake to the station, \(E_{s}^{\prime}\) is the influence of that one earthquake, and \(E_{s}\) is the whole influence in one day. The previous methods such as that of [PERSON] [12] set the stations' number used in one matrix as 3. Figure 5 shows this three-station PCA features WCFZ (\(103.59^{\circ}\) E, \(31.48^{\circ}\) N), JZGFZ (\(104.25^{\circ}\) E, \(33.26^{\circ}\) N), and QCFS (\(104.96^{\circ}\) E, \(32.37^{\circ}\) N) from 1 March 2019 to 18 August 2019. The red line represents all earthquakes whose \(E_{s}\) values are greater than \(5\times 10^{7}\) around stations, including Sichuan Liangshan 3.3 at (\(103.35^{\circ}\) E, \(28.08^{\circ}\) N) on 24 April 2019, Sichuan Yibin 5.3 at (\(104.89^{\circ}\) E, \(28.37^{\circ}\) N) on 18 June 2019, Sichuan Yibin 5.4 at (\(104.77^{\circ}\) E, \(28.43^{\circ}\) N) on 22 June 2019, and Sichuan Yibin 4.8 at (\(104.85^{\circ}\) E, \(28.4^{\circ}\) N) on 3 July 2019. There always peaks behind earthquake markers every half a month, and there are no earthquakes during the time of the flat part. The first principal component may represent the similarity between stations, and the second principal component may represent the difference. The third principal component is usually flat and unimportant, and it will cost hundreds of times of consumption to calculate it because the numbers of the principal components (eigenvalues) of the input matrix can not be higher than the dimension of input in the PCA algorithm. In our experiment, the number of stations of each matrix is 2.