resampleClusterProb function

Resampling to Estimate Posterior Allocation Probability Matrix

Resampling to Estimate Posterior Allocation Probability Matrix

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)

Arguments

  • file.out: Name of file containing samples of posterior allocation probability matrix.
  • ts: A nitem-by-ntime-by-nrep array of data.
  • 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 DPMCMC.
  • 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 DPMCMC.
  • alpha.mcmc: A vector of MCMC samples of α\alpha, the concentration parameter in the Dirichlet-process prior, stored in the last column of file *_mcmc_cs.out, one of the output files from DPMCMC.
  • nstart: Starting from which recorded MCMC sample.
  • nres: How many times to draw resamples? Multiple samples are averaged.

Returns

Samples of the allocation probability matrix are written to file *_mcmc_probs.out. This file contains a large matrix of HN×KHN \times K, which is HH posterior allocation probability matrices stacked up, each individual matrix of N×KN \times K, where HH is the number of recorded MCMC samples, NN the number of items and KK the inferred number of mixture components.

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.

Author(s)

Audrey Q. Fu

Note

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.

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.
  • Maintainer: Audrey Q. Fu
  • License: GPL (>= 2)
  • Last published: 2023-09-07

Useful links