relabel {DIRECT} R Documentation

## A Relabel Algorithm

### Description

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.

### Usage

relabel(probs.mcmc, nIter, nItem, nClust,
RELABEL.THRESHOLD, PRINT = 0, PACKAGE="DIRECT")


### Arguments

 probs.mcmc A nItem*nIter-by-nClust matrix of samples of the posterior allocation probability matrix stored in file *_mcmc_probs.out generated by resampleClusterProb. nIter Number of stored MCMC samples. nItem Number of items. nClust Number of inferred clusters. RELABEL.THRESHOLD A positive scalar. Used to determine whether the optimization in the relabeling algorithm has converged. PRINT If TRUE, print intermediate values onto the screen. Used for debugging with small data sets. PACKAGE Not for use.

### Value

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.

### Note

This function calls a routine written in C, where implementation of Munkres algorithm is adapted from the C code by Dariush Lotfi (June 2008; web download).

Audrey Q. Fu

### References

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.

### See Also

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.

### Examples

## See example for DIRECT.


[Package DIRECT version 1.0.1 Index]