Description Usage Arguments Value Author(s) See Also Examples
This function applies the permutation returned by any relabelling algorithm to a simulated MCMC output.
1 | permute.mcmc(mcmc, permutations)
|
mcmc |
m\times K\times J array of simulated MCMC parameters. |
permutations |
m\times K dimensional array of permutations. |
output |
m\times K\times J array of reordered MCMC parameters. |
Panagiotis Papastamoulis
label.switching
, ecr
, ecr.iterative.1
, ecr.iterative.2
,stephens
,pra
, sjw
, aic
, dataBased
1 2 3 4 5 6 7 8 9 10 11 12 13 | #load MCMC simulated data
data("mcmc_output")
mcmc.pars<-data_list$"mcmc.pars"
z<-data_list$"z"
K<-data_list$"K"
#apply \code{ecr.iterative.1} algorithm
run<-ecr.iterative.1(z = z, K = 2)
#reorder the MCMC output according to this method:
reordered.mcmc<-permute.mcmc(mcmc.pars,run$permutations)
# reordered.mcmc[,,1]: reordered means of the two components
# reordered.mcmc[,,2]: reordered variances of the components
# reordered.mcmc[,,3]: reordered weights of the two components
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.