compareMultipleChains {factor.switching}R Documentation

Compare multiple chains

Description

Compares multiples chains after each one of them has been post-processed by the RSP algorithm, so that all of them are switched into a similar labelling.

Usage

compareMultipleChains(rspObjectList, scheme, sa_loops, maxIter, threshold)

Arguments

rspObjectList

A list consisting of rsp objects.

scheme

Character argument with possible values: "exact" (default), "partial" or "full".

sa_loops

Number of simulated annealing loops (only applicable when "exact" is disabled).

maxIter

Max number of iterations.

threshold

Threshold for convergence.

Value

reorderedChains: an object of class mcmc.list containing all simultaneously processed chains.

Author(s)

Panagiotis Papastamoulis

Examples

# load 2 chains each one consisting of a 
#	small mcmc sample of 100 iterations
#	with p=6 variables and q=2 factors.
data(small_posterior_2chains)
Nchains <- length(small_posterior_2chains)
reorderedPosterior <- vector('list',length=Nchains)
for(i in 1:Nchains){
	reorderedPosterior[[i]] <- rsp_exact( lambda_mcmc = small_posterior_2chains[[i]], 
			maxIter = 100, 
			threshold = 1e-6, 
			verbose=TRUE )
}
# make them comparable
makeThemSimilar <- compareMultipleChains(rspObjectList=reorderedPosterior)

[Package factor.switching version 1.4 Index]