Learn R Programming

BiDAG (version 2.0.2)

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 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.

Examples

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

Run the code above in your browser using DataLab