Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

permute.mcmc

Reorder MCMC samples


Description

This function applies the permutation returned by any relabelling algorithm to a simulated MCMC output.

Usage

permute.mcmc(mcmc, permutations)

Arguments

mcmc

m\times K\times J array of simulated MCMC parameters.

permutations

m\times K dimensional array of permutations.

Value

output

m\times K\times J array of reordered MCMC parameters.

Author(s)

Panagiotis Papastamoulis

See Also

Examples

#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

label.switching

Relabelling MCMC Outputs of Mixture Models

v1.8
GPL-2
Authors
Panagiotis Papastamoulis
Initial release
2019-07-01

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.