resampleClusterProb {DIRECT} | R Documentation |
The resampling method as part of the posterior inference under DIRECT
. It uses stored MCMC samples to generate realizations of the allocation probability matrix, and writes the realizations to a user-specified external file.
resampleClusterProb(file.out, ts, nitem, ntime, nrep,
pars.mcmc, cs.mcmc, alpha.mcmc, nstart, nres)
file.out |
Name of file containing samples of posterior allocation probability matrix. |
ts |
A |
nitem |
Number of items. |
ntime |
Number of time points. |
nrep |
Number of replicates. |
pars.mcmc |
A matrix or data frame of MCMC samples of mean vectors and random effects stored in file *_mcmc_pars.out, one of the output files from |
cs.mcmc |
A matrix or data frame of MCMC samples of assignments of mixture components stored in file *_mcmc_cs.out, one of the output files from |
alpha.mcmc |
A vector of MCMC samples of |
nstart |
Starting from which recorded MCMC sample. |
nres |
How many times to draw resamples? Multiple samples are averaged. |
Samples of the allocation probability matrix are written to file *_mcmc_probs.out. This file contains a large matrix of HN \times K
, which is H
posterior allocation probability matrices stacked up, each individual matrix of N \times K
, where H
is the number of recorded MCMC samples, N
the number of items and K
the inferred number of mixture components.
resampleClusterProb
calls the following functions adapted or directly taken from existing R functions:
dMVNorm
is adapted from dmvnorm
by Friedrich Leisch and Fabian Scheipl in package mvtnorm
.
rMVNorm
is adapted from rmvnorm
by Friedrich Leisch and Fabian Scheipl in package mvtnorm
.
rDirichlet
is taken from rdirichlet
by Gregory R. Warnes, Ben Bolker and Ian Wilson in package gregmisc
.
dDirichlet
is based on ddirichlet
by Gregory R. Warnes, Ben Bolker and Ian Wilson in package gregmisc
.
Audrey Q. Fu
Fu, A. Q., Russell, S., Bray, S. and Tavare, S. (2013) Bayesian clustering of replicated time-course gene expression data with weak signals. The Annals of Applied Statistics. 7(3) 1334-1361.
DIRECT
for the complete method.
DPMCMC
for the MCMC sampler under the Dirichlet-process prior.
relabel
for relabeling in posterior inference.
## See example for DIRECT.