dealWithLabelSwitching {multinomialLogitMix} | R Documentation |
Post-process the generated MCMC sample in order to undo possible label switching.
Description
This function implements the Equivalence Classes Representatives (ECR) algorithm from the label.switching package in order to undo the label switching phenomenon.
Usage
dealWithLabelSwitching(gs, burn, thin = 10, zPivot = NULL, returnRaw = FALSE, maxM = NULL)
Arguments
gs |
An object generated by the main function of the package. |
burn |
Number of draws that will be discarder as burn-in. |
thin |
Thinning of the MCMC sample. |
zPivot |
Optional vector of allocations that will be used as the pivot of the ECR algorithm. If this is not supplied, the pivot will be selected as the allocation vector that corresponds to the iteration that maximized the log-likelihood of the model. |
returnRaw |
Boolean. If true, the function will also return the raw output. |
maxM |
Not used. |
Details
See Papastamoulis (2016).
Value
cluster |
Single best clustering of the data, according to the Maximum A Posteriori rule. |
nClusters_posterior |
Estimated posterior distribution of the number of clusters. |
mcmc |
Post-processed mcmc output. |
posteriorProbabilities |
Estimated posterior membership probabilities. |
Author(s)
Panagiotis Papastamoulis
References
Papastamoulis, P. (2016). label.switching
: An R Package for Dealing with the Label Switching Problem in MCMC Outputs. Journal of Statistical Software, 69(1), 1-24.