Learn R Programming

abn (version 1.3)

infoDag: Compute standard information for a DAG.

Description

This function returns standard metrics for DAG description. A list that contains the number of nodes, the number of arcs, the average Markov blanket size, the neighbourhood average set size, the parent average set size and children average set size.

Usage

infoDag(dag.m=NULL, 
        name=NULL)

Arguments

dag.m

a matrix or a formula statement (see details for format) defining the network structure, a directed acyclic graph (DAG). Note that row names must be set or given in data.dists

name

a vector of names if the DAG is given via formula, see details.

Value

A named list that contains following entries: the number of nodes, the number of arcs, the average Markov blanket size, the neighbourhood average set size, the parent average set size and children average set size.

Details

This function returns a named list with the following entries: the number of nodes, the number of arcs, the average Markov blanket size, the neighbourhood average set size, the parent average set size and children average set size.

The dag.m can be provided using a formula statement (similar to glm). A typical formula is ~ node1|parent1:parent2 + node2:node3|parent3. The formula statement have to start with ~. In this example, node1 has two parents (parent1 and parent2). node2 and node3 have the same parent3. The parents names have to exactly match those given in name. : is the separator between either children or parents, | separates children (left side) and parents (right side), + separates terms, . replaces all the variables in name.

References

West, Douglas Brent. Introduction to graph theory. Vol. 2. Upper Saddle River: Prentice hall, (2001).

Further information about abn can be found at: http://www.r-bayesian-networks.org

Examples

Run this code
# NOT RUN {
##creating a dag:
    dag <- matrix(data = c(1,0,0,0,1,0,1,0,1), nrow = 3,ncol = 3)
    dist <- list(a="gaussian",b="gaussian",c="gaussian")
    colnames(dag) <- rownames(dag) <- names(dist)
    
    infoDag(dag.m = dag)
# }

Run the code above in your browser using DataLab