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

aic

Artificial Identifiability Constraints


Description

This function relabels the MCMC output by simply ordering a specific parameter. Let m, K and J denote the number of simulated MCMC samples, number of mixture components and different parameter types, respectively.

Usage

aic(mcmc.pars, constraint)

Arguments

mcmc.pars

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

constraint

An integer between 1 and J corresponding to the parameter that will be used to apply the Identifiabiality Constraint. In this case, the MCMC output is reordered according to the constraint

mcmc.pars[i,1,constraint] < … < mcmc.pars[i,K,constraint],

for all i=1,…,m. If constraint = "ALL", all J Identifiability Constraints are applied.

Value

permutations

an m\times K array of permutations.

Author(s)

Panagiotis Papastamoulis

See Also

Examples

#load a toy example: MCMC output consists of the random beta model
# applied to a normal mixture of \code{K=2} components. The number of
# observations is equal to \code{n=5}. The number of MCMC samples is
# equal to \code{m=300}. The 1000 generated MCMC samples are stored 
#to array mcmc.pars. 
data("mcmc_output")
mcmc.pars<-data_list$"mcmc.pars"

# mcmc parameters are stored to array \code{mcmc.pars}
# mcmc.pars[,,1]: simulated means of the two components
# mcmc.pars[,,2]: simulated variances of the two components
# mcmc.pars[,,3]: simulated weights of the two components
# We will apply AIC by ordering the means
# which corresponds to value \code{constraint=1}
run<-aic(mcmc = mcmc.pars,constraint=1)
# apply the permutations returned by typing:
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

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.