<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: The bn class structure</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="https://rpkg.net/assets/examples.css" />
</head><body>

<table width="100%" summary="page for bn class"><tr><td>bn class</td><td style="text-align: right;">R Documentation</td></tr></table>

<h2>The bn class structure</h2>

<h3>Description</h3>

<p>The structure of an object of S3 class <code>bn</code>.
</p>


<h3>Details</h3>

<p>An object of class <code>bn</code> is a list containing at least the following
components:
</p>

<ul>
<li> <p><code>learning</code>: a list containing some information about the results
of the learning algorithm. It's never changed afterward.
</p>

<ul>
<li> <p><code>whitelist</code>: a copy of the <code>whitelist</code> argument (a
two-column matrix, whose columns are labeled <code>from</code> and <code>to</code>)
as transformed by sanitization functions.
</p>
</li>
<li> <p><code>blacklist</code>: a copy of the <code>blacklist</code> argument (a
two-column matrix, whose columns are labeled <code>from</code> and <code>to</code>)
as transformed by sanitization functions.
</p>
</li>
<li> <p><code>test</code>: the label of the conditional independence test used by
the learning algorithm (a character string); the label of the network
score is used for score-based algorithms; the label of the network score
used in the &ldquo;Maximize&rdquo; phase of hybrid algorithms; &quot;none&quot; for
randomly generated graphs. For hybrid algorithms, <code>test</code> always
has the same value as <code>maxscore</code> (see below).
</p>
</li>
<li> <p><code>ntests</code>: the number of conditional independence tests or
score comparisons used in the learning (an integer value).
</p>
</li>
<li> <p><code>algo</code>: the label of the learning algorithm or the random
generation algorithm used to generate the network (a character string).
</p>
</li>
<li> <p><code>args</code>: a list. The values of the parameters of either the
conditional tests or the scores used in the learning process. Only the
relevant ones are stored, so this may be an empty list.
</p>

<ul>
<li> <p><code>alpha</code>: the target nominal type I error rate (a numeric
value) of the conditional independence tests.
</p>
</li>
<li> <p><code>iss</code>: a positive numeric value, the imaginary sample size
used by the <code>bge</code> and <code>bde</code> scores.
</p>
</li>
<li> <p><code>k</code>: a positive numeric value, the penalty coefficient
used by the <code>aic</code>, <code>aic-g</code>, <code>bic</code> and <code>bic-g</code>
scores.
</p>
</li>
<li> <p><code>prob</code>: the probability of each arc to be present in a
graph generated by the <code>ordered</code> graph generation algorithm.
</p>
</li>
<li> <p><code>burn.in</code>: the number of iterations for the <code>ic-dag</code>
graph generation algorithm to converge to a stationary (and uniform)
probability distribution.
</p>
</li>
<li> <p><code>max.degree</code>: the maximum degree for any node in a graph
generated by the <code>ic-dag</code> graph generation algorithm.
</p>
</li>
<li> <p><code>max.in.degree</code>: the maximum in-degree for any node in a
graph generated by the <code>ic-dag</code> graph generation algorithm.
</p>
</li>
<li> <p><code>max.out.degree</code>: the maximum out-degree for any node in
a graph generated by the <code>ic-dag</code> graph generation algorithm.
</p>
</li>
<li> <p><code>training</code>: a character string, the label of the training
node in a Bayesian network classifier.
</p>
</li>
<li> <p><code>threshold</code>: the threshold used to determine which arcs
are significant when averaging network structures.
</p>
</li>
<li> <p><code>prior</code>: the graphical prior used in combination with a
Bayesian score such as <code>bde</code> or <code>bge</code>.
</p>
</li>
<li> <p><code>beta</code>: the parameters of the graphical prior.
</p>
</li></ul>

</li></ul>

</li>
<li> <p><code>nodes</code>: a list. Each element is named after a node and contains
the following elements:
</p>

<ul>
<li> <p><code>mb</code>: the Markov blanket of the node (a vector of character
strings).
</p>
</li>
<li> <p><code>nbr</code>: the neighbourhood of the node (a vector of character
strings).
</p>
</li>
<li> <p><code>parents</code>: the parents of the node (a vector of character
strings).
</p>
</li>
<li> <p><code>children</code>: the children of the node (a vector of character
strings).
</p>
</li></ul>

</li>
<li> <p><code>arcs</code>: the arcs of the Bayesian network (a two-column matrix,
whose columns are labeled <code>from</code> and <code>to</code>). Undirected arcs
are stored as two directed arcs with opposite directions between the
corresponding incident nodes.
</p>
</li></ul>

<p>Additional (optional) components under <code>learning</code>:
</p>

<ul>
<li> <p><code>optimized</code>: whether additional optimizations have been used in
the learning algorithm (a boolean value).
</p>
</li>
<li> <p><code>illegal</code>: arcs that are illegal according to the parametric
assumptions used to learn the network structure (a two-column matrix,
whose columns are labeled <code>from</code> and <code>to</code>).
</p>
</li>
<li> <p><code>restrict</code>: the label of the constraint-based algorithm used in
the &ldquo;Restrict&rdquo; phase of a hybrid learning algorithm (a character
string).
</p>
</li>
<li> <p><code>rtest</code>: the label of the conditional independence test used in
the &ldquo;Restrict&rdquo; phase of a hybrid learning algorithm (a character
string).
</p>
</li>
<li> <p><code>maximize</code>: the label of the score-based algorithm used in the
&ldquo;Maximize&rdquo; phase of a hybrid learning algorithm (a character
string).
</p>
</li>
<li> <p><code>maxscore</code>: the label of the network score used in the
&ldquo;Maximize&rdquo; phase of a hybrid learning algorithm (a character
string).
</p>
</li>
<li> <p><code>max.sx</code>: the maximum allowed size of the conditioning sets
in the conditional independence tests used in constraint-based algorithms.
</p>
</li></ul>



<h3>Author(s)</h3>

<p>Marco Scutari</p>


</body></html>
