# Consensus Big Data Clustering for Bayesian Mixture Models
## 3 Methodology
### Integration of PPM and Consensus Clustering  
Following Section 5 in [54], let us consider that  
\[y_{i}|\mu_{j},\sigma_{j}^{2} \sim\mathrm{N}(\mu_{j},\sigma_{j}^{2}),\] \[\mu_{j}|\mu_{0},\sigma_{0}^{2} \sim\mathrm{N}(\mu_{0},\sigma_{0}^{2}),\] \[\sigma_{j}^{2} \sim\mathrm{U}(0,1),\] \[\sigma_{0}^{2} \sim\mathrm{U}(0,2),\] \[\mu_{0} \sim\mathrm{N}(0,100).\]  
Further, let us denote \(n_{j}=|S_{j}|\) and \(k\) as the number of distinct clusters. Below, we present the full conditionals of the quantities/parameters of interest. \[p(\mu_{j}|-) \propto p(\mathbf{y}|\mu_{j},\sigma_{j}^{2})p(\mu_{j}),\propto \prod_{i\in S_{j}}\Bigl{[}\mathrm{N}(y_{i}|\mu_{j},\sigma_{j}^{2})\Bigr{]}p( \mu_{j}),\] \[\propto\exp\Bigg{(}-\frac{1}{2\sigma_{j}^{2}}\sum_{i\in S_{j}}(y _{i}-\mu_{j})^{2}\Bigg{)}\exp\Biggl{(}-\frac{1}{2\sigma_{0}^{2}}(\mu_{j}-\mu_ {0})^{2}\Bigg{)},\] \[\propto\exp\Bigg{\{}-\frac{1}{2}\Bigg{(}\mu^{2}\left[\frac{n_{j} }{\sigma_{j}^{2}}+\frac{1}{\sigma_{0}^{2}}\right]-2\mu\left[\sum_{i\in S_{j}} \frac{y_{i}}{\sigma_{j}^{2}}+\frac{\mu_{0}}{\sigma_{0}^{2}}\right]\Bigg{)} \Bigg{\}},\]  
which is  
\[\mu_{j}|- \sim\mathrm{N}\Biggl{(}\frac{\sigma_{j}^{-2}\sum_{i\in S_{j}}y_{i }+\mu_{0}/\sigma_{0}^{2}}{n_{j}/\sigma_{j}^{2}+1/\sigma_{0}^{2}},\frac{1}{n_{j }/\sigma_{j}^{2}+1/\sigma_{0}^{2}}\Bigg{)}. \tag{23}\]  
\[p(\sigma_{j}^{2}|-) \propto p(\mathbf{y}|\mu_{j},\sigma_{j}^{2})p(\sigma_{j}^{2}), \propto\prod_{i\in S_{j}}\Bigl{[}\mathrm{N}(y_{i}|\mu_{j},\sigma_{j}^{2}) \Bigr{]}p(\sigma_{j}^{2}),\] \[\mu_{j}|\mu_{0},\sigma_{0}^{2} \sim\mathrm{N}(\mu_{0},\sigma_{0}^{2}),\]0  
which is  
\[\mu_{j}|\mu_{0},\sigma_{0}^{2} \sim\mathrm{N}(\mu_{0},\sigma_{0}^{2}),\]1  
\[\mu_{j}|\mu_{0},\sigma_{0}^{2} \sim\mathrm{N}(\mu_{0},\sigma_{0}^{2}),\]2 \[\mu_{j}|\mu_{0},\sigma_{0}^{2} \sim\mathrm{N}(\mu_{0},\sigma_{0}^{2}),\]3  
which is  
\[\mu_{j}|\mu_{0},\sigma_{0}^{2} \sim\mathrm{N}(\mu_{0},\sigma_{0}^{2}),\]4\[\mu_{j}|\mu_{0},\sigma_{0}^{2} \sim\mathrm{N}(\mu_{0},\sigma_{0}^{2}),\]5 \[\mu_{j}|\mu_{0},\sigma_{0}^{2} \sim\mathrm{N}(\mu_{0},\sigma_{0}^{2}),\]6  
\[\mu_{j}|\mu_{0},\sigma_{0}^{2} \sim\mathrm{N}(\mu_{0},\sigma_{0}^{2}),\]7  
For more details about the marginalization of \(\mu\) and \(\sigma_{2}\) for the full conditional of \(\rho\), see Appendix A. To simulate the posterior distribution of the PPM, we use Algorithm 8 introduced by [53]. This algorithm was proposed in the context of Dirichlet process mixture models, but it can be used for PPMs as well. **Definition 1** (Singleton). : _The definition of a singleton is a cluster consisting of only one observation. In contrast, any cluster comprising more than one observation is not considered a singleton._  
Let the cluster labels be denoted as \(c_{i}=j:i\in S_{j}\) with values ranging from \(1,\ldots,k\). For each \(i\), where \(i=1,\cdots,n\), let \(h=k+m\), where \(k\) represents the number of distinct cluster labels \(c_{j}\) excluding observation \(i\). * If observation \(i\) belongs to a singleton cluster such that \(c_{i}\
eq c_{j}\) for all \(j\
eq i\), the cluster label \(c_{i}\) is assigned the value of \(k+1\). Independent values are then drawn from the prior distribution of \(\mu_{j}\) and \(\sigma_{j}^{2}\) for all \(k+1<c\leq h\). * If observation \(i\) does not belong to a singleton cluster such that \(c_{i}=c_{j}\) for some \(j\
eq i\), independent values are drawn from the prior distribution of \(\mu_{j}\) and \(\sigma_{j}^{2}\) for all \(k<c\leq h\). For both cases, draw a new value for \(c_{i}\) from \(\{1,\cdots,h\}\) using the following probabilities: \[p(c_{i}=c|c_{-i},y_{i},\{\mu_{c}\},\{\sigma_{c}^{2}\})= \begin{cases}b_{i}\frac{ n_{-i,c}}{n-1+\alpha}p(y_{i}|\mu_{c},\sigma_{c}^{2})&\text{ for }1\leq c\leq k,\\ b_{i}\frac{\alpha/m}{n-1+\alpha}p(y_{i}|\mu_{c},\sigma_{c}^{2})&\text{ for }k \leq c\leq h,\end{cases} \] (27) where \(n_{-i,c}\) is the number of observations (excluding \(i\)) that have \(c_{j}=c\), and \(\alpha\) is the Dirichlet process concentration parameter.