bn.fit class {bnlearn} R Documentation

The bn.fit class structure

Description

The structure of an object of S3 class bn.fit.

Details

An object of class bn.fit is a list whose elements correspond to the nodes of the Bayesian network. If the network is discrete (the nodes are multinomial random variables), the object also has class bn.fit.dnet. Each node has class bn.fit.dnode and contains the following elements:

  • node: a character string, the label of the node.

  • parents: a vector of character strings, the labels of the parents of the node.

  • children: a vector of character strings, the labels of the children of the node.

  • prob: a (multi)dimensional numeric table, the conditional probability table of the node given its parents.

Nodes encoding ordinal variables (ordered factors) have class bn.fit.onode and contain the same elements as bn.fit.dnode nodes. Networks with only ordinal nodes also have class bn.fit.onet, while those containing both ordinal and multinomial nodes also have class bn.fit.donet.

If, on the other hand, the network is continuous (that is, the nodes are Gaussian random variables), the object also has class bn.fit.gnet; each node has class bn.fit.gnode and contains the following elements:

  • node: a character string, the label of the node.

  • parents: a vector of character strings, the labels of the parents of the node.

  • children: a vector of character strings, the labels of the children of the node.

  • coefficients: a numeric vector, the linear regression coefficients of the parents against the node.

  • residuals: a numeric vector, the residuals of the linear regression.

  • fitted.values: a numeric vector, the fitted mean values of the linear regression.

  • sd: a numeric value, the standard deviation of the residuals (that is, the standard error).

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

  • node: a character string, the label of the node.

  • parents: a vector of character strings, the labels of the parents of the node.

  • children: a vector of character strings, the labels of the children of the node.

  • dparents: an integer vector, the indexes of the discrete parents in parents.

  • gparents: an integer vector, the indexes of the continuous parents in parents.

  • dlevels: a list containing the levels of the discrete parents in parents.

  • coefficients: a numeric matrix, the linear regression coefficients of the continuous parents. Each column corresponds to a configuration of the discrete parents.

  • residuals: a numeric vector, the residuals of the linear regression.

  • fitted.values: a numeric vector, the fitted mean values of the linear regression.

  • configs: an integer vector, the indexes of the configurations of the discrete parents.

  • sd: a numeric vector, the standard deviation of the residuals (the standard error) for each configuration of the discrete parents.

Zero-Inflated (non-integer count) networks also have class bn.fit.zihp (hyper-Poisson) or bn.fit.zinb (negative binomial). Zero-inflated hyper-Poisson nodes have class bn.fit.zihpnode and contain the following elements:

  • node: a character string, the label of the node.

  • parents: a vector of character strings, the labels of the parents of the node.

  • children: a vector of character strings, the labels of the children of the node.

  • inflation: a numeric vector, the coefficients of the zero-inflation (logistic) regression model associated with the parents.

  • intensity: a numeric vector, the coefficients of the (log-linear) regression model for the Poisson intensity parameter associated with the parents.

  • dispersion: a numeric value, the dispersion parameter that augments the Poisson (pseudo)counts into a hyper-Poisson distribution.

Zero-inflated negative binomial nodes have class bn.fit.zinbnode and contain the following elements:

  • node: a character string, the label of the node.

  • parents: a vector of character strings, the labels of the parents of the node.

  • children: a vector of character strings, the labels of the children of the node.

  • inflation: a numeric vector, the coefficients of the zero-inflation (logistic) regression model associated with the parents.

  • prsucc: a numeric vector, the coefficients of the (logistic) regression model for the probability of success parameter associated with the parents.

  • failures: a numeric value, the number of failures.

In addition, Bayesian network classifiers store the label of the training node in an attribute named training.

An object of class bn.fit may also have auxiliary class labels, depending on how it has been created. In particular:

  • bn.naive, identifying naive Bayes classifiers from naive.bayes();

  • bn.tan, identifying tree-augmented naive Bayes (TAN) classifiers from tree.bayes();

  • bn.twin, identifying twin networks from twin();

  • bn.ctf, identifying counterfactual networks from twin().

Author(s)

Marco Scutari


[Package bnlearn version 5.2-20260704 Index]