# Hazard Model: Epidemic-Type Aftershock Sequence (ETAS) Model for Hungary
## 3 Epidemic-Type Aftershock Sequence (ETAS) Modelling Methods
### Parameter Fitting
In accordance with the self-similarity assumption, parameter \(\alpha\) is set to be equal with the \(\beta\) magnitude-frequency decay parameter of the target catalogue \(H_{V}\), which is estimated at \(\beta=2.602\) and is equivalent to a Gutenberg-Richter \(b=1.13\). The function \(u(x,y)\) is approximated by the kernel smoothing of a declustered epicenter catalogue, following an iterative process suggested by [PERSON] et al. [7; 8] after certain adaptations. An initial declustered catalogue is obtained via the window method, i.e., by removing those events from the full catalogue that fall inside a pre-defined space-time neighbourhood of a bigger event, where the window parameters suggested in [31] (pp. 173-174) are used. Starting from the initial declustering, cycles of the following steps are iterated until convergence is reached:  
1. kernel smoothing for \(u(x,y)\);
2. log-likelihood optimization for \((\mu,K,\eta,q,D,\varepsilon)\);
3. follow-on declustering steps based on the ETAS model. For a better-smoothed background density estimate, during the kernel smoothing and declustering steps, the epicenter catalogue \(E\) is broader than the catalogue \(H\) used for the log-likelihood optimization. The latter is kept narrower to reduce computing time. The epicenter catalogue \(E\) includes all \(M\geq 2.5\) events in the study area \(A_{1}\) from catalogues B, C, and X in the years 1996-2021, giving a total number of 2 432 potential epicenter nodes before declustering. The incompleteness of \(E\) implies an inhomogeneous coverage between the core area and the extension margin, which needs to be corrected by appropriate weighting. Declustering in an ETAS context aims to identify background events rather than mainshocks, as in the parameterization of a stationary Poisson model. Since both the background process and the trigger process contribute simultaneously to the Poisson rate at event \(i\), declustering in an ETAS context is non-binary. A background weight \(0\leq\xi_{i}\leq 1\) is defined for each event in the epicenter catalogue, expressing the relative contribution of the background process to event \(i\)[7; 8]:  
\[\xi_{i}=\mu\cdot u(x_{i},y_{i})/\lambda(t_{i},x_{i},y_{i}|E_{i}). \tag{10}\]  
Despite its non-binary nature, the observed distribution of \(\xi_{i}\) is typically strongly U-shaped with modes close to 0 and 1, suggesting that background events can be well distinguished from triggered events in most cases [7; 9]. As a simplification, the continuous background weights \(\xi_{i}\) are replaced by the binary background indicators \(\chi_{i}\):  
\[\chi_{i}= \begin{cases}0\text{ if }\xi_{i}<1/2,\\ 1\text{ if }\xi_{i}\geq 1/2.\end{cases}  \tag{11}\]The conversion into binary indicators is mathematically not strictly necessary, as the equations used in the parameter fitting also work with continuous weights. The advantage of binary indicators is that they are robust, so they ensure a quick convergence of the iteration, and they also provide an unambiguous declustered catalogue of background events. Given the background indicators \(\chi_{i}\), the background density function is approximated as a weighted sum of Gaussian kernels placed around the epicenter nodes [7; 8]:  
\[u(x,y)=\frac{1}{C}\cdot\left[\sum_{i\in E_{0}}\chi_{i}\cdot k_{d}(x-x_{i},y-y_{ i})+w\cdot\sum_{i\in E\setminus E_{0}}\xi_{i}\cdot k_{d}(x-x_{i},y-y_{i}) \right], \tag{12}\]  
with  
\[k_{d}(x,y)=\frac{1}{2\pi d}\cdot\exp\left(-\frac{x^{2}+y^{2}}{2d^{2}}\right), \tag{13}\]  
where \(C\) is a normalising constant and \(E_{0}\) is the epicenter sub-catalogue corresponding to the core area \(A_{0}\). The weighting \(w\) of the sum over \(E\setminus E_{0}\) is introduced to correct the uneven coverage of the epicenter catalogue between the core area \(A_{0}\) and the extension margin \(A_{1}\setminus A_{0}\), and it is defined such that the corrected total weight in the two area parts is proportional to the respective background occurrence rates, estimated from the most recent declustering step of the iteration. While [PERSON] et al.