labelswitch: Label switching correction.

Description Usage Arguments Details Value References See Also

View source: R/labelswitch.R

Description

This function corrects for the issue of label switching when fitting mixture models in a Bayesian setting.

Usage

1
2
labelswitch(mu, sigma2, lambda, tau, K, G, d, perms, muMAP, iter, uphill,
  burnin, thin, s, x.mix)

Arguments

mu

A G x d matrix of mean latent locations.

sigma2

A vector of length G containing the covariance of the latent locations within each cluster.

lambda

An n x G matrix of mixing proportions.

tau

A matrix of logistic regression coefficients, with G rows and number of columns equal to the number of covariates in the mixing proportions model plus 1, for the intercept.

K

Vector of length n detailing the number of the cluster to which each node belongs.

G

The number of clusters in the model being fitted.

d

The dimension of the latent space.

perms

A G! x G matrix of all possible permutations of 1:G (output by permutations(G), say).

muMAP

A G x d matrix of maximum a posteriori latent location means, obtained at the end of the uphill only section of the MCMC chain. Used as the template to correct for label switching.

iter

Iteration number.

uphill

Number of iterations for which uphill only steps in the MCMC chain should be run.

burnin

Number of iterations of the MCMC chain which should not be included in a posteriori summaries.

thin

Thinning frequency of the MCMC chain to ensure independent samples.

s

Number of columns in the reformatted covariates matrix for the mixing proportions model, output by formatting.covars.

x.mix

The reformatted covariates matrix for the mixing proportions model, output by formatting.covars.

Details

The muMAP matrix is used as the reference to which each new estimate the cluster means is matched to correct for any label switching which may have occurred during sampling. A sum of squares function is employed as the loss function.

Value

A list containing:list(mu, sigma2, lambda, tau, K)

mu

The label-corrected matrix of cluster means.

sigma2

The label-corrected vector of cluster covariances.

lambda

The label-corrected matrix of mixing proportions.

tau

The label-corrected matrix of logistic regression coefficients for the mixing proportions model.

K

The label-corrected vector of length n detailing the number of the cluster to which each node belongs.

References

Isobel Claire Gormley and Thomas Brendan Murphy. (2010) A Mixture of Experts Latent Position Cluster Model for Social Network Data. Statistical Methodology, 7 (3), pp.385-405.

See Also

MEclustnet


MEclustnet documentation built on Oct. 10, 2019, 5:04 p.m.