Learn R Programming

BiDAG (version 2.1.4)

plotdiffsDBN: Plotting difference between two DBNs

Description

This function plots an estimated DBN such that the edges which are different to the ground truth DBN are highlighted.

Usage

plotdiffsDBN(
  eDBN,
  trueDBN,
  struct = c("init", "trans"),
  b = 0,
  showcl = TRUE,
  orientation = "TB",
  ...
)

Value

plots the graph highlights differences between 'eDBN' (estimated DBN) and 'trueDBN' (ground truth); edges which are different in 'eDBN' compared to 'trueDBN' are coloured according to the type of a difference: false-positive, false-negative and error in direction.

Arguments

eDBN

object of class graphNEL (or its adjacency matrix), representing estimated structure (not necessarily acyclic) to be compared to the ground truth graph

trueDBN

object of class graphNEL (or its adjacency matrix), representing the ground truth structure (not necessarily acyclic)

struct

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

b

number of static variables in one time slice of a DBN; note that for function to work correctly all static variables have to be in the first b columns of the matrix

showcl

logical, when TRUE (default) nodes are shown in clusters according to the time slice the belong to

orientation

orientation of the graph layout, possible options are 'TB' (top-bottom) and 'LR' (left-right)

...

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

Author

Polina Suter

Examples

Run this code
dbnscore<-scoreparameters("bge",DBNdata,
dbnpar = list(samestruct=TRUE, slices=5, b=3),
DBN=TRUE)
if (FALSE) {
orderDBNfit<-learnBN(dbnscore,algorithm="order")
iterDBNfit<-learnBN(dbnscore,algorithm="orderIter")
plotdiffsDBN(getDAG(orderDBNfit),DBNmat,struct="trans",b=3)
plotdiffsDBN(getDAG(iterDBNfit),DBNmat,struct="trans",b=3)
}

Run the code above in your browser using DataLab