random-dot-bn-dot-fit: Generate a random 'bn.fit' network

Description Usage Arguments Value Examples

Description

Generate a random Bayesian network using package bnlearn. The nodes specify the partial ordering of the graph, and the conditional probabilities are sampled from given distribution. The network is generated to have on average given number of neighbours (i.e. both in-going and out-going edges)

Usage

1
random.bn.fit(nodes, num.neigh=2, prob.distr=prob.distr.norm, bn.graph)

Arguments

nodes

a vector of desired node names (basis for partial ordering)

num.neigh

expected number of neighbours per node in the random graph

prob.distr

the probability distribution function to use

bn.graph

the bn object with an already laid out graph, if not supplied will be generated

Value

a list of two elements: bn - a bn object which contains the structure and bn.fit - a bn.fit object with filled in conditional probabilities

Examples

1
2
# a random network with 3 nodes "A", "B", "C" with average of 1 neighbour
random.bn.fit(c("A", "B", "C"), num.neigh=1)

ddgraph documentation built on Nov. 17, 2017, 10:50 a.m.