Learn R Programming

catnet (version 1.08.2)

cnRandomCatnet: Random Network

Description

Creates a random catNetwork with specified number of nodes, number of parents and categories per node.

Usage

cnRandomCatnet(numnodes, maxParents, numCategories)

Arguments

numnodes
an integer, the number of nodes
maxParents
an integer, the maximum number of parents per node
numCategories
an integer, the number of categories for each node. It is the function limitation to support only constant number of node categories.

Value

  • A catNetwork object

Details

A random set of parents, no more than maxParents, is assigned to each node along with a random conditional probability distribution. Also, each node is assigned a fixed, thus equal, number of categories, numCategories.

The function is designed for evaluation and testing purposes only thus lacking much user control over the networks it create. Once created with cnRandomCatnet, a network can be further modified manually node by node. However, this requires direct manipulation of the object's slots and may result in a wrong network object. It is recommended that after any manual manipulation a call is(object, "catNetwork") is performed to check the object's integrity.

See Also

cnNew

Examples

Run this code
cnet <- cnRandomCatnet(numnodes=20, maxParents=3, numCategories=2)

Run the code above in your browser using DataLab