MBASIC.sim: Simulate data for the general MBASIC model.

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Simulate data for the general MBASIC model.

Usage

1
2
MBASIC.sim(xi, family = "lognormal", struct = NULL, I, fac, J, S = 2,
  f = 5, delta = NULL, delta.non = NULL, zeta = 0.1, statemap = NULL)

Arguments

xi

Parameter for the magnitude of each observations. See details for more information.

family

A parameter for the family of distribution to be used, must be "lognormal", "negbin" or "binom". Default: "lognormal".

struct

An K by J integer matrix. The j-th column denotes the levels for the cluster level parameter. See details for more information. Default: NULL.

I

An integer for the total number of units.

fac

A vector of length N denoting the experimental condition for each replicate.

J

An integer for the number of clusters.

S

An integer for the number of states. Default: 2.

f

A numerical value that determine the difference of the means between different states. See details for more information. Default: 5.

delta

A vector of length S, or NULL. This is the dirichlet prior parameter to simulate the probability across the S states for each CLUSTERED unit and each experiment. If NULL, rep(0.1,S) is used.

delta.non

A vector of length S, or NULL. This is the dirichlet prior parameter to simulate the probability across the S states for each UNCLUSTERED unit and each experiment. If NULL, rep(0.1,S) is used.

zeta

The probability that each unit does not belong to any cluster. Default: 0.1.

Details

MBASIC.sim allows three types of distributions:
For the "lognormal" family, entries in the matrix Y follows distribution: log(Y[n,i] + 1) | Theta[n,i]=s ~ N(Mu[n,s], stdev[s]).
For the "negbin" family, entries in the matrix Y follows distribution: Y[n,i] | Theta[n,i]=s ~ NB(Mu[n,s], stdev[s]).
For the "binom" family, entries in the matrices X and Y follows distribution: X[n,i] ~ Pois(xi), Y[n,i]| Theta[n,i]=s,X[n,i] ~ Binom(X[n,i],Mu[n,s]). In this package, NB(mu,size) denotes a Negative binomial distribution with mean mu and variance mu(1+mu/size).
For "lognormal" or "negbin" families, Mu[n,s]~N(prior.mean[s],prior.sd[s]). Hyper paramters prior.mean and prior.sd are set differently under the two distributional families. For the "lognormal" family, where prior.mean[s] = xi+log((s-1)(f-1)+1), and prior.sd=log(f)/30. For the "negbin" family, prior.mean[s]=xi*((s-1)(f-1)+1), and prior.sd=(f-1)*xi/6. In general, xi is the mean for the state S=1, and f is roughly the ratio between the means from state S=2 and S=1.
For the "binom" family, Mu[n,s] ~ Beta(s * f, (S + 1 - s) * f).

Value

A list containing:

Y An N by I matrix. The (n,i)-th entry is the observed value at the i-th unit for the n-th experiment.
X An N by I matrix for the "binom" family, or NULL otherwise. The (n,i)-th entry is the observed size parameter for the i-th unit in the n-th experiment.
fac Same as the input argument fac.
Theta A K by I matrix. The (k,i)-th element is the indicator of whether the i-th unit is binding for condition k.
W A K by (J*S) matrix. The (k,J*(s-1)+j)-th entry is the probability of units in the j-th cluster have state s under the k-th experimental condition.
Z An I by J matrix. Each column is the indicator for an individual loci set.
delta Same as the input argument delta.
zeta Same as the input argumnent zeta.
non.id A vector of length I indicating the number of each unit not to belong to any cluster.
prior.mean A vector of length S, the hyper means for the S states for each experiment.
prior.sd A vector of length S, the hyper parameters for the dispersions for the S states for each experiment.
Mu A N by S matrix. The (n,s)-th entry is the mean values of the response for the s-th state in the n-th experiment.
stdev A vector of length S. The dispersion parameter for the S states for the observed data.

Author(s)

Chandler Zuo zuo@stat.wisc.edu

See Also

MBASIC.sim.state

Examples

1
dat.sim <- MBASIC.sim(xi = 2, I = 100, fac = rep(1:5, each = 2), J = 3)

chandlerzuo/mbasic documentation built on May 13, 2019, 3:24 p.m.