Function relabel
implements Algorithm 2 in Matthew Stephens (2000) JRSSB for the posterior allocation probability matrix, minimizing the Kullback-Leibler distance. Step 2 in this algorithm is solved using the Hungarian (Munkres) algorithm to the assignment problem.
relabel(probs.mcmc, nIter, nItem, nClust,
RELABEL.THRESHOLD, PRINT = 0, PACKAGE="DIRECT")
Permuted labels for each store MCMC sample are written to file *_mcmc_perms.out, in which each row contains an inferred permutation (relabel) of labels of mixture components.
A nItem
*nIter
-by-nClust
matrix of samples of the posterior allocation probability matrix stored in file *_mcmc_probs.out generated by resampleClusterProb
.
Number of stored MCMC samples.
Number of items.
Number of inferred clusters.
A positive scalar. Used to determine whether the optimization in the relabeling algorithm has converged.
If TRUE, print intermediate values onto the screen. Used for debugging with small data sets.
Not for use.
Audrey Q. Fu
Fu, A. Q., Russell, S., Bray, S. and Tavare, S. (2013) Bayesian clustering of replicated time-course gene expression data with weak signals. The Annals of Applied Statistics. 7(3) 1334-1361.
Stephens, M. (2000) Dealing with label switching in mixture models. Journal of the Royal Statistical Society, Series B, 62: 795-809.
DIRECT
for the complete method.
DPMCMC
for the MCMC sampler under the Dirichlet-process prior.
resampleClusterProb
for resampling of posterior allocation probability matrix in posterior inference.