This function calculates the Bayesian Silhouette (BS) Score for a DPCD model fit using posterior MCMC samples. The BS score can be used to evaluate the clustering quality of a fit and to compare different models.
Usage
bs_score(mcmc_samples)
Value
A numeric value representing the average silhouette score across all MCMC iterations.
Arguments
mcmc_samples
An object of class mcmc or mcmc.list containing posterior samples from a DPCD model fit using run_dpcd(). Variables x and z must be included in the output parameters.
Details
The Bayesian Silhouette Score is computed by calculating the silhouette score for each MCMC iteration based on the latent positions (x) and cluster assignments (z). The silhouette score measures how similar an object is to its own cluster compared to other clusters. The BS score is then obtained by averaging the silhouette scores across all MCMC iterations. Higher values of the BS score indicate a higher-quality DPCD model in terms of its clustering structure.