| resampleClusterProb {DIRECT} | R Documentation |
Resampling to Estimate Posterior Allocation Probability Matrix
Description
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.
Usage
resampleClusterProb(file.out, ts, nitem, ntime, nrep,
pars.mcmc, cs.mcmc, alpha.mcmc, nstart, nres)
Arguments
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. |
Value
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.
Note
resampleClusterProb calls the following functions adapted or directly taken from existing R functions:
-
dMVNormis adapted fromdmvnormby Friedrich Leisch and Fabian Scheipl in packagemvtnorm. -
rMVNormis adapted fromrmvnormby Friedrich Leisch and Fabian Scheipl in packagemvtnorm. -
rDirichletis taken fromrdirichletby Gregory R. Warnes, Ben Bolker and Ian Wilson in packagegregmisc. -
dDirichletis based onddirichletby Gregory R. Warnes, Ben Bolker and Ian Wilson in packagegregmisc.
Author(s)
Audrey Q. Fu
References
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.
See Also
DIRECT for the complete method.
DPMCMC for the MCMC sampler under the Dirichlet-process prior.
relabel for relabeling in posterior inference.
Examples
## See example for DIRECT.