simdata | R Documentation |
This function generates a data matrix (n \times p
) under Poisson, NB,
or ZINB assumptions, based on Karlis (or LPGM. 2013) with adjancency matrix B.
simdata(
n,
p,
B,
family = c("Poisson", "NB", "ZINB"),
mu,
mu_noise,
theta = NA,
pi = NA
)
n |
number of samples |
p |
number of variables (nodes) |
B |
adjacency matrix |
family |
the distribution from which to simulate (Poisson, NB, ZINB) |
mu |
mean of the non-zero component |
mu_noise |
mean of noise |
theta |
dispersion parameter of the non-zero component,
where |
pi |
probability of zero inflation |
p <- 4
B <- matrix(c(0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0), nrow=p)
n <- 10
simdata(n, p, B, mu = 5, mu_noise=1)
simdata(n, p, B, mu = 5, mu_noise=1, family="NB", theta=1)
simdata(n, p, B, mu = 5, mu_noise=1, family="ZINB", theta=1, pi=0.2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.