# An Earthquake Forecast Model Based on Multi-Station PCA Algorithm
## 5 Earthquake Prediction Model  
### Model Structure  
This work uses LightGBM (LGB) to predict the existence of earthquakes. LGB is a kind of implementation of Gradient Boosting Decision Tree (GBDT) [11, 27, 28], which is a semi-automatic machine learning model with good performance. LGB is often used to be a final prediction layer that summarizes features and generates a prediction. First, it generated multiple classifiers, and then, it combines them. Each sub-classifier has multiple layers, each layer has multiple nodes, which represents a possible property, and the whole classifier looks like a tree. Figure 7 shows this structure. This model selects split features by Gini coefficients at each node, trains a series of base classifiers based on the idea of gradient boosting, and considers all base classifiers together when making predictions.  
The model focuses on the earthquake existence of an area, its input is a series of features extracted from the virtual stations in this area. A typical area usually contains about 20\(\sim\)40 real stations, so it contains 400\(\sim\)1600 virtual stations. We define a threshold V and all the virtual stations' first principal components, which are under the threshold, and its corresponding second principal components will be used to calculate the input features. The granularity of output of the single-station PCA method and two-stations PCA method is individual days. For one week, we have 7 days, in which each day has its single-station PCA method and two-stations PCA method outputs. The output of the two-stations PCA method requires the following process, and the abnormal value is the first principal components value, which is under the threshold V:  
1. Use the mean values \(V_{mean}^{1}\) of the abnormal values and the mean values \(V_{mean}^{2}\) of the second principal components to be a part of features, and the station used to obtain the second principal components is the same as the abnormal values. Each day means every day should compute its mean value of all the abnormal values independently, and this step gets 14 values;
2. The percentage \(V_{per}^{1}\) of abnormal values in all values and the percentage \(V_{per}^{2}\) of the second principal components of the same virtual stations. Each day means every day should compute its mean value of all the abnormal values independently, and this step gets 14 values;
3. The number of abnormal values \(V_{N}\) each day. This step gets seven values;
4. Choose the three biggest values as the features of the first principal component of the single-station method for each day; this step get 21 values;
5. Concatenate all the values and the single-station method output to be a vector whose length is \(14+14+7+21=56\).  
An area usually has \(\sim\)20-40 stations, and each sample which is a vector with a length of 56 is related to 7 days data. In addition to the input vector with a length of 56, the model needs its corresponding label for training. The label of each 7-day window is marked by the earthquake in its area. For a 7-day window, we choose the biggest earthquake magnitude in the next 7 days after the last day of data as the label, and the relationship of label and magnitude is as follows:  
1. No earthquake is marked as 0;
2. Ms0-Ms3.5 is marked as 1;
3. Ms3.5-Ms4.0 is marked as 2;
4. Ms4.0-Ms4.5 is marked as 3;
5. Ms4.5-Ms5.0 is marked as 4;
6. Ms5.0-Ms5.5 is marked as 5.