Learn R Programming

equSA (version 1.1.5)

DAGsim: Simulate a directed acyclic graph with mixed data (continuous and binary)

Description

Simulate a directed acyclic graph with mixed data (continuous and binary).

Usage

DAGsim(n, p, sparsity = 0.02, p.binary)

Arguments

n

number of observations.

p

number of variables.

sparsity

sparsity of the graph.

p.binary

number of binary variables.

Value

A list of four objects.

Adjacency.matrix

pxp The simulated adjacency matrix which indicates the true structure of directed acyclic graph. If the (i,j)th element is equal to 1, there exists a directed edge from \(X_i\) to eqnX_j.

Data

The simulated dataset in a nxp matrix.

gaussian.index

The index of continuous variables.

binary.index

The index of binary variables.

Details

The default value of sparsity is 0.02.

References

Kalisch, Markus and B\"uhlmann, Peter (2007). Estimating high-dimensional directed acyclic graphs with the PC-algorithm. Journal of Machine Learning Research, 8, 613-636.

Suwa, Xu and Faming, Liang (2017). Learning High-Dimensional Bayesian Networks for General Types of Random Variables. Submitted to Biometrika.

Examples

Run this code
# NOT RUN {
# library(equSA)
# set.seed(3)
# dagsim <- DAGsim(n = 3000, p = 100, sparsity = 0.02, p.binary = 50)
# data3000 <- dagsim$data
# cont_index  <- dagsim$gaussian.index
# binary_index<- dagsim$binary.index
# truegraph <- dagsim$Adjacency.matrix
# }

Run the code above in your browser using DataLab