View source: R/all_postprodn_fns.R
fix_label | R Documentation |
Fix label switching in angmcmc objects
fix_label(object, ...)
object |
angular MCMC object. |
... |
arguments other than |
fix_label
is a wrapper for label.switching from
package label.switching
for angmcmc
objects. The arguments
z, K, complete, mcmc, p
and data
are appropriately filled in
from object
. The label.switching
argument method
can
be a scalar or vector; for this wrapper it defaults to "STEPHENS"
if the angmcmc
was
created with permutation sampling (by setting perm_sampling = TRUE in
fit_angmix), and to "DATA-BASED"
otherwise.
Returns a single angmcmc
object or a list of angmcmc
objects (according as whether
the argument method
is a scalar or vector) with label switchings corrected (after burn-in and thin)
according to the resulting permutation from label.switching.
# first fit a vmsin mixture model # illustration only - more iterations needed for convergence fit.vmsin.20 <- fit_vmsinmix(tim8, ncomp = 3, n.iter = 20, n.chains = 1) # now apply fix_label fit.vmsin.20.fix <- fix_label(fit.vmsin.20)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.