catNetwork-class {catnet} | R Documentation |

This is the base class in the `catnet`

package for representing Bayesian networks with categorical values.
It stores both the graph and probability structure of categorical Bayesian networks.
Technically, `catNetwork`

is a S4 type of R-class implemented in object-oriented style, with slots representing object components and members for accessing and manipulating class objects. Below we list the slots of `catNetwork`

and some of its main members along with the functions for creating `catNetwork`

objects.

The `catNetwork`

class provides a comprehensive general structure for representing
discrete Bayesian networks by describing both the graph and probability structures.
Although available for direct access, the class components, its slots, should not be manipulated directly but using the class members instead. A `catNetwork`

object integrity can always be checked by calling `is(object, "catNetwork")`

.

Objects can be created by calls of

`cnNew(nodes, cats, parents, probs)`

`cnRandomCatnet(numnodes, maxParents, numCategories)`

`cnCatnetFromEdges(nodes, edges, numCategories)`

`cnCatnetFromSif(file)`

`objectName`

an optional object name of class

`character`

.`numnodes`

:an integer, the number of nodes in the object.

`nodes`

:a

`vector`

specifying the node names.`parents`

:a

`list`

specifying the node parents. The list`parents`

must be the same length as`nodes`

. Parents are kept as indices in the`nodes`

vector.`categories`

:a

`list`

of characters specifying a set of categorical values for each node.`probabilities`

:a numerical

`list`

that for each node specifies a discrete probability distribution - the distribution of the node conditional on its parent set. The elements of`probabilities`

are lists themselves. See`cnProb`

function for more details.`maxParents`

:an integer, the maximum number of node parents.

`maxCategories`

:an integer, the maximum number of node categories.

`meta`

:an object of class

`character`

storing some meta-data information.`nodeComplexity`

:a numerical

`vector`

, the node complexities.`nodeLikelihood`

:a numerical

`vector`

, the node likelihoods of the sample being used for estimation.`complexity`

:an

`integer`

, the network complexity`likelihood`

:a

`numerical`

, the total likelihood of the sample being used for estimation`nodeSampleSizes`

:a numerical

`vector`

, if the object is an estimate, the node sample sizes.

- cnNew
`signature`

(nodes="`vector`

", cats="`list`

", parents="`list`

", probs="`list`

"): Creating a new class object.- cnRandomCatnet
`signature`

(numnodes="`integer`

", maxParents="`integer`

", numCategories="`integer`

"): Creating a random class object.- cnCatnetFromEdges
`signature`

(nodes="`vector`

", edges="`list`

", numCategories="`integer`

"): Deriving a class object from a list of edges.- cnCatnetFromSif
`signature`

(file="`character`

"): Creating a class object from a file.- cnNumNodes
`signature`

(object="`catNetwork`

"):- cnNodes
`signature`

(object="`catNetwork`

", which="`vector`

"):...- cnSubNetwork
`signature`

(object="`catNetwork`

", nodeIndices="`vector`

", indirectEdges="`logical`

"):...- cnReorderNodes
`signature`

(object="`catNetwork`

", nodeIndices="`vector`

"):...- cnParents
`signature`

(object="`catNetwork`

", which="`vector`

"):...- cnMatParents
`signature`

(object="`catNetwork`

", nodeorder="`vector`

"):...- cnEdges
`signature`

(object="`catNetwork`

", which="`vector`

"):...- cnMatEdges
`signature`

(object="`catNetwork`

"):...- cnProb
`signature`

(object="`catNetwork`

"):...- cnSetProb
`signature`

(object="`catNetwork`

", psamples="`matrix`

"):...- cnPlot
`signature`

(object="`catNetwork`

"):...- cnDot
`signature`

(object="`catNetwork`

", file="`character`

"):...- cnSamples
`signature`

(object="`catNetwork`

", nsamples="`integer`

"):...- cnSamplesPert
`signature`

(object="`catNetwork`

", nsamples="`integer`

", perturbations="`matrix`

"):...- cnOrder
`signature`

(object="`catNetwork`

"):...- cnLoglik
`signature`

(object="`catNetwork`

", psamples="`matrix`

"):...- cnComplexity
`signature`

(object="`catNetwork`

"):...- cnEvaluate
`signature`

(object="`catNetwork`

", psamples="`matrix`

", perturbations="`matrix`

", maxComplexity="`integer`

"):...- cnPredict
`signature`

(object="`catNetwork`

", psamples="`matrix`

"):...- cnCompare
`signature`

(object1="`catNetwork`

", object2="`catNetwork`

"):...

N. Balov

`cnRandomCatnet`

, `cnCatnetFromEdges`

, `cnNew`

,
`cnNodes`

, `cnEdges`

, `cnComplexity`

, `cnPlot`

set.seed(123) cnet <- cnRandomCatnet(numnodes=10, maxParents=2, numCategories=2) cnet

[Package *catnet* version 1.15.7 Index]