# Predicting the Magnitude of Earthquakes Using Grammatical Evolution
## 3 Experimental Results  
The measurements from the years 2004, 2010, and 2012 were used as test cases in the experimental results. For the Neural Network Construction technique, the freely available software NNC version 1.0 [58] was incorporated. Feature Construction was performed using the QFC software version 1.0 [59], which is also freely available. Furthermore, the WEKA programming tool version 3.6.14 [60] was utilized in the conducted experiments. Validation of the experiments was performed using the ten-fold cross-validation technique, and all experiments were conducted on a machine running Debian Linux with 128 GB of RAM. The average regression error for the test set was measured using the following equation:  
\[E_{R}\big{(}M\big{(}\overrightarrow{x}\big{)}\big{)}=\frac{\sum_{i=1}^{N} \big{(}N\big{(}\overrightarrow{x_{i}}\big{)}-y_{i}\big{)}^{2}}{N} \tag{4}\]  
Here, the test set \(T\) is defined as the set \(T=(x_{i},y_{i})\), \(i=1,\ldots,N\), and the equation \(M\big{(}\overrightarrow{x}\big{)}\) denotes the application of the machine learning \(M(x)\) on the input pattern \(\overrightarrow{x}\). The values for the experimental parameters are outlined in Table 4. The parameters used in the individual genetic algorithms have been successfully used in the past in a multitude of research works, and furthermore constitute a compromise between the speed and performance of the algorithms used in the present work. Also, the following notation is used in the experimental table:  
1. The column YEAR denotes the recording year for the earthquakes. 2. The column \(D_{c}\) denotes the critical distance, expressed in miles, used in the preprocessing of the earthquake data. 3. The column LSTM denotes the incorporation of the long short-term memory (LSTM) neural network [61], as implemented in the PyTorch programming library [62]. 4. The column SVM represents the usage of the Support Vector Machines [63], as coded in the LibSvm library [64]. 5. The column MLP(BP) denotes the incorporation of the Back Propagation algorithm [65] in the training of a neural network with \(H=10\) processing nodes. 6. The column MLP(RPROP) represents the usage of the RPROP method [66,67] for the training of a neural network with \(H=10\) processing nodes. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Parameter** & **Meaning** & **Value** \\ \hline \(N_{c}\) & Chromosomes & 500 \\ \hline \(N_{g}\) & Maximum number of generations & 200 \\ \hline \(p_{s}\) & Selection rate & 0.10 \\ \hline \(p_{m}\) & Mutation rate & 0.05 \\ \hline \(N_{f}\) & Number of created features & 2 \\ \hline \(H\) & Weights & 10 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: The values used for the experimental parameters. The column MLP(BFGS) denotes the usage of the BFGS optimization procedure [68] for the training of an artificial neural network with \(H=10\) processing nodes. * 8 The column RULE denotes the incorporation of the rule construction method, described in Section 2.3. * 9 The column NNC represents the usage of the Neural Network Construction method, provided in Section 2.4. * 10 The column FC represents the usage of the Feature Construction technique, outlined in Section 2.5. * 11 The row AVERAGE represents the average error for all years and critical distances. An example of constructed features for the year 2010 is presented below: \[ \begin{array}{rcl}f_{1}(x)&=&\frac{-4}{99.35}x_{2}+\cos(x_{3}-877.38x_{6}+ \sin(43.56x_{4}+x_{6}-99.35x_{2}))\\ f_{2}(x)&=&2x_{13}-95.2x_{2}+948.94x_{1}\end{array} \]  
According to the data from the Table 5 for seismic magnitude prediction (2004) based on neighboring earthquakes, the following key observations are made: The Grammatical Evolution models (RULE, NNC, FC) continuously exhibit the lowest regression error (0.16-0.17) at all distances (\(D_{c}\)). They are much more stable and accurate than the other models, with an average error of 0.164. This suggests that Grammatical Evolution significantly improves performance.