BNgenerics {Peanut}R Documentation

Aliases for generic Bayesian network functions.

Description

These are all mostly self-explantory functions which almost any Bayesian network implementation will support. These are alias of these functions so that generic functions can be written using Peanut which will support almost all Bayes net implementation.

Usage

PnodeName(node)
PnodeStates(node)
PnodeNumStates(node)
PnodeParents(node)
PnodeNumParents(node)
PnodeParentNames(node)

Arguments

node

A object of a type which could be a Pnode, athough it does not necessarily need Pnode special properties.

Details

The general idea is to find a minimal set of common Bayes net functions that any reasonable Bayes net package is likely to support so that basic code can be written which is generic across Bayes net packages. For example, if nd is a NeticaNode object, then PnodeName(nd) is a synonym for NodeName(nd). However, using PnodeName(nd) is more portable as it could expand to another function if using a different Bayes net package.

The goal is to be able to write simple loops based on things like number of parents and number of states which are common to most implementations.

Value

The expression PnodeName(node) returns a character scalar giving the name of node.

The expression PnodeStates(node) returns a character vector giving the names of the states of node.

The expression PnodeNumStates(node) returns an integer scalar giving the number of states of node.

The expression PnodeParents(node) returns a list giving the parent objects.

The expression PnodeNumParents(node) returns an integer scalar giving the number of parents of node.

The expression PnodeStates(node) returns a character vector giving the names of the parents of node.

Author(s)

Russell Almond

Examples

## Not run: 
PnodeName.NeticaNode <- function (node)
  NodeName(node)

PnodeStates.NeticaNode <- function (node)
  NodeStates(node)

PnodeNumStates.NeticaNode <- function (node)
  NodeNumStates(node)

PnodeParents.NeticaNode <- function (node)
  NodeParents(node)

PnodeParentNames.NeticaNode <- function (node)
  sapply(NodeParents(node),NodeName)

PnodeNumParents.NeticaNode <- function (node)
  length(NodeParents(node))


## End(Not run)

[Package Peanut version 0.6-1 Index]