# Earthquake Prediction for the Duzce Province in the Marmara Region Using Artificial Intelligence
## 3 Materials and Method
### RNN (Recurrent Neural Network)  
RNN is an artificial intelligence (A.I.) method. It is an artificial neural network that considers input data's order and timing and is very good at estimating the relationship between data. Due to this property, RNN is widely used in machine learning applications [32].  
The RNN working algorithm includes the following steps.  
The input data are entered into the input layer;  
The input data are processed in the hidden layers and the weights are learned;  
The hidden layers process the data and generate the output data;  
The output data are sent to the output layer;  
The output data are generated.  
RNNs use the formulas shown in (Table 3) when processing data [33].  
The primary purpose of this study is to predict future earthquakes with the RNN model, using past earthquakes and other data as inputs to build an earthquake prediction model. The data used in the study include the magnitude, location, time, depth, b and d values of the earthquakes, and the distance of the Moon from the Earth. By processing these sequential data, the RNN model will predict the time, location, and probability of possible earthquakes in the future.  
A 33-year dataset was used to train the RNN model and test its predictions.  
RNN and Other Methods  
There are many machine learning methods that work on a similar logic to RNN. In addition to RNN, the most commonly preferred methods are XGBoost, Prophet, and ARIMA.  
XGBoost (Extreme Gradient Boosting) is a powerful boosting algorithm widely used in the field of machine learning. Boosting is an ensemble learning technique that aims to combine weak learners (e.g., decision trees) to create a strong learner. XGBoost is specifically designed to achieve successful results in classification and regression problems using this ensemble method [34].  
Prophet is an open-source time series analysis library developed by Facebook. It can be used in both R and Python programming languages. Prophet is designed to perform predictions in complex time series data with features such as seasonality, holiday effects,  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Formulas** & **Explanation** \\ \hline \(\text{h}_{\text{t}}=\text{f}(\text{h}_{\text{t}-1},\text{X}_{\text{t}})\) & \(\text{h}_{\text{t}-1}\): the previous h value \\ \(\text{x}_{\text{t}}\): current input vector \\ \hline \(\text{h}_{\text{t}}=\text{tanh}(\text{W}_{\text{hh}}\text{h}_{\text{t}-1}+ \text{W}_{\text{hx}}\text{X}_{\text{t}})\) & \(\text{W}_{\text{hh}}\): weight of the previous hidden layer \\ \(\text{W}_{\text{hx}}\): weight of the current hidden layer \\ \(\text{tanh: activation function}\) \\ \hline \(\text{y}_{\text{t}}=\text{W}_{\text{hy}}\text{h}\) & \(\text{W}_{\text{hy}}\): weighing value of the output layer \\ \(\text{y}_{\text{t}}\): output \\ \hline \hline \end{tabular}
\end{table}
Table 3: RNN formulas.  
and other time-related patterns. It is popular due to its ease of use and effective results, commonly used in various domains such as business analytics, demand forecasting, financial analysis, and social media data analysis [35].  
ARIMA (AutoRegressive Integrated Moving Average) is a statistical model used to analyze and perform predictions in time series data. The ARIMA model captures structural features in time series data (auto-regression, moving average, and integration) [36].  
In general, ARIMA is a fundamental statistical model effective for stationary time series data, while Prophet is suitable for time series data with complex features, such as seasonality. XGBoost is preferred for classification and regression tasks with non-structural data, and RNN is used for handling time-dependent data and capturing relationships over time. The choice of method depends on the data structure, analysis goals, and characteristics of the dataset. In this study, the RNN method was applied to the dataset used.