cnNodeMarginalProb-method {catnet}R Documentation

Probability Calculations

Description

Marginal probability of a node, joint probability of a set of nodes or conditional probability of two sets of nodes.

Usage

cnNodeMarginalProb(object, node)
cnJointProb(object, nodes)
cnCondProb(object, x, y)

Arguments

object

a catNetwork

node

an integer, a node index in object

nodes

a vector of node names or indices in object

x,y

vectors of node categories (either characters or indices) named after nodes of object

Details

cnJointProb returns a matrix with probability values for each combinations of categories arranged in columns. cnCondProb calculates the value of P(X=x|Y=y).

Value

a numerical or numerical matrix

Author(s)

N. Balov

See Also

cnProb

Examples

  library(catnet)
  cnet <- cnRandomCatnet(numnodes=10, maxParents=3, numCategories=2)
  cnNodeMarginalProb(cnet, node=5)
  cnCondProb(cnet, x=c("N1"=1, "N2"=2), y=c("N3"=1, "N4"=2, "N5"=2))

[Package catnet version 1.15.7 Index]