<!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.fit 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.fit class"><tr><td>bn.fit class</td><td style="text-align: right;">R Documentation</td></tr></table>

<h2>The bn.fit class structure</h2>

<h3>Description</h3>

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


<h3>Details</h3>

<p>An object of class <code>bn.fit</code> is a list whose elements correspond to the
nodes of the Bayesian network. If the latter is discrete (i.e. the nodes are
multinomial random variables), the object also has class <code>bn.fit.dnet</code>;
each node has class <code>bn.fit.dnode</code> and contains the following elements:
</p>

<ul>
<li> <p><code>node</code>: a character string, the label of the node.
</p>
</li>
<li> <p><code>parents</code>: a vector of character strings, the labels of the
parents of the node.
</p>
</li>
<li> <p><code>children</code>: a vector of character strings, the labels of the
children of the node.
</p>
</li>
<li> <p><code>prob</code>: a (multi)dimensional numeric table, the conditional
probability table of the node given its parents.
</p>
</li></ul>

<p>Nodes encoding ordinal variables (i.e. ordered factors) have class
<code>bn.fit.onode</code> and contain the same elements as <code>bn.fit.dnode</code>
nodes. Networks containing only ordinal nodes also have class
<code>bn.fit.onet</code>, while those containing both ordinal and multinomial
nodes also have class <code>bn.fit.donet</code>.
</p>
<p>If on the other hand the network is continuous (i.e. the nodes are Gaussian
random variables), the object also has class <code>bn.fit.gnet</code>; each node
has class <code>bn.fit.gnode</code> and contains the following elements:
</p>

<ul>
<li> <p><code>node</code>: a character string, the label of the node.
</p>
</li>
<li> <p><code>parents</code>: a vector of character strings, the labels of the
parents of the node.
</p>
</li>
<li> <p><code>children</code>: a vector of character strings, the labels of the
children of the node.
</p>
</li>
<li> <p><code>coefficients</code>: a numeric vector, the linear regression
coefficients of the parents against the node.
</p>
</li>
<li> <p><code>residuals</code>: a numeric vector, the residuals of the linear
regression.
</p>
</li>
<li> <p><code>fitted.values</code>: a numeric vector, the fitted mean values of
the linear regression.
</p>
</li>
<li> <p><code>sd</code>: a numeric value, the standard deviation of the residuals
(i.e. the standard error).
</p>
</li></ul>

<p>Hybrid (i.e. conditional linear Gaussian) networks also have class
<code>bn.fit.gnet</code>. Gaussian nodes have class <code>bn.fit.gnode</code>, discrete
nodes have class <code>bn.fit.dnode</code> and conditional Gaussian nodes have
class <code>bn.fit.cgnode</code>. Each node contains the following elements:
</p>

<ul>
<li> <p><code>node</code>: a character string, the label of the node.
</p>
</li>
<li> <p><code>parents</code>: a vector of character strings, the labels of the
parents of the node.
</p>
</li>
<li> <p><code>children</code>: a vector of character strings, the labels of the
children of the node.
</p>
</li>
<li> <p><code>dparents</code>: an integer vector, the indexes of the discrete
parents in <code>parents</code>.
</p>
</li>
<li> <p><code>gparents</code>: an integer vector, the indexes of the continuous
parents in <code>parents</code>.
</p>
</li>
<li> <p><code>dlevels</code>: a list containing the levels of the discrete
parents in <code>parents</code>.
</p>
</li>
<li> <p><code>coefficients</code>: a numeric matrix, the linear regression
coefficients of the continuous parents. Each column corresponds to
a configuration of the discrete parents.
</p>
</li>
<li> <p><code>residuals</code>: a numeric vector, the residuals of the linear
regression.
</p>
</li>
<li> <p><code>fitted.values</code>: a numeric vector, the fitted mean values of the
linear regression.
</p>
</li>
<li> <p><code>configs</code>: an integer vector, the indexes of the configurations
of the discrete parents.
</p>
</li>
<li> <p><code>sd</code>: a numeric vector, the standard deviation of the residuals
(i.e. the standard error) for each configuration of the discrete parents.
</p>
</li></ul>

<p>Furthermore, Bayesian network classifiers store the label of the training node
in an additional attribute named <code>training</code>.
</p>


<h3>Author(s)</h3>

<p>Marco Scutari</p>


</body></html>
