Description Usage Arguments Examples
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.
1 2 | SimpleSwitchMVN(MVNResult, pickRef = c("random", "last", "MaxLike"),
NumDim = 2, PropMin = 0.01)
|
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" |
1 2 | RESULT$
Unswitched<-SimpleSwitchMVN( RESULT, pickRef="last")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.