## 3 Modeling Method for \(\mathbf{S_{h}}|\mathbf{X}^{F},\mathbf{X}^{S}\)
### Introduction of Partial Pooling to Address Heterogeneity in Risk Clustering: RQ1
Let the local cluster \(j\)'s outcome parameter \(\mathbf{\theta}_{j}=\{\mathbf{\beta}_{j},\sigma_{lnYj}^{2}\}\) for \(j=1,\ldots,J\) be an independent sample from a population distribution with global parameters (hyperparameters) \(\mathbf{\phi}=\{a_{0},b_{0},c_{0},d_{0}\}\) as shown in Figure 1. If \(\mathbf{\phi}\) is unknown and requires estimation, the uncertainties in both \(\mathbf{\theta}\) and \(\mathbf{\phi}\) would be evaluated using their joint posterior distribution given by:  
\[p(\mathbf{\theta},\mathbf{\phi}|lnY,\mathbf{X})\propto f(lnY|\mathbf{X},\mathbf{\theta}, \mathbf{\phi})\cdot p(\mathbf{\theta},\mathbf{\phi})=\prod_{j=1}^{J}f(lnY_{j}|\mathbf{X}_ {j},\mathbf{\theta}_{j},\mathbf{\phi})\cdot p(\mathbf{\theta}_{j},\mathbf{\phi}) \tag{4}\]  
where the hyperparameters \(\mathbf{\phi}\) affect the outcome (or cluster) through the cluster parameter \(\mathbf{\theta}_{j}\) as illustrated in Figure 1. To analyze the joint prior \(p(\mathbf{\theta}_{j},\mathbf{\phi})\) in Equation (4), it is decomposed into the cluster parameter distribution \(p(\mathbf{\theta}_{j}|\mathbf{\phi})\) and the hyperprior \(p(\mathbf{\phi})\). The posterior distributions are represented as \(p(\mathbf{\theta}_{j}|\mathbf{\phi},lnY_{j},\mathbf{X}_{j})\) for the cluster parameter and \(p(\mathbf{\phi}|lnY,\mathbf{X})\) for the hyperprior, which can then be evaluated as:  
\[p(\mathbf{\theta}|\mathbf{\phi},lnY,\mathbf{X}) =\prod_{j=1}^{J}p(\mathbf{\theta}_{j}|\mathbf{\phi},lnY_{j},\mathbf{X}_{j}) \tag{5}\] \[p(\mathbf{\phi}|lnY,\mathbf{X}) =\frac{p(\mathbf{\theta},\mathbf{\phi}|lnY,\mathbf{X})}{p(\mathbf{\theta}| \mathbf{\phi},lnY,\mathbf{X})} \tag{6}\]  
where the parameter layer for \(\mathbf{\theta}_{j}\) is informed by the data points grouped by each cluster \(j\) in Equation (5) (this indicates no-pooling), while the hyperparameter layer for \(\mathbf{\phi}\) communicates with the entire population without any clusters in Equation (6) (this indicates complete pooling). In Figure 1, complete pooling in the upper layer utilizes all data, which may overlook cluster-specific variations and result in underfitting, as hyperparameters \(\mathbf{\phi}\) are updated based on the entire dataset. In contrast, no-pooling in the lower layer treats each cluster independently, risking overfitting, with parameters \(\mathbf{\theta}_{j}\) updated on a cluster-wise basis. The diagram in Figure 1 is translated into the analytic expression in Equations (4)-(6). Note that the numerator in Equation (6) is just the joint posterior for \(\mathbf{\theta},\mathbf{\phi}\) from Equation (4), and the denominator in Equation (6) is the posterior for \(\mathbf{\theta}|\mathbf{\phi}\) in Equation (5). From Equations (4)-(6), one can see that the cluster-specific parameter \(\mathbf{\theta}_{j}\) and the global parameter \(\mathbf{\phi}\) can be drawn and estimated recursively as per Figure 1. This balance enables optimal information sharing between clusters, allowing predictions to account for both cluster-level and individual-level variations simultaneously, thereby addressing heterogeneity across risk clusters effectively [21].