# Earthquake Magnitude and Frequency Forecasting in Northeastern Algeria using Time Series Analysis
## 4 Earthquake Forecasting  
The magnitude forecasting analysis for earthquakes with magnitudes equal to or greater than Mw 4.0 is implemented in this section using the previously described models. The data file used in this section includes the main shocks that occurred between 1910 and 2019 in Northeastern Algeria. Figure 2 shows that the occurrence process during this time period can be approximated by a Poisson process. In this section, we will focus on two time series that represent the annual number of earthquakes and the annual maximum magnitudes in this region. Here, we denote for \(j=1,\ldots,N\) by \(m_{j}^{(k)}\) the magnitudes above Mw 4.0 of events occurred during the \(k\)-th year and define \(m_{k}\) as the annual maximum magnitude \(\max\limits_{0\leq j\leq N}m_{j}^{(k)}\) during the \(k\)-th year, whereas the number of earthquakes during the considered year, the \(k\)-th year, is denoted as \(N_{k}\). Figure 3a displays the \(\{N_{k};k\geq 0\}\) and \(\{m_{k},k\geq 0\}\) plots covering the considered time period using a threshold magnitude equal to Mw 4.0. The ARIMA and SSA time series models are then employed to forecast both the frequency and annual maximum magnitude of earthquakes using the R-packages [97] RSSA and FORECAST [98; 99]. By comparing the observed and predicted values, it is critical to identify the fitting models [74]. To increase the accuracy and reduce the rate of uncertainty, we have divided the dataset into training and testing data. We have identified that between 1910 and 2000, nearly 80% of the total events in the series \(\{N_{k};k\geq 0\}\) and \(\{m_{k},k\geq 0\}\) are included, corresponding to 70 observations. As a result, we estimate that 80% of the data are composed of training data, while the remaining 20% are events that were recorded between 2001 and 2019. Figure 3a shows two significant peaks in the \(\{N_{k};\,k\geq 0\}\) plot that refer to the high number of earthquakes that occurred between 1960 and 2003, and an important peak in the \(\{N_{k};\,k\geq 0\}\) plot corresponding to the biggest earthquakes that occurred in the studied region during this period. The stationarity and the normality of the studied series are tested using the Augmented Dickey Fuller (ADF) [100] and the Shapiro-Wilk (SW) tests [101]. The obtained results are shown in Table 1. The ADF test indicates the non-stationarity in \(\{N_{k};\,k\geq 0\}\) and \(\{m_{k},\,k\geq 0\}\) time series with a \(p\)-value greater than 5%, and according to SW test (Table 1), the normality hypothesis is rejected for both series (\(p\)-value less than 5%). Thus, the \(\{N_{k};\,k\geq 0\}\) and \(\{m_{k},\,k\geq 0\}\) series are not normally distributed variables with non-stationary behaviour, which means that these non-parametric methods can be more appropriate for our study. The stationarity of the data is an important hypothesis in ARIMA modelling. As a result, the first order differentiated series of \(\{N_{k};\,k\geq 0\}\) and \(\{m_{k},\,k\geq 0\}\) are computed. Figure 3b shows the differentiated resultant time series, with the two plots indicating a clear stationarity in the data. Thus, the integration parameter d is fixed in this study to 1. The \(p\) and \(q\) parameters of the ARIMA model are determined from the ACF and PACF plots of the differentiated series of \(\{N_{k};\,k\geq 0\}\) and \(\{m_{k},\,k\geq 0\}\), respectively, which are shown in Figure 4. In the set of candidate ARIMA models, the optimum models for \(\{N_{k};\,k\geq 0\}\) and \(\{m_{k},\,k\geq 0\}\) are the ones that minimize the AIC and BIC criteria and have a normally uncorrelated residual. Hence, according to Table 1, the ARIMA (2,1,1) and ARIMA (2,1,2) models are the selected ones for \(\{N_{k};\,k\geq 0\}\) and \(\{m_{k},\,k\geq 0\}\) time series, respectively. Figure 5 illustrates the residuals analysis of the two models, where Figure 5a shows the residuals of the selected models.