Description Usage Arguments Details Value Examples
Gibbs sampler for Depedent Dirichlet factor model.
1 2 3 |
data |
Required. A count matrix with species in rows and biological samples in column. |
hyper |
Required. A list of hyper-parameters in the priors. |
start |
A list of starting values of model parameters. Default is |
save.path |
A string contains the path to save the MCMC results.
For example, |
save.obj |
A list of model parameters that will be saved, default is all parameters. |
burnin |
A number between 0 and 1. Fraction of burn-in samples. Default is 0.2. |
thinning |
A positive integer. The MCMC results will be saved every |
step |
A positive integer. The total number of MCMC iterations. Default is 1000. |
step.disp |
A positive integer. A message will report the number of iterations finished
every |
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.
alpha
and beta
: hyper-parameters in the prior of sigma
. sigma
follows a
Poisson process on (0,1) with intensity ασ^{-1-β}\cdot(1-σ)^{-1/2+β} a priori.
a.er
and b.er
: hyper-parameters in the prior of er
. er
follows an inverse
gamma distribution 1/Gamma(a.er,b.er) a priori.
m
: number of factors the model is assumed to have. Usually a value much smaller than the number
of biological samples.
nv
: hyper-parameter of the prior of phi
. phi
follows Gamma(nv/2,nv/2) a priori.
a1
and a2
: hyper-parameters in the prior of delta
. The prior of delta[1]
is Gamma(a1,1)
and the prior of delta[2:m]
is independent Gamma(a2,1). a2
must not be smaller than 1 in order to
achieve factor shrinkage Bhattacharya et al. (2011).
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:
sigma
: a vector with p
components and the starting values have to be in (0,1).
Q
: a matrix with p
rows and n
columns and the starting values of Q
should be positive if the corresponding cell in data
is positive.
T.aug
: a vector with n
positive components.
X
: a m\times p matrix.
Y
: a m\times n matrix.
er
: a positive scalar.
delta
: a positive vector with m
components.
phi
: a n\times m positive matrix.
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.
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.