# Predicting the Magnitude of Earthquakes Using Grammatical Evolution
## 2 Materials and Methods  
### The Dataset Employed  
In this paper, open data were used which are available from the NSF Seismological Facility for the Earth Consortium (SAGE), and particularly from the Interactive EarthquakeBrowser [[http://ds.iris.edu/ieb/](http://ds.iris.edu/ieb/)]([http://ds.iris.edu/ieb/](http://ds.iris.edu/ieb/)) (accessed on 30 June 2025). The data were obtained from the NSF as it offers greater functionality. Specifically, while the GEOFON program provides similar information, it imposes a limitation on the maximum number of earthquakes retrievable per request (1000 events), which significantly constrains the selectable time range. This is particularly restrictive given that approximately 1000 seismic events can occur within a single day. The NSF SAGE Facility has been certified as a trustworthy data repository by the CoreTrustSeal Standards and Certification Board. The data were collected for the years 2004, 2010, and 2012, with each year comprising over 100,000 recorded earthquake events. For every recorded earthquake event, comprehensive data were systematically gathered, including the date, exact time of occurrence, geographic coordinates, depth, and magnitude. This information enabled temporal analyses and the identification of seismic patterns across different time intervals. Moreover, our dataset employs the Moment Magnitude scale, as it operates effectively across a broader range of earthquake sizes, and is applicable on a global scale. During the initial stages of preprocessing, it became evident that earthquake events should be organized based on lithospheric plate boundaries, rather than national borders, which had initially been our approach. A preprocessing procedure was applied to the data, including the identification of the lithospheric plate associated with each earthquake. Subsequently, each earthquake location was cross-referenced with nearby volcanoes, where applicable, using data from the Smithsonian Institution's Global Volcanism Program [[https://volcano.si.edu/](https://volcano.si.edu/)]([https://volcano.si.edu/](https://volcano.si.edu/)) (accessed on 30 June 2025). During the course of our experiments, we decided to proceed with earthquakes with a magnitude of 5 and above, as including lower-magnitude events would result in the model being trained primarily on the prediction of minor seismic occurrences. In our research, we approached earthquake magnitude prediction as a regression problem, employing the technique of Grammatical Evolution. To achieve this objective, we used the following features as input variables: date, time, latitude, longitude, depth, lithospheric plate, type of nearby volcano, magnitude, and magnitude code. In addition, a predefined distance, denoted as \(D_{c}\) in the experiments, from the epicenter of the target event (10 miles, 25 miles, 50 miles, 100 miles, and 500 miles) was also taken into account. The numerical output of the model predicted the earthquake's intensity with high predictive accuracy, with a mean absolute error below 0.5 magnitude units per event. The following section provides a concise summary, as well as a more detailed analysis, of our data set. For the year 2004, a total of 666 geographic regions were classified and used as an input for the regression model, within which 215,753 seismic events were recorded. Similarly, for 2010, 635 regions were defined and encoded as input features, corresponding to 327,909 earthquakes, while for 2012, 690 regions were established as categorical input variables, with a total of 405,153 recorded seismic events. Regarding tectonic plates, for each seismic event, we classified and used as an input feature the tectonic plates involved in the corresponding region. In total, 81 distinct combinations of lithospheric tectonic plates were identified. In relation to the classification of volcanoes, these were categorized into ten types: stratovolcano, volcanic field, lava dome, caldera, complex, compound, shield, pyroclastic, minor, and submarine.