Generate data from a random DAG.
simulate_data(
n,
p,
prob_connect,
distr = c("student_t", "gaussian", "log_normal"),
tail_index = 1.5,
has_confounder = FALSE,
is_nonlinear = FALSE,
has_uniform_margins = FALSE
)
Positive integer. The number of observations, must be larger than 1.
Positive integer. The number of variables, must be larger than 1.
Numeric --- between 0 and 1. The probability that an edge \(i {\rightarrow} j\) is added to the DAG.
Character. The distribution of the noise. It is one of:
student_t
, in this case the user has to specify the
tail_index
, i.e., the degrees of freedom,
gaussian
,
log_normal
.
Positive numeric. The tail index, i.e., degrees of freedom, of the noise.
Boolean. Are there confounders in the system?
Boolean. Is the data generated non linear?
Boolean. Are the variables rescaled uniformly between 0 and 1?
List. The list is made of:
dataset
--- Numeric matrix. Dataset of simulated data with
n
rows and p
columns (note that the hidden variables are not
included in this matrix).
dag
--- Square binary matrix. The generated DAG, including
both the observed variables and the confounders,
if has_confounder = TRUE
.
pos_confounders
--- Integer vector. Represents the position
of confounders (rows and columns) in dag
.
If has_confounder = FALSE
, then pos_confounders = integer(0)
.