View source: R/GcClusterFunctions.R
combineChains | R Documentation |
Combine and arrange selected, individual chains to create a set of chains.
combineChains(samplePars, selectedChains, procDir = ".")
samplePars |
List containing, among other things, the names of the files in which the
|
selectedChains |
Dataframe listing the indices of the chains that are combined. (See Details). |
procDir |
Directory containing the files with the |
Argument selectedChains
is a dataframe with two columns. The first
column, for which the heading is "Chain," comprises the indices of the chains
that will be combined. The second column, for which the heading is
"isSwitched", comprises logical values (that is, TRUE or FALSE), which
indicate whether the variables in the associated chain are switched.
To understand selectedChains
consider two examples. (1) Assume that
row 1 of selectedChains
comprises the values 2 and FALSE. These
values
indicate that chain 2 will be included in the combination and that
the variables in the
finite mixture model are not switched. That is, variable mu1 in the
chain is assigned to mu1, variable mu2 in the chain is assigned to mu2, and
so on. (2) Assume that
row 2 of selectedChains
comprises the values 4 and TRUE. These
values
indicate that chain 4 will be included in the combination and
that the variables in the
finite mixture model are switched. That is, variable mu1 in the
chain is assigned to mu2, variable mu2 in the chain is assigned to mu1, and
so on.
The returned value is a stanfit
object,
which is described in the rstan documentation. This object comprises
the multiple chains, which have samples of
the following model parameters:
Parameter | Description |
theta | Proportion of population associated with pdf 1. |
mu1 | Mean vector for pdf 1. |
mu2 | Mean vector for pdf 2. |
tau1 | Standard deviation vector for pdf 1. |
tau2 | Standard deviation vector for pdf 2. |
L_Omega1 | Cholesky decomposition of the correlation matrix for pdf 1. |
L_Omega2 | Cholesky decomposition of the correlation matrix for pdf 2. |
log_lik | The logarithm of the likelihood function. |
Stan Development Team, 2015, Stan Modeling Language - Users Guide and Reference Manual, Version 2.6.0, available on line at http://mc-stan.org/ (last accessed October 2015).
## Not run:
combinedChains <- combineChains(samplePars, selectedChains)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.