DirFactor: Gibbs sampler for Depedent Dirichlet factor model.

Description Usage Arguments Details Value Examples


Gibbs sampler for Depedent Dirichlet factor model.


DirFactor(data, hyper, start = NA, save.path = NA, save.obj = c("sigma",
  "Q", "T.aug", "X", "Y", "er", "delta", "phi"), burnin = 0.2, thinning = 5,
  step = 1000, step.disp = 10)



Required. A count matrix with species in rows and biological samples in column.


Required. A list of hyper-parameters in the priors.


A list of starting values of model parameters. Default is NA and the starting values will be generated automatically based on the input data. See Details for the required fields of the list.


A string contains the path to save the MCMC results. For example, save.path="~/sim" will save results of the ith iteration to ~/sim_i.rds. Default is NA and a temp directory will be assigned.


A list of model parameters that will be saved, default is all parameters.


A number between 0 and 1. Fraction of burn-in samples. Default is 0.2.


A positive integer. The MCMC results will be saved every thinning iterations. Default is 5.


A positive integer. The total number of MCMC iterations. Default is 1000.


A positive integer. A message will report the number of iterations finished every step.disp iterations. Default is 10.


The Dependent Dirichlet process factor model assumes the observed data is distributed according to a multinomial distrition for each biological sample, conditioning on the probabilities of species, which is assumed to follow a Dependent Dirichlet processes a priori. The model has two major parts. sigma, Q directly specify the probabilities of species in each biological samples and X, Y, er, delta, phi specify the hyper-prior on Q. T.aug is an auxilary parameter and does not have direct interpretation. More details on model and prior specification can be found in Ren et. al. (2016).

Users are required to provide a list containing the values of the hyper-parameters. The list must contain fields as following.

If the users want to specify the starting values for the model parameters, they can pass a list with fields sigma, Q, T.aug, X, Y, er, delta, phi to the function augment start. Assume there are n biological samples and p species in data. Each field is specified as following:


A list with two fields: running.time and save.path. running.time is the total amount of time for finishing the MCMC simulation. save.path is the path to the saved results.


my.hyper = list( nv = 3, a.er = 1, b.er = 0.3, a1 = 3, 
                 a2 = 4, m = 10, alpha = 10, beta = 0 )
my.sim = SimDirFactorBlock( 1e6, n = 22, p = 68, m = 3, my.hyper, K = 2 )
DirFactor( my.sim$data[[1]], my.hyper, save.obj = c("Y", "er"), step.disp = 100 )

boyuren158/DirFactor documentation built on May 13, 2019, 1:38 a.m.