SimpleSwitchMVN: This function fixes the label switching in the output of a...

Description Usage Arguments Examples

Description

This function fixes the label switching in the output of a Multivariate Gibbs sampler. Requires a constant number of non-empty groups in samples, but can deal with empty groups.

Usage

1
2
SimpleSwitchMVN(MVNResult, pickRef = c("random", "last", "MaxLike"),
  NumDim = 2, PropMin = 0.01)

Arguments

pickRef;

'random'= reference picked as a random iteration 'last'= Reference is final iteration "MaxLike"= Reference is chosen as iteration maximising Log LIkelihood, (MVNResult$Loglike)

MVNResult:

LIST of output of Gibbs sampler with the following components:

[[Zs]] estimated component (allocation) for each Y at each iteration (by rows=Iterations, Columns=1:n)

[P]] matrix of weights, columns - K, rows = Iterations

[[Mu]] Data frame with columns: Mu_1. Mu_2, .. ...,Mu_r , k (this is the group), Iteration.

[[Loglike]] OPTIONAL: Loglikelihood (vector the length of iterations). Needed only if PickRef=="MaxLike"

Examples

1
2
RESULT$
	Unswitched<-SimpleSwitchMVN( RESULT, pickRef="last")

zoevanhavre/Zmix_devVersion2 documentation built on May 4, 2019, 11:25 p.m.