Learn R Programming

catnet (version 1.00.0)

cnProb-method: Conditional Probability Structure of Network

Description

Returns the list of node conditional probabilities of a catNetwork object.

Usage

cnProb(object, which, file)

Arguments

object
a catNetwork object
which
a vector of indices
file
a character, an optional file for the output to be written to

Value

  • A list of probabilities of nodes with indices which and all node probabilities if which is not specified. If file is given, the result is written to a file with that name. Node probabilities are reported in the following format. First, node name and its parents are given, then a list of probability values corresponding to all combination of parent categories (put in brackets) and node categories. For example, the conditional probability of a node with two parents, such that both the node and its parents have three categories, is given by 27 values, one for each of the 3*3*3 combination.

Examples

Run this code
library(catnet)
  cnet <- cnRandomCatnet(numnodes=10, maxParents=3, numCategories=2)
  cnProb(object=cnet)

Run the code above in your browser using DataLab