Learn R Programming

BAMBI (version 2.3.5)

fix_label: Fix label switching in angmcmc objects

Description

Fix label switching in angmcmc objects

Usage

fix_label(object, ...)

Value

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.

Arguments

object

angular MCMC object.

...

arguments other than z, K, complete, mcmc, p and data passed to label.switching. See details.

Details

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.

Examples

Run this code
# 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)

Run the code above in your browser using DataLab