# Consensus Big Data Clustering for Bayesian Mixture Models
## 3 Methodology
### Integration of PPM and Consensus Clustering
Change the state to contain only those \(\mu_{j}\) and \(\sigma_{j}^{2}\) that are now associated with one or more observations. Here, \(b_{i}\) is an appropriate normalising constant given by (28). \[b_{i}^{-1}=\sum_{c=1}^{k}\frac{n_{-i,c}}{n-1+\alpha}p(y_{i}|\mu_{c},\sigma_{c} ^{2})+\sum_{c=k}^{h}\frac{\alpha/m}{n-1+\alpha}p(y_{i}|\mu_{c},\sigma_{c}^{2}).\] (28) For all \(c\in\{c_{1},\cdots,c_{n}\}\): draw new values from \(\mu_{j}|-,\sigma_{j}^{2}|-,\,\mu_{0}|-\), and \(\sigma_{0}^{2}|-\). The singleton (Definition 1) is an essential concept in the proposed Bayesian nonparametric clustering approach for several reasons:  
* Algorithm efficiency: By identifying singleton clusters, the algorithm can handle them differently in the MCMC sampling process. This distinction allows the algorithm to efficiently explore the space of possible cluster assignments, improving the overall performance of the algorithm and potentially leading to more accurate cluster assignments. * Flexibility in clustering: The Bayesian nonparametric clustering approach is designed to accommodate an unknown and potentially infinite number of clusters. The notion of singleton clusters enables the method to contemplate the possibility of new cluster construction, resulting in a more flexible, data-adaptive clustering solution. * Addressing overfitting: In the MCMC sampling process, the presence of singleton clusters helps prevent overfitting. By allowing new clusters to be created, the algorithm can effectively control the complexity of the clustering model, avoiding the risk of assigning too many data points to the same cluster when they may, in fact, belong to separate clusters. * Model interpretability: Singleton clusters can provide insights into the underlying structure of the data. Identifying singleton clusters can help reveal potential outliers or unique observations, allowing for a more granular understanding of the data's patterns and relationships. Generally, the concept of singletons plays a crucial role in the proposed Bayesian nonparametric clustering approach, improving the algorithm's efficiency, flexibility, and interpretability, as well as addressing potential overfitting issues. Based on all the preceding information, we propose a Bayesian nonparametric clustering method within an MCMC framework. This is illustrated as a flowchart in Figure 1, while the full inner structure is given in Algorithm 1. The algorithm initiates by inputting the \(y\) observations and \(\alpha\), \(m\) hyperparameters as well as the MCMC iterations of the program. The outputs of the algorithm are the \(K\) clusters as well as their means and variances. Figure 1: Flowchart of Bayesian nonparametric clustering in MCMC framework. ```
1:Input: Observations \(\mathbf{y}\), Hyperparameters \(\alpha\), \(m\), MCMC iterations MCMCiter
2:Output: Clusters and their means and variances
3:Initialize clusters and assign observations:
4: Set up \(\mathbf{y}\)
5: Assign all observations into a cluster
6:Set hyperparameters:
7: Set values for \(\alpha\) and \(m\)
8:MCMC Loop:
9:for\(mcmc\) in \(1\) to MCMCiterdo
10:for\(i\) in \(1\) to \(n\)do
11:if\(c_{i}\) is NOT a singleton then
12: Draw a new value from \(c_{-i},y_{i}\) from Equation (27)
13:else
14: Draw a new value from \(c_{i}\mid c_{-i},y_{i}\) from Equation (27)
15:endif
16:if any cluster is removed then
17: Adjust the labels to maintain a sequence from \(1\) to \(k\)
18:endif
19:endfor
20: Update mean and variance for each cluster \(j\)
21: Update mean and variance for base distribution \(\mu_{0}\) and \(\sigma_{0}^{2}\)
22:endfor
23:Return: Clusters and their means and variances
```  
**Algorithm 1** Bayesian nonparametric clustering in MCMC framework