Learn R Programming

abn (version 1.3)

simulateDag: Simulate DAGs

Description

Simulate a Directed Acyclic Graph (ABN) with arbitrary arc density.

Usage

simulateDag(node.name = NULL, 
            data.dists = NULL, 
            nn = 0.5)

Arguments

node.name

a vector of character giving the names of the nodes. It gives the size of the simulated DAG.

data.dists

named list giving the distribution for each node in the network. If not provided it will be sample and returned.

nn

a real number between 0 and 1 giving the network density.

Value

A list containing a named matrix and a named list giving the distribution for each node.

Details

This function generates DAGs by sampling triangular matrices and reorder randomly columns and rows. The network density (nn) is used column wise as binomial sampling probability. Then the matrix is named using the user provided names.

References

Further information about abn can be found at: http://www.r-bayesian-networks.org

Examples

Run this code
# NOT RUN {
##example using Ozon entries:

dist <- list(Ozone="gaussian",
Solar.R="gaussian",
Wind="gaussian",
Temp="gaussian",
Month="gaussian",
Day="gaussian")
simulateDag(node.name = names(dist),data.dists = dist,nn = 0.8)
# }

Run the code above in your browser using DataLab