Learn R Programming

DPCD (version 0.0.1)

extract_clusters: Extract clusters from MCMC samples

Description

This function extracts estimated cluster memberships from MCMC samples obtained from a DPCD model fit.

Usage

extract_clusters(mcmc_samples)

Value

A vector of labels that indicate the estimated cluster membership for each observation.

Arguments

mcmc_samples

An object of class mcmc or mcmc.list containing posterior samples from a DPCD model fit using run_dpcd(). The variable z must be included in the output parameters.

Details

This function uses the cluster membership variable, z, from the provided MCMC samples to compute the posterior similarity matrix (PSM) based on the sampled cluster assignments. Using the PSM, it then determines the estimated cluster memberships by maximizing the posterior expected adjusted Rand index, following the method of Fritsch and Ickstadt (2009).

References

Fritsch, Arno & Ickstadt, Katja. (2009). An Improved Criterion for Clustering Based on the Posterior Similarity Matrix. Bayesian Analysis. 4. doi:10.1214/09-BA414.

See Also

mcclust::maxpear()

Examples

Run this code
extract_clusters(mcmc_example)


Run the code above in your browser using DataLab