## 3 Methodology
### Hazard Disaggregation: Identification of Modal Scenarios  
In order to identify modal scenarios (i.e., both global and local maxima) from each \(M\)-\(R\) PMF, an innovative approach based on morphological image processing techniques was implemented. The most common morphological operations are minimum (also known as erosion) and maximum (dilation) filters [45; 46; 47]. In this study, the latter operation was used. Specifically, each PMF was treated as an image and the maximum filtering operation was individually applied to each pixel (i.e., \(M\)-\(R\) bin). The maximum filter scans each pixel in a moving window process and replaces the associated PMF value with the largest value among the neighboring pixels, which overall define the so-called structuring element (also termed as neighborhood). Maxima were identified by checking for element-wise equality between the original and filtered matrices, resulting in a Boolean matrix within which 'True' values indicate the position of the modes. Mathematically, this is expressed by the following equations. Let \(O\) be the matrix associated with a given PMF and \(S\) the structuring element, the operation of the maximum filter can be expressed by:  
\[F_{ij}=\max_{(k,l)\in S}O_{i+k,j+l} \tag{1}\]  
where \(F_{ij}\) is the value of the filtered matrix at position \((i,j)\), \(O_{i+k,j+l}\) represents the elements of the matrix \(O\) that are inside the structuring element \(S\) at position \((i+k,j+l)\), and'max' denotes the maximum value within \(S\). To define maxima, a Boolean mask was generated by checking for equality between the elements of the filtered and original matrices. The Boolean mask is a binary matrix with the same size as \(O\) and \(F\). An entry is set to 'True' (i.e., 1) if, for a given position in the matrix, the values in both \(O\) and \(F\) are equal, indicating a maximum. Otherwise, the element is set to 'False' (i.e., 0). Mathematically, this operation can be expressed as:  
\[B_{ij}=\left\{ \begin{array}{cl}&1&\quad\quad if\ F_{ij}=O_{ij}\\ &0&\quad\quad otherwise\end{array} \right. \tag{2}\]  
where \(B_{ij}\) is the value of the Boolean matrix at position \((i,j)\). In the following, a global maximum (i.e., the \(M\)-\(R\) pair contributing the most to the hazard) is denoted by \((M^{*},R^{*})\), whereas local maxima (i.e., minor modes) are indicated by \((M^{*}_{i},R^{*}_{i})\) with \(i\) = 1, \(\ldots\), \(n\). Increasing values of \(i\) indicate modal \(M\)-\(R\) pairs with decreasing contributions to the hazard (i.e., progressively lower PMF values). In the present work, the structuring element was a 3-by-3 square window encompassing all eight neighboring pixels around the target pixel. The size and configuration (i.e., shape) of the structuring element was defined after a sensitivity analysis aimed at defining the optimal setting of the structuring element to find the maxima of an \(M\)PMF. To this end, we first examined the impact of the structuring element for two different configurations while keeping the window dimension fixed (3-by-3 window): a cross pattern with 4 neighboring pixels and a square pattern encompassing all 8 neighboring pixels. The results are shown in Figure 1 for an example PMF. Employing a structuring element with a cross pattern configuration identifies four modes (Figure 1a). However, the third mode (\(M_{2}^{*}\), \(R_{3}^{*}\)) is a fake mode because it is located immediately beside the second mode (\(M_{2}^{*}\),\(R_{2}^{*}\)) (i.e., there is no local minimum between these two \(M\)-\(R\) bins) and has a lower PMF value (\(PMF_{3}^{*}=0.0173<PMF_{2}^{*}=0.0175\)). The third mode (\(M_{3}^{*}\), \(R_{3}^{*}\)) is erroneously detected because this structuring element (cross pattern configuration) does not scan the diagonal side of the target pixel and is therefore insensitive to the diagonal elements. This suggests that scanning the area surrounding the target pixel in all directions may result in more effective and reliable peak detection.