Skip to contents

Creates a random Bayesian networks where the DAG simulation is based on bnlearn (Generates graphs whose node ordering is given by the order of the labels in the nodes argument)

Usage

randomBN(
  N_nodes,
  N_neighbours = 2,
  nodeDim = 2,
  method = "er",
  uniformCPTs = TRUE,
  visualize = FALSE
)

Arguments

N_nodes

number of nodes of the network (30 by default)

N_neighbours

expected number of neighbours per node (binary by default)

nodeDim

number of possible assignments of each node (binary by default)

method

Graph type input for randDAG ("er" by default)

uniformCPTs

whether CPTs are simulated from a uniform distribution

visualize

If true, the network is plotted

Value

random Bayesian network of type BN()