fix_label {BAMBI}R Documentation

Fix label switching in angmcmc objects

Description

Fix label switching in angmcmc objects

Usage

fix_label(object, ...)

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.

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.

Examples

# 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)


[Package BAMBI version 2.3.5 Index]