Learn R Programming

sdnet (version 2.4.1)

cnNodeMarginalProb-method: 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

Value

a numerical or numerical matrix

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).

See Also

cnProb

Examples

Run this code
# NOT RUN {
  cnet <- cnRandomCatnet(numnodes=10, maxpars=3, numcats=2)
  cnNodeMarginalProb(cnet, node=5)
  cnCondProb(cnet, x=c("N1"=1, "N2"=2), y=c("N3"=1, "N4"=2, "N5"=2))
# }

Run the code above in your browser using DataLab