Generate data for given DAG. The flexible framework allows for different distributions for source and child nodes. Default distributions are negative binomial (with mean = 100 and 1/dispersion = 100), and poisson, respectively.
simulate_data(
graph,
n = 100,
dist_fun = rnbinom,
dist_args = list(mu = 1000, size = 100),
child_fun = rpois,
child_args = list(),
child_dep = "lambda",
link_fun = negative.binomial.special()$linkfun,
link_args = list(offset = 1),
pop_size = 0,
latent = 0,
latent_fun = "unif"
)
# S4 method for igraph
simulate_data(
graph,
n = 100,
dist_fun = rnbinom,
dist_args = list(mu = 1000, size = 100),
child_fun = rpois,
child_args = list(),
child_dep = "lambda",
link_fun = negative.binomial.special()$linkfun,
link_args = list(offset = 1),
pop_size = 0,
latent = 0,
latent_fun = "unif"
)
# S4 method for graphNEL
simulate_data(
graph,
n = 100,
dist_fun = rnbinom,
dist_args = list(mu = 1000, size = 100),
child_fun = rpois,
child_args = list(),
child_dep = "lambda",
link_fun = negative.binomial.special()$linkfun,
link_args = list(offset = 1),
pop_size = 0,
latent = 0,
latent_fun = "unif"
)
# S4 method for matrix
simulate_data(
graph,
n = 100,
dist_fun = rnbinom,
dist_args = list(mu = 1000, size = 100),
child_fun = rpois,
child_args = list(),
child_dep = "lambda",
link_fun = negative.binomial.special()$linkfun,
link_args = list(offset = 1),
pop_size = 0,
latent = 0,
latent_fun = "unif"
)
Graph to simulate on
Number of samples
distribution function for nodes without parents
list of arguments for dist_fun
distribution function for nodes with parents
list of arguments for child_fun
link_fun computes an output for the expression of nodes without parents. this output is than used as input for child_fun. child_dep defines the parameter (a a string) of child_fun, which is used for the input. E.g., the link_fun is the identity and the child_fun is rnorm, we usually set child_dep = "mean".
special link function for the negative binomial distribution
list of arguments for link_fun
numeric for the population size, e.g., pop_size=1000 adds 1000-n random genes not in the graph
number of latent variables
uniform "unif" or exponential "exp" distribution of latent coefficients
graph
dag <- create_random_DAG(30, 0.2)
X <- simulate_data(dag)