Learn R Programming

BiDAG (version 2.0.0)

plotdiffs.DBN: 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

plotdiffs.DBN(
  eDBN,
  trueDBN,
  struct = c("init", "trans"),
  n.dynamic,
  n.static = 0
)

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

n.dynamic

number of dynamic variables in one time slice of a DBN

n.static

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 n.static columns of the matrix

Value

plots the graph which includes edges from graph1 and graph2, however edges which are different in graph1 compared to graph2 are coloured according to the type of a mistake: false positive with red, false negative with dashed grey, error in direction with magenta

Examples

Run this code
# NOT RUN {
dbnscore<-scoreparameters("bge",DBNdata,
dbnpar = list(samestruct=TRUE, slices=5, stationary=TRUE),
DBN=TRUE,bgnodes=c(1,2,3))
# }
# NOT RUN {
orderDBNfit<-iterativeMCMC(dbnscore,chainout = TRUE, mergetype = "skeleton",scoreout=TRUE,alpha=0.4)
plotdiffs.DBN(orderDBNfit$max$DAG,DBNmat,struct="trans",n.dynamic=12,n.static=3)
plotdiffs.DBN(orderDBNfit$max$DAG,DBNmat,struct="init",n.dynamic=12,n.static=3)
# }

Run the code above in your browser using DataLab