NMixMCMC
or GLMM_MCMC function and internally re-labels the mixture
components using selected re-labeling algorithm. It also computes
posterior summary statistics for mixture means, weights, variances
which correspond to newly labeled MCMC sample. Further, posterior
component probabilities (poster.comp.prob_u and
poster.comp.prob_b components of the object object) are
updated according to the newly labeled MCMC sample.This function only works for models with a fixed number of mixture components.
NMixRelabel(object, type=c("mean", "weight", "stephens"), par, ...)
"NMixRelabel"(object, type = c("mean", "weight", "stephens"), par, ...)
"NMixRelabel"(object, type = c("mean", "weight","stephens"), par, prob=c(0.025, 0.5, 0.975), keep.comp.prob = FALSE, info, ...)
"NMixRelabel"(object, type = c("mean", "weight","stephens"), par, prob=c(0.025, 0.5, 0.975), keep.comp.prob = FALSE, info, silent = FALSE, parallel = FALSE, ...)
"NMixRelabel"(object, type = c("mean", "weight", "stephens"), par, prob = c(0.025, 0.5, 0.975), keep.comp.prob = FALSE, info, silent = FALSE, ...)
"NMixRelabel"(object, type = c("mean", "weight", "stephens"), par, prob = c(0.025, 0.5, 0.975), keep.comp.prob = FALSE, jointly = FALSE, info, silent = FALSE, parallel = FALSE, ...)
par specifies margin which is used to order the
components. It is set to 1 if not given.
par is empty.
par is a list with components
type.init, par, maxiter. Component type.init is a character string being equal to
either of identity, mean, weight. It
determines the way which is used to obtain initial re-labeling.
Component par determines the margin in the case that
type.init is equal to mean.
Component maxiter determines maximum number of iterations
of the re-labeling algorithm.
TRUE, posterior sample of
component allocation probabilities (for each subject) is kept in the
resulting object.TRUE then both chains
are processed together. In the output, all posterior summary
statistics are then also related to both chains as if it is one long
chain. If it is FALSE then both chains are processed independently.
parallel) should be used (if
possible) for re-labelling of the two chains.object argument in
which the following components are updated according to new labeling
of the mixture components.
object is of class NMixMCMC, the
resulting object is equal to object with the following
components being modified:
NMixMCMCNMixMCMCNMixMCMCNMixMCMCNMixMCMCNMixMCMCNMixMCMCNMixMCMCNMixMCMCNMixMCMClist component for each
quantile specified by prob argument.keep.comp.prob argument is
TRUE.object is of class GLMM_MCMC, the
resulting object is equal to object with the following
components being modified:
GLMM_MCMCGLMM_MCMCGLMM_MCMCGLMM_MCMCGLMM_MCMCGLMM_MCMCGLMM_MCMCGLMM_MCMCGLMM_MCMCGLMM_MCMClist component for each
quantile specified by prob argument.keep.comp.prob argument is
TRUE.list component for each
quantile specified by prob argument.keep.comp.prob argument is
TRUE. Remark. These are the component probabilities which should
normally be used for clustering purposes.
Jasra, A., Holmes, C. C., and Stephens, D. A. (2005). Markov chain Monte Carlo methods and the label switching problem in Bayesian mixture modeling. Statistical Science, 20, 50-67. Stephens, M. (1997). Bayesian methods for mixtures of normal distributions. DPhil Thesis. Oxford: University of Oxford. (Available from: http://stephenslab.uchicago.edu/publications.html (accessed on 05/02/2014)). Stephens, M. (2000). Dealing with label switching in mixture models. Journal of the Royal Statistical Society, Series B, 62, 795-809.
NMixMCMC, GLMM_MCMC.
## See also additional material available in
## YOUR_R_DIR/library/mixAK/doc/
## or YOUR_R_DIR/site-library/mixAK/doc/
## - file PBCseq.R and
## http://www.karlin.mff.cuni.cz/~komarek/software/mixAK/PBCseq.pdf
##
## ==============================================
Run the code above in your browser using DataLab