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-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.

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:

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.

[Package DIRECT version 1.0.1 Index]