Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

simulate-dag

Simulate DAGs


Description

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

Usage

simulateDag(node.name = NULL,
            data.dists = NULL, 
            edge.density = 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.

edge.density

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

Details

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

Value

An object of class abnDag a named matrix and a named list giving the distribution for each node.

Author(s)

Gilles Kratzer

References

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

Examples

## Example using Ozon entries:
dist <- list(Ozone="gaussian",   Solar.R="gaussian",  Wind="gaussian", 
             Temp="gaussian",    Month="gaussian",    Day="gaussian")
out <- simulateDag(node.name = names(dist), data.dists = dist, edge.density = 0.8)
plot(out)

abn

Modelling Multivariate Data with Additive Bayesian Networks

v2.5-0
GPL (>= 2)
Authors
Gilles Kratzer [aut, cre] (<https://orcid.org/0000-0002-5929-8935>), Fraser Iain Lewis [aut] (<https://orcid.org/0000-0003-4580-2712>), Reinhard Furrer [ctb] (<https://orcid.org/0000-0002-6319-2332>), Marta Pittavino [ctb] (<https://orcid.org/0000-0002-1232-1034>)
Initial release
2021-04-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.