Learn R Programming

ddgraph (version 1.16.0)

random.bn.fit: Generate a random bn.fit network

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

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

bn - a bn object which contains the structure and bn.fit - a bn.fit object with filled in conditional probabilities

Examples

Run this code
random.bn.fit(c("A", "B", "C"), num.neigh=1)

Run the code above in your browser using DataLab