catNetwork-class: Class "catNetwork"

Description Details Objects from the Class Slots Methods Author(s) See Also Examples

Description

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.

Details

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 from the Class

Objects can be created by calls of

cnNew(nodes, cats, pars, probs)

cnRandomCatnet(numnodes, maxpars, numCategories)

cnCatnetFromEdges(nodes, edges, numCategories)

cnCatnetFromSif(file) cnCatnetFromBif(file) cnCatnetFromXdsl(file)

Slots

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.

pars:

a list specifying the node pars. The list pars must be the same length as nodes. Parents are kept as indices in the nodes vector.

cats:

a list of characters specifying a set of categorical values for each node.

probs:

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 probs are lists themselves. See cnProb function for more details.

maxpars:

an integer, the maximum number of node pars.

maxcats:

an integer, the maximum number of node cats.

meta:

an object of class character storing some meta-data information.

nodecomplx:

a numerical vector, the node complexities.

nodelik:

a numerical vector, the node likelihoods of the sample being used for estimation.

complx:

an integer, the network complx

loglik:

a numerical, the total loglik of the sample being used for estimation

nodeSampleSizes:

a numerical vector, if the object is an estimate, the node sample sizes.

Methods

cnNew

signature(nodes="vector", cats="list", pars="list", probs="list"): Creating a new class object.

cnRandomCatnet

signature(numnodes="integer", maxpars="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"):...

Author(s)

N. Balov

See Also

cnRandomCatnet, cnCatnetFromEdges, cnNew, cnNodes, cnEdges, cnComplexity, cnPlot

Examples

1
2
3
  set.seed(123)
  cnet <- cnRandomCatnet(numnodes=10, maxpars=2, numcats=2)
  cnet

sdnet documentation built on May 2, 2019, 12:43 a.m.