Description Usage Arguments Value Examples
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)
1 | random.bn.fit(nodes, num.neigh=2, prob.distr=prob.distr.norm, bn.graph)
|
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 |
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
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.