Learn R Programming

BiDAG (version 2.1.4)

plotDBN: Plotting a DBN

Description

This function can be used for plotting initial and transition structures of a dynamic Bayesian network.

Usage

plotDBN(DBN, struct = c("init", "trans"), b = 0, shape = "circle", ...)

Value

plots the DBN defined by the adjacency matrix 'DBN' and number of static and dynamic variables. When 'struct' equals "trans" the transition structure is plotted, otherwise initial structure is plotted

Arguments

DBN

binary matrix (or a graph object) representing a 2-step DBN (compact or unrolled)

struct

option used to determine if the initial or the transition structure should be plotted; acceptable values are init or trans

b

number of static variables in the DBN, 0 by default; note that for function to work correctly all static variables have to be in the first b columns of the matrix

shape

string, defining the shape of the box around each node; possible values are circle, ellipse, box

...

optional parameters passed to Rgraphviz plotting functions e.g. main, fontsize

Author

Polina Suter

Examples

Run this code
plotDBN(DBNmat, "init", b=3)
plotDBN(DBNmat, "trans", b=3)

Run the code above in your browser using DataLab